diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java
index 1bcb7978964..71cf05e6342 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,9 +52,9 @@ public class ProxyProcessorSupport extends ProxyConfig implements Ordered, BeanC
/**
- * Set the ordering which will apply to this class's implementation
- * of Ordered, used when applying multiple processors.
- *
Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.
+ * Set the ordering which will apply to this processor's implementation
+ * of {@link Ordered}, used when applying multiple processors.
+ *
The default value is {@code Ordered.LOWEST_PRECEDENCE}, meaning non-ordered.
* @param order the ordering value
*/
public void setOrder(int order) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
index 3b4896273fb..b6ad61c4825 100644
--- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
@@ -46,7 +46,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
private final Set> interfaces = new LinkedHashSet<>();
- private int order = Integer.MAX_VALUE;
+ private int order = Ordered.LOWEST_PRECEDENCE;
/**
@@ -119,7 +119,6 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
}
}
-
public void setOrder(int order) {
this.order = order;
}
@@ -129,7 +128,6 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
return this.order;
}
-
@Override
public Advice getAdvice() {
return this.advice;
diff --git a/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java
index ecbc42397b5..70970388acf 100644
--- a/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,10 +36,10 @@ import org.springframework.util.Assert;
public abstract class StaticMethodMatcherPointcutAdvisor extends StaticMethodMatcherPointcut
implements PointcutAdvisor, Ordered, Serializable {
- private int order = Integer.MAX_VALUE;
-
private Advice advice = EMPTY_ADVICE;
+ private int order = Ordered.LOWEST_PRECEDENCE;
+
/**
* Create a new StaticMethodMatcherPointcutAdvisor,
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/ResourceHandlerRegistry.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/ResourceHandlerRegistry.java
index 3ca0bb3bdfe..3d9ae6f5957 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/ResourceHandlerRegistry.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/ResourceHandlerRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.BeanInitializationException;
+import org.springframework.core.Ordered;
import org.springframework.core.io.ResourceLoader;
import org.springframework.lang.Nullable;
import org.springframework.web.reactive.handler.AbstractUrlHandlerMapping;
@@ -56,7 +57,7 @@ public class ResourceHandlerRegistry {
private final List registrations = new ArrayList<>();
- private int order = Integer.MAX_VALUE -1;
+ private int order = Ordered.LOWEST_PRECEDENCE -1;
/**
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractHandlerMapping.java b/spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractHandlerMapping.java
index cae5ea8e484..2783640711e 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractHandlerMapping.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractHandlerMapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,33 +49,20 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
private static final WebHandler REQUEST_HANDLED_HANDLER = exchange -> Mono.empty();
- private int order = Integer.MAX_VALUE; // default: same as non-Ordered
-
private final PathPatternParser patternParser;
private final UrlBasedCorsConfigurationSource globalCorsConfigSource;
private CorsProcessor corsProcessor = new DefaultCorsProcessor();
+ private int order = Ordered.LOWEST_PRECEDENCE; // default: same as non-Ordered
+
public AbstractHandlerMapping() {
this.patternParser = new PathPatternParser();
this.globalCorsConfigSource = new UrlBasedCorsConfigurationSource(this.patternParser);
}
- /**
- * Specify the order value for this HandlerMapping bean.
- *
Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.
- * @see org.springframework.core.Ordered#getOrder()
- */
- public final void setOrder(int order) {
- this.order = order;
- }
-
- @Override
- public final int getOrder() {
- return this.order;
- }
/**
* Shortcut method for setting the same property on the underlying pattern
@@ -140,6 +127,20 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
return this.corsProcessor;
}
+ /**
+ * Specify the order value for this HandlerMapping bean.
+ *
The default value is {@code Ordered.LOWEST_PRECEDENCE}, meaning non-ordered.
+ * @see org.springframework.core.Ordered#getOrder()
+ */
+ public void setOrder(int order) {
+ this.order = order;
+ }
+
+ @Override
+ public int getOrder() {
+ return this.order;
+ }
+
@Override
public Mono