From 8d67a982ece90ed00deb98014656c6c4cb35a50e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 17 Apr 2018 23:45:24 +0200 Subject: [PATCH] Correctly delegate to OrderUtils.getPriority for DecoratingProxy Issue: SPR-16739 --- .../core/annotation/AnnotationAwareOrderComparator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java index 01ddd5bea82..6cd5f487288 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 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. @@ -58,6 +58,7 @@ public class AnnotationAwareOrderComparator extends OrderComparator { * elements, in addition to the {@link org.springframework.core.Ordered} * check in the superclass. */ + @Override protected Integer findOrder(Object obj) { // Check for regular Ordered interface Integer order = super.findOrder(obj); @@ -97,6 +98,7 @@ public class AnnotationAwareOrderComparator extends OrderComparator { * annotation: typically, selecting one object over another in case of * multiple matches but only one object to be returned. */ + @Override public Integer getPriority(Object obj) { Integer priority = null; if (obj instanceof Class) { @@ -105,7 +107,7 @@ public class AnnotationAwareOrderComparator extends OrderComparator { else if (obj != null) { priority = OrderUtils.getPriority(obj.getClass()); if (priority == null && obj instanceof DecoratingProxy) { - priority = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass()); + priority = OrderUtils.getPriority(((DecoratingProxy) obj).getDecoratedClass()); } } return priority;