Skip to content

Commit 59ef34d

Browse files
committed
Polishing
1 parent 5dbbd8f commit 59ef34d

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java

+12-14
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,42 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
4545

4646
private static final String AJ_ID = "[AspectJ] ";
4747

48-
private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver");
48+
private static final Log logger = LogFactory.getLog("AspectJ Weaver");
4949

5050

5151
@Override
5252
public boolean handleMessage(IMessage message) throws AbortException {
5353
Kind messageKind = message.getKind();
54-
5554
if (messageKind == IMessage.DEBUG) {
56-
if (LOGGER.isDebugEnabled() || LOGGER.isTraceEnabled()) {
57-
LOGGER.debug(makeMessageFor(message));
55+
if (logger.isDebugEnabled()) {
56+
logger.debug(makeMessageFor(message));
5857
return true;
5958
}
6059
}
61-
else if ((messageKind == IMessage.INFO) || (messageKind == IMessage.WEAVEINFO)) {
62-
if (LOGGER.isInfoEnabled()) {
63-
LOGGER.info(makeMessageFor(message));
60+
else if (messageKind == IMessage.INFO || messageKind == IMessage.WEAVEINFO) {
61+
if (logger.isInfoEnabled()) {
62+
logger.info(makeMessageFor(message));
6463
return true;
6564
}
6665
}
6766
else if (messageKind == IMessage.WARNING) {
68-
if (LOGGER.isWarnEnabled()) {
69-
LOGGER.warn(makeMessageFor(message));
67+
if (logger.isWarnEnabled()) {
68+
logger.warn(makeMessageFor(message));
7069
return true;
7170
}
7271
}
7372
else if (messageKind == IMessage.ERROR) {
74-
if (LOGGER.isErrorEnabled()) {
75-
LOGGER.error(makeMessageFor(message));
73+
if (logger.isErrorEnabled()) {
74+
logger.error(makeMessageFor(message));
7675
return true;
7776
}
7877
}
7978
else if (messageKind == IMessage.ABORT) {
80-
if (LOGGER.isFatalEnabled()) {
81-
LOGGER.fatal(makeMessageFor(message));
79+
if (logger.isFatalEnabled()) {
80+
logger.fatal(makeMessageFor(message));
8281
return true;
8382
}
8483
}
85-
8684
return false;
8785
}
8886

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory) {
171171
setParentBeanFactory(parentBeanFactory);
172172
}
173173

174+
174175
/**
175176
* Set the instantiation strategy to use for creating bean instances.
176177
* Default is CglibSubclassingInstantiationStrategy.
@@ -261,7 +262,6 @@ public void ignoreDependencyInterface(Class<?> ifc) {
261262
this.ignoredDependencyInterfaces.add(ifc);
262263
}
263264

264-
265265
@Override
266266
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
267267
super.copyConfigurationFrom(otherFactory);
@@ -352,10 +352,8 @@ public Object autowire(Class<?> beanClass, int autowireMode, boolean dependencyC
352352
else {
353353
Object bean;
354354
final BeanFactory parent = this;
355-
356355
if (System.getSecurityManager() != null) {
357356
bean = AccessController.doPrivileged(new PrivilegedAction<Object>() {
358-
359357
@Override
360358
public Object run() {
361359
return getInstantiationStrategy().instantiate(bd, null, parent);
@@ -365,7 +363,6 @@ public Object run() {
365363
else {
366364
bean = getInstantiationStrategy().instantiate(bd, null, parent);
367365
}
368-
369366
populateBean(beanClass.getName(), bd, new BeanWrapperImpl(bean));
370367
return bean;
371368
}

0 commit comments

Comments
 (0)