File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
main/java/org/springframework/aop/aspectj/annotation
test/java/org/springframework/aop/aspectj/annotation Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 22
22
import org .springframework .beans .factory .aot .BeanRegistrationAotProcessor ;
23
23
import org .springframework .beans .factory .aot .BeanRegistrationCode ;
24
24
import org .springframework .beans .factory .support .RegisteredBean ;
25
+ import org .springframework .util .ClassUtils ;
25
26
26
27
/**
27
28
* An AOT {@link BeanRegistrationAotProcessor} that detects the presence of
30
31
* @author Sebastien Deleuze
31
32
* @since 6.1
32
33
*/
33
- public class AspectJAdvisorBeanRegistrationAotProcessor implements BeanRegistrationAotProcessor {
34
+ class AspectJAdvisorBeanRegistrationAotProcessor implements BeanRegistrationAotProcessor {
35
+
36
+ private static final boolean aspectJPresent = ClassUtils .isPresent ("org.aspectj.lang.annotation.Pointcut" ,
37
+ AspectJAdvisorBeanRegistrationAotProcessor .class .getClassLoader ());
34
38
35
39
@ Override
36
40
public BeanRegistrationAotContribution processAheadOfTime (RegisteredBean registeredBean ) {
37
- Class <?> beanClass = registeredBean .getBeanClass ();
38
- if (AbstractAspectJAdvisorFactory .compiledByAjc (beanClass )) {
39
- return new AspectJAdvisorContribution (beanClass );
41
+ if (aspectJPresent ) {
42
+ Class <?> beanClass = registeredBean .getBeanClass ();
43
+ if (AbstractAspectJAdvisorFactory .compiledByAjc (beanClass )) {
44
+ return new AspectJAdvisorContribution (beanClass );
45
+ }
40
46
}
41
47
return null ;
42
48
}
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- package org .springframework .aop .aspectj ;
17
+ package org .springframework .aop .aspectj . annotation ;
18
18
19
19
import org .junit .jupiter .api .Test ;
20
20
21
- import org .springframework .aop .aspectj .annotation .AspectJAdvisorBeanRegistrationAotProcessor ;
22
21
import org .springframework .aot .generate .GenerationContext ;
23
22
import org .springframework .aot .hint .MemberCategory ;
24
23
import org .springframework .aot .hint .RuntimeHints ;
38
37
*
39
38
* @author Sebastien Deleuze
40
39
*/
41
- public class AspectJAdvisorBeanRegistrationAotProcessorTests {
40
+ class AspectJAdvisorBeanRegistrationAotProcessorTests {
42
41
43
42
private final GenerationContext generationContext = new TestGenerationContext ();
44
43
You can’t perform that action at this time.
0 commit comments