diff --git a/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java b/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java index 265f91a39d1..e3c296d8eef 100644 --- a/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java +++ b/spring-context/src/main/java/org/springframework/context/event/ApplicationContextEvent.java @@ -20,9 +20,10 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationEvent; /** - * Base class for events raised for an {@code ApplicationContext}. + * Base class for events raised for an {@link ApplicationContext}. * * @author Juergen Hoeller + * @author Sam Brannen * @since 2.5 */ @SuppressWarnings("serial") @@ -30,7 +31,7 @@ public abstract class ApplicationContextEvent extends ApplicationEvent { /** * Create a new {@code ApplicationContextEvent}. - * @param source the {@code ApplicationContext} that the event is raised for + * @param source the {@link ApplicationContext} that the event is raised for * (must not be {@code null}) */ public ApplicationContextEvent(ApplicationContext source) { @@ -38,10 +39,22 @@ public abstract class ApplicationContextEvent extends ApplicationEvent { } /** - * Get the {@code ApplicationContext} that the event was raised for. + * Get the {@link ApplicationContext} that the event was raised for. + * @return the {@code ApplicationContext} that the event was raised for + * @since 7.0 + * @see #getApplicationContext() + */ + @Override + public ApplicationContext getSource() { + return getApplicationContext(); + } + + /** + * Get the {@link ApplicationContext} that the event was raised for. + * @see #getSource() */ public final ApplicationContext getApplicationContext() { - return (ApplicationContext) getSource(); + return (ApplicationContext) super.getSource(); } }