Use Ordered.HIGHEST_PRECEDENCE constants

Use Ordered.HIGHEST_PRECEDENCE rather than Integer.MIN_VALUE.

Closes gh-4335
pull/4335/merge
Johnny Lim 9 years ago committed by Phillip Webb
parent 9f8eda18b7
commit 83e8bfedb2

@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.social;
import java.util.List; import java.util.List;
import org.springframework.core.Ordered;
import org.thymeleaf.spring4.SpringTemplateEngine; import org.thymeleaf.spring4.SpringTemplateEngine;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -104,7 +105,7 @@ public class SocialWebAutoConfiguration {
@ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views") @ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views")
public BeanNameViewResolver beanNameViewResolver() { public BeanNameViewResolver beanNameViewResolver() {
BeanNameViewResolver viewResolver = new BeanNameViewResolver(); BeanNameViewResolver viewResolver = new BeanNameViewResolver();
viewResolver.setOrder(Integer.MIN_VALUE); viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE);
return viewResolver; return viewResolver;
} }

@ -317,7 +317,7 @@ public class WebMvcAutoConfiguration {
@Bean @Bean
public SimpleUrlHandlerMapping faviconHandlerMapping() { public SimpleUrlHandlerMapping faviconHandlerMapping() {
SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping(); SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
mapping.setOrder(Integer.MIN_VALUE + 1); mapping.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
mapping.setUrlMap(Collections.singletonMap("**/favicon.ico", mapping.setUrlMap(Collections.singletonMap("**/favicon.ico",
faviconRequestHandler())); faviconRequestHandler()));
return mapping; return mapping;

@ -61,7 +61,7 @@ public class ContextIdApplicationContextInitializer implements
private final String name; private final String name;
private int order = Integer.MAX_VALUE - 10; private int order = Ordered.LOWEST_PRECEDENCE - 10;
public ContextIdApplicationContextInitializer() { public ContextIdApplicationContextInitializer() {
this(NAME_PATTERN); this(NAME_PATTERN);

@ -30,7 +30,7 @@ import org.springframework.web.context.ConfigurableWebApplicationContext;
public class ServletContextApplicationContextInitializer implements public class ServletContextApplicationContextInitializer implements
ApplicationContextInitializer<ConfigurableWebApplicationContext>, Ordered { ApplicationContextInitializer<ConfigurableWebApplicationContext>, Ordered {
private int order = Integer.MIN_VALUE; private int order = Ordered.HIGHEST_PRECEDENCE;
private final ServletContext servletContext; private final ServletContext servletContext;

Loading…
Cancel
Save