Skip to content

Commit 6f9d7da

Browse files
committed
Consistent use of LinkedHashSet for interfaces (since interface order may matter in subtle cases)
(cherry picked from commit 5a63117)
1 parent 47ed4d6 commit 6f9d7da

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
import java.lang.reflect.InvocationTargetException;
2020
import java.lang.reflect.Method;
2121
import java.lang.reflect.Proxy;
22-
import java.util.HashSet;
22+
import java.util.LinkedHashSet;
2323
import java.util.LinkedList;
2424
import java.util.List;
2525
import java.util.Set;
@@ -215,7 +215,7 @@ public static boolean canApply(Pointcut pc, Class<?> targetClass, boolean hasInt
215215
introductionAwareMethodMatcher = (IntroductionAwareMethodMatcher) methodMatcher;
216216
}
217217

218-
Set<Class<?>> classes = new HashSet<Class<?>>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
218+
Set<Class<?>> classes = new LinkedHashSet<Class<?>>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
219219
classes.add(targetClass);
220220
for (Class<?> clazz : classes) {
221221
Method[] methods = clazz.getMethods();

spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
package org.springframework.aop.support;
1818

1919
import java.io.Serializable;
20-
import java.util.HashSet;
20+
import java.util.LinkedHashSet;
2121
import java.util.Set;
2222

2323
import org.aopalliance.aop.Advice;
@@ -43,7 +43,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
4343

4444
private final Advice advice;
4545

46-
private final Set<Class<?>> interfaces = new HashSet<Class<?>>();
46+
private final Set<Class<?>> interfaces = new LinkedHashSet<Class<?>>();
4747

4848
private int order = Integer.MAX_VALUE;
4949

spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
import java.io.ObjectInputStream;
2121
import java.io.Serializable;
2222
import java.lang.reflect.Method;
23-
import java.util.HashSet;
23+
import java.util.LinkedHashSet;
2424
import java.util.Map;
2525
import java.util.Set;
2626
import java.util.concurrent.ConcurrentHashMap;
@@ -43,7 +43,7 @@
4343
@SuppressWarnings("serial")
4444
public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
4545

46-
protected final Set<Class<?>> publishedInterfaces = new HashSet<Class<?>>();
46+
protected final Set<Class<?>> publishedInterfaces = new LinkedHashSet<Class<?>>();
4747

4848
private transient Map<Method, Boolean> rememberedMethods = new ConcurrentHashMap<Method, Boolean>(32);
4949

0 commit comments

Comments
 (0)