Browse Source

DispatcherServlet.getHandlerMappings() accessor declared as final

Issue: SPR-15934
pull/1534/head
Juergen Hoeller 8 years ago
parent
commit
9ff4c0bff8
  1. 36
      spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

36
spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

@ -770,20 +770,6 @@ public class DispatcherServlet extends FrameworkServlet { @@ -770,20 +770,6 @@ public class DispatcherServlet extends FrameworkServlet {
}
}
/**
* Return the configured {@link HandlerMapping} beans that were detected by
* type in the {@link WebApplicationContext} or initialized based on the
* default set of strategies from {@literal DispatcherServlet.properties}.
* <p><strong>Note:</strong> This method may return {@code null} if invoked
* prior to {@link #onRefresh(ApplicationContext)}.
* @return immutable list with the configured mappings or {@code null}
* @since 5.0
*/
@Nullable
public List<HandlerMapping> getHandlerMappings() {
return this.handlerMappings != null ? Collections.unmodifiableList(this.handlerMappings) : null;
}
/**
* Return this servlet's ThemeSource, if any; else return {@code null}.
* <p>Default is to return the WebApplicationContext as ThemeSource,
@ -793,12 +779,7 @@ public class DispatcherServlet extends FrameworkServlet { @@ -793,12 +779,7 @@ public class DispatcherServlet extends FrameworkServlet {
*/
@Nullable
public final ThemeSource getThemeSource() {
if (getWebApplicationContext() instanceof ThemeSource) {
return (ThemeSource) getWebApplicationContext();
}
else {
return null;
}
return (getWebApplicationContext() instanceof ThemeSource ? (ThemeSource) getWebApplicationContext() : null);
}
/**
@ -811,6 +792,21 @@ public class DispatcherServlet extends FrameworkServlet { @@ -811,6 +792,21 @@ public class DispatcherServlet extends FrameworkServlet {
return this.multipartResolver;
}
/**
* Return the configured {@link HandlerMapping} beans that were detected by
* type in the {@link WebApplicationContext} or initialized based on the
* default set of strategies from {@literal DispatcherServlet.properties}.
* <p><strong>Note:</strong> This method may return {@code null} if invoked
* prior to {@link #onRefresh(ApplicationContext)}.
* @return an immutable list with the configured mappings, or {@code null}
* if not initialized yet
* @since 5.0
*/
@Nullable
public final List<HandlerMapping> getHandlerMappings() {
return (this.handlerMappings != null ? Collections.unmodifiableList(this.handlerMappings) : null);
}
/**
* Return the default strategy object for the given strategy interface.
* <p>The default implementation delegates to {@link #getDefaultStrategies},

Loading…
Cancel
Save