Browse Source

Consistent use of LinkedHashSet for interfaces (since interface order may matter in subtle cases)

pull/658/head
Juergen Hoeller 10 years ago
parent
commit
5a631177ff
  1. 6
      spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
  2. 6
      spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
  3. 6
      spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@ -19,7 +19,7 @@ package org.springframework.aop.support; @@ -19,7 +19,7 @@ package org.springframework.aop.support;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@ -215,7 +215,7 @@ public abstract class AopUtils { @@ -215,7 +215,7 @@ public abstract class AopUtils {
introductionAwareMethodMatcher = (IntroductionAwareMethodMatcher) methodMatcher;
}
Set<Class<?>> classes = new HashSet<Class<?>>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
Set<Class<?>> classes = new LinkedHashSet<Class<?>>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
classes.add(targetClass);
for (Class<?> clazz : classes) {
Method[] methods = clazz.getMethods();

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
package org.springframework.aop.support;
import java.io.Serializable;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.aopalliance.aop.Advice;
@ -43,7 +43,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil @@ -43,7 +43,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
private final Advice advice;
private final Set<Class<?>> interfaces = new HashSet<Class<?>>();
private final Set<Class<?>> interfaces = new LinkedHashSet<Class<?>>();
private int order = Integer.MAX_VALUE;

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@ -20,7 +20,7 @@ import java.io.IOException; @@ -20,7 +20,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@ -43,7 +43,7 @@ import org.springframework.util.ClassUtils; @@ -43,7 +43,7 @@ import org.springframework.util.ClassUtils;
@SuppressWarnings("serial")
public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
protected final Set<Class<?>> publishedInterfaces = new HashSet<Class<?>>();
protected final Set<Class<?>> publishedInterfaces = new LinkedHashSet<Class<?>>();
private transient Map<Method, Boolean> rememberedMethods = new ConcurrentHashMap<Method, Boolean>(32);

Loading…
Cancel
Save