Skip to content

Commit a2aa82e

Browse files
committed
Polishing
1 parent 981d449 commit a2aa82e

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

spring-context/src/main/java/org/springframework/context/weaving/AspectJWeavingEnabler.java

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.context.weaving;
1818

19-
2019
import java.lang.instrument.ClassFileTransformer;
2120
import java.lang.instrument.IllegalClassFormatException;
2221
import java.security.ProtectionDomain;
@@ -44,12 +43,13 @@
4443
public class AspectJWeavingEnabler
4544
implements BeanFactoryPostProcessor, BeanClassLoaderAware, LoadTimeWeaverAware, Ordered {
4645

46+
public static final String ASPECTJ_AOP_XML_RESOURCE = "META-INF/aop.xml";
47+
48+
4749
private ClassLoader beanClassLoader;
4850

4951
private LoadTimeWeaver loadTimeWeaver;
5052

51-
public static final String ASPECTJ_AOP_XML_RESOURCE = "META-INF/aop.xml";
52-
5353

5454
@Override
5555
public void setBeanClassLoader(ClassLoader classLoader) {
@@ -71,6 +71,12 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
7171
enableAspectJWeaving(this.loadTimeWeaver, this.beanClassLoader);
7272
}
7373

74+
75+
/**
76+
* Enable AspectJ weaving with the given {@link LoadTimeWeaver}.
77+
* @param weaverToUse the LoadTimeWeaver to apply to (or {@code null} for a default weaver)
78+
* @param beanClassLoader the class loader to create a default weaver for (if necessary)
79+
*/
7480
public static void enableAspectJWeaving(LoadTimeWeaver weaverToUse, ClassLoader beanClassLoader) {
7581
if (weaverToUse == null) {
7682
if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
@@ -80,8 +86,8 @@ public static void enableAspectJWeaving(LoadTimeWeaver weaverToUse, ClassLoader
8086
throw new IllegalStateException("No LoadTimeWeaver available");
8187
}
8288
}
83-
weaverToUse.addTransformer(new AspectJClassBypassingClassFileTransformer(
84-
new ClassPreProcessorAgentAdapter()));
89+
weaverToUse.addTransformer(
90+
new AspectJClassBypassingClassFileTransformer(new ClassPreProcessorAgentAdapter()));
8591
}
8692

8793

@@ -108,4 +114,5 @@ public byte[] transform(ClassLoader loader, String className, Class<?> classBein
108114
return this.delegate.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
109115
}
110116
}
117+
111118
}

spring-core/src/main/java/org/springframework/core/MethodParameter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ public Type getGenericParameterType() {
394394
/**
395395
* Return the nested type of the method/constructor parameter.
396396
* @return the parameter type (never {@code null})
397-
* @see #getNestingLevel()
398397
* @since 3.1
398+
* @see #getNestingLevel()
399399
*/
400400
public Class<?> getNestedParameterType() {
401401
if (this.nestingLevel > 1) {

0 commit comments

Comments
 (0)