@ -1,5 +1,5 @@
/ *
/ *
* Copyright 2002 - 2017 the original author or authors .
* Copyright 2002 - 2018 the original author or authors .
*
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
* you may not use this file except in compliance with the License .
@ -19,7 +19,7 @@ package org.springframework.aop.support.annotation;
import java.lang.annotation.Annotation ;
import java.lang.annotation.Annotation ;
import org.springframework.aop.ClassFilter ;
import org.springframework.aop.ClassFilter ;
import org.springframework.core.annotation.Annotation Utils ;
import org.springframework.core.annotation.AnnotatedElement Utils ;
import org.springframework.util.Assert ;
import org.springframework.util.Assert ;
/ * *
/ * *
@ -50,7 +50,7 @@ public class AnnotationClassFilter implements ClassFilter {
* @param annotationType the annotation type to look for
* @param annotationType the annotation type to look for
* @param checkInherited whether to also check the superclasses and
* @param checkInherited whether to also check the superclasses and
* interfaces as well as meta - annotations for the annotation type
* interfaces as well as meta - annotations for the annotation type
* ( i . e . whether to use { @link AnnotationUtils # findAnnotation ( Class , Class ) }
* ( i . e . whether to use { @link AnnotatedElementUtils # hasAnnotation }
* semantics instead of standard Java { @link Class # isAnnotationPresent } )
* semantics instead of standard Java { @link Class # isAnnotationPresent } )
* /
* /
public AnnotationClassFilter ( Class < ? extends Annotation > annotationType , boolean checkInherited ) {
public AnnotationClassFilter ( Class < ? extends Annotation > annotationType , boolean checkInherited ) {
@ -62,8 +62,7 @@ public class AnnotationClassFilter implements ClassFilter {
@Override
@Override
public boolean matches ( Class < ? > clazz ) {
public boolean matches ( Class < ? > clazz ) {
return ( this . checkInherited ?
return ( this . checkInherited ? AnnotatedElementUtils . hasAnnotation ( clazz , this . annotationType ) :
( AnnotationUtils . findAnnotation ( clazz , this . annotationType ) ! = null ) :
clazz . isAnnotationPresent ( this . annotationType ) ) ;
clazz . isAnnotationPresent ( this . annotationType ) ) ;
}
}