Browse Source

SPR-17074 Replace iteration over Map::ketSet with Map::entrySet

pull/1893/head
stsypanov 8 years ago committed by Juergen Hoeller
parent
commit
5051850fa9
  1. 5
      spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java
  2. 5
      spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  3. 5
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

5
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java

@ -208,9 +208,10 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac @@ -208,9 +208,10 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
}
private AspectJAnnotationType determineAnnotationType(A annotation) {
for (Class<?> type : annotationTypes.keySet()) {
for (Map.Entry<Class<?>, AspectJAnnotationType> typeEntry : annotationTypes.entrySet()) {
Class<?> type = typeEntry.getKey();
if (type.isInstance(annotation)) {
return annotationTypes.get(type);
return typeEntry.getValue();
}
}
throw new IllegalStateException("Unknown annotation type: " + annotation.toString());

5
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

@ -1273,9 +1273,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -1273,9 +1273,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
String[] candidateNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(
this, requiredType, true, descriptor.isEager());
Map<String, Object> result = new LinkedHashMap<>(candidateNames.length);
for (Class<?> autowiringType : this.resolvableDependencies.keySet()) {
for (Map.Entry<Class<?>, Object> classObjectEntry : this.resolvableDependencies.entrySet()) {
Class<?> autowiringType = classObjectEntry.getKey();
if (autowiringType.isAssignableFrom(requiredType)) {
Object autowiringValue = this.resolvableDependencies.get(autowiringType);
Object autowiringValue = classObjectEntry.getValue();
autowiringValue = AutowireUtils.resolveAutowiringValue(autowiringValue, requiredType);
if (requiredType.isInstance(autowiringValue)) {
result.put(ObjectUtils.identityToString(autowiringValue), autowiringValue);

5
spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

@ -1344,11 +1344,12 @@ public abstract class AnnotationUtils { @@ -1344,11 +1344,12 @@ public abstract class AnnotationUtils {
}
// Replace any remaining placeholders with actual default values
for (String attributeName : attributes.keySet()) {
for (Map.Entry<String, Object> attributeEntry : attributes.entrySet()) {
String attributeName = attributeEntry.getKey();
if (valuesAlreadyReplaced.contains(attributeName)) {
continue;
}
Object value = attributes.get(attributeName);
Object value = attributeEntry.getValue();
if (value instanceof DefaultValueHolder) {
value = ((DefaultValueHolder) value).defaultValue;
attributes.put(attributeName,

Loading…
Cancel
Save