Skip to content

Commit cc379f1

Browse files
committed
Polishing
1 parent 666037e commit cc379f1

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,7 +70,9 @@ protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) {
7070

7171
@Override
7272
@Nullable
73-
protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) {
73+
protected Object[] getAdvicesAndAdvisorsForBean(
74+
Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) {
75+
7476
List<Advisor> advisors = findEligibleAdvisors(beanClass, beanName);
7577
if (advisors.isEmpty()) {
7678
return DO_NOT_PROXY;

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,11 @@ private Object createCglibProxyForFactoryBean(final Object factoryBean,
563563
}
564564
}
565565

566-
((Factory) fbProxy).setCallback(0, new MethodInterceptor() {
567-
@Override
568-
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
569-
if (method.getName().equals("getObject") && args.length == 0) {
570-
return beanFactory.getBean(beanName);
571-
}
572-
return proxy.invoke(factoryBean, args);
566+
((Factory) fbProxy).setCallback(0, (MethodInterceptor) (obj, method, args, proxy) -> {
567+
if (method.getName().equals("getObject") && args.length == 0) {
568+
return beanFactory.getBean(beanName);
573569
}
570+
return proxy.invoke(factoryBean, args);
574571
});
575572

576573
return fbProxy;

spring-core/src/main/java/org/springframework/core/task/support/ExecutorServiceAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,18 +24,18 @@
2424
import org.springframework.util.Assert;
2525

2626
/**
27-
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor})
27+
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor}
2828
* and exposes a full {@code java.util.concurrent.ExecutorService} for it.
2929
*
3030
* <p>This is primarily for adapting to client components that communicate via the
3131
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
3232
* common ground between a local Spring {@code TaskExecutor} backend and a
33-
* JNDI-located {@code ManagedExecutorService} in a Java EE 6 environment.
33+
* JNDI-located {@code ManagedExecutorService} in a Java EE 7 environment.
3434
*
3535
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
3636
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
3737
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
38-
* in a Java EE 6 environment. The lifecycle is always up to the backend pool,
38+
* in a Java EE 7 environment. The lifecycle is always up to the backend pool,
3939
* with this adapter acting as an access-only proxy for that target pool.
4040
*
4141
* @author Juergen Hoeller

0 commit comments

Comments
 (0)