Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Dec 22, 2014
1 parent fa138d2 commit dfdfc03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -151,7 +152,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
private boolean hasDestructionAwareBeanPostProcessors;

/** Map from scope identifier String to corresponding Scope */
private final Map<String, Scope> scopes = new HashMap<String, Scope>(8);
private final Map<String, Scope> scopes = new LinkedHashMap<String, Scope>(8);

/** Security context used when running with a SecurityManager */
private SecurityContextProvider securityContextProvider;
Expand Down Expand Up @@ -856,11 +857,15 @@ public void registerScope(String scopeName, Scope scope) {
throw new IllegalArgumentException("Cannot replace existing scopes 'singleton' and 'prototype'");
}
Scope previous = this.scopes.put(scopeName, scope);
if (previous != null && logger.isInfoEnabled()) {
logger.info("Replacing scope '" + scopeName + "' from '" + previous + "' to '" + scope);
if (previous != null && previous != scope) {
if (logger.isInfoEnabled()) {
logger.info("Replacing scope '" + scopeName + "' from [" + previous + "] to [" + scope + "]");
}
}
else if (previous == null && logger.isDebugEnabled()) {
logger.debug("Registering scope '" + scopeName + "' with '" + scope + "'");
else {
if (logger.isDebugEnabled()) {
logger.debug("Registering scope '" + scopeName + "' with implementation [" + scope + "]");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ public static boolean isPrimitiveWrapperArray(Class<?> clazz) {
*/
public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
return (clazz.isPrimitive() && clazz != void.class? primitiveTypeToWrapperMap.get(clazz) : clazz);
return (clazz.isPrimitive() && clazz != void.class ? primitiveTypeToWrapperMap.get(clazz) : clazz);
}

/**
Expand Down

0 comments on commit dfdfc03

Please sign in to comment.