Polishing

This commit is contained in:
Juergen Hoeller 2013-05-14 21:20:24 +02:00
parent 5dbbd8fe72
commit 59ef34d769
2 changed files with 13 additions and 18 deletions

View File

@ -45,44 +45,42 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
private static final String AJ_ID = "[AspectJ] "; private static final String AJ_ID = "[AspectJ] ";
private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver"); private static final Log logger = LogFactory.getLog("AspectJ Weaver");
@Override @Override
public boolean handleMessage(IMessage message) throws AbortException { public boolean handleMessage(IMessage message) throws AbortException {
Kind messageKind = message.getKind(); Kind messageKind = message.getKind();
if (messageKind == IMessage.DEBUG) { if (messageKind == IMessage.DEBUG) {
if (LOGGER.isDebugEnabled() || LOGGER.isTraceEnabled()) { if (logger.isDebugEnabled()) {
LOGGER.debug(makeMessageFor(message)); logger.debug(makeMessageFor(message));
return true; return true;
} }
} }
else if ((messageKind == IMessage.INFO) || (messageKind == IMessage.WEAVEINFO)) { else if (messageKind == IMessage.INFO || messageKind == IMessage.WEAVEINFO) {
if (LOGGER.isInfoEnabled()) { if (logger.isInfoEnabled()) {
LOGGER.info(makeMessageFor(message)); logger.info(makeMessageFor(message));
return true; return true;
} }
} }
else if (messageKind == IMessage.WARNING) { else if (messageKind == IMessage.WARNING) {
if (LOGGER.isWarnEnabled()) { if (logger.isWarnEnabled()) {
LOGGER.warn(makeMessageFor(message)); logger.warn(makeMessageFor(message));
return true; return true;
} }
} }
else if (messageKind == IMessage.ERROR) { else if (messageKind == IMessage.ERROR) {
if (LOGGER.isErrorEnabled()) { if (logger.isErrorEnabled()) {
LOGGER.error(makeMessageFor(message)); logger.error(makeMessageFor(message));
return true; return true;
} }
} }
else if (messageKind == IMessage.ABORT) { else if (messageKind == IMessage.ABORT) {
if (LOGGER.isFatalEnabled()) { if (logger.isFatalEnabled()) {
LOGGER.fatal(makeMessageFor(message)); logger.fatal(makeMessageFor(message));
return true; return true;
} }
} }
return false; return false;
} }

View File

@ -171,6 +171,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
setParentBeanFactory(parentBeanFactory); setParentBeanFactory(parentBeanFactory);
} }
/** /**
* Set the instantiation strategy to use for creating bean instances. * Set the instantiation strategy to use for creating bean instances.
* Default is CglibSubclassingInstantiationStrategy. * Default is CglibSubclassingInstantiationStrategy.
@ -261,7 +262,6 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
this.ignoredDependencyInterfaces.add(ifc); this.ignoredDependencyInterfaces.add(ifc);
} }
@Override @Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) { public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
super.copyConfigurationFrom(otherFactory); super.copyConfigurationFrom(otherFactory);
@ -352,10 +352,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
else { else {
Object bean; Object bean;
final BeanFactory parent = this; final BeanFactory parent = this;
if (System.getSecurityManager() != null) { if (System.getSecurityManager() != null) {
bean = AccessController.doPrivileged(new PrivilegedAction<Object>() { bean = AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override @Override
public Object run() { public Object run() {
return getInstantiationStrategy().instantiate(bd, null, parent); return getInstantiationStrategy().instantiate(bd, null, parent);
@ -365,7 +363,6 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
else { else {
bean = getInstantiationStrategy().instantiate(bd, null, parent); bean = getInstantiationStrategy().instantiate(bd, null, parent);
} }
populateBean(beanClass.getName(), bd, new BeanWrapperImpl(bean)); populateBean(beanClass.getName(), bd, new BeanWrapperImpl(bean));
return bean; return bean;
} }