@@ -60,7 +60,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
60
60
private static final String AJC_MAGIC = "ajc$" ;
61
61
62
62
private static final Class <?>[] ASPECTJ_ANNOTATION_CLASSES = new Class <?>[] {
63
- Pointcut .class , Before .class , Around .class , After .class , AfterReturning .class , AfterThrowing .class };
63
+ Pointcut .class , Around .class , Before .class , After .class , AfterReturning .class , AfterThrowing .class };
64
64
65
65
66
66
/** Logger available to subclasses */
@@ -150,16 +150,12 @@ private static <A extends Annotation> AspectJAnnotation<A> findAnnotation(Method
150
150
151
151
152
152
/**
153
- * AspectJ annotation types.
153
+ * Enum for AspectJ annotation types.
154
+ * @see AspectJAnnotation#getAnnotationType()
154
155
*/
155
156
protected enum AspectJAnnotationType {
156
157
157
- AtPointcut ,
158
- AtBefore ,
159
- AtAfter ,
160
- AtAfterReturning ,
161
- AtAfterThrowing ,
162
- AtAround
158
+ AtPointcut , AtAround , AtBefore , AtAfter , AtAfterReturning , AtAfterThrowing
163
159
}
164
160
165
161
@@ -176,11 +172,11 @@ protected static class AspectJAnnotation<A extends Annotation> {
176
172
177
173
static {
178
174
annotationTypeMap .put (Pointcut .class , AspectJAnnotationType .AtPointcut );
175
+ annotationTypeMap .put (Around .class , AspectJAnnotationType .AtAround );
179
176
annotationTypeMap .put (Before .class , AspectJAnnotationType .AtBefore );
180
177
annotationTypeMap .put (After .class , AspectJAnnotationType .AtAfter );
181
178
annotationTypeMap .put (AfterReturning .class , AspectJAnnotationType .AtAfterReturning );
182
179
annotationTypeMap .put (AfterThrowing .class , AspectJAnnotationType .AtAfterThrowing );
183
- annotationTypeMap .put (Around .class , AspectJAnnotationType .AtAround );
184
180
}
185
181
186
182
private final A annotation ;
@@ -194,8 +190,6 @@ protected static class AspectJAnnotation<A extends Annotation> {
194
190
public AspectJAnnotation (A annotation ) {
195
191
this .annotation = annotation ;
196
192
this .annotationType = determineAnnotationType (annotation );
197
- // We know these methods exist with the same name on each object,
198
- // but need to invoke them reflectively as there isn't a common interface.
199
193
try {
200
194
this .pointcutExpression = resolveExpression (annotation );
201
195
this .argumentNames = (String ) AnnotationUtils .getValue (annotation , "argNames" );
@@ -261,11 +255,11 @@ public String[] getParameterNames(Method method) {
261
255
if (annotation == null ) {
262
256
return null ;
263
257
}
264
- StringTokenizer strTok = new StringTokenizer (annotation .getArgumentNames (), "," );
265
- if (strTok .countTokens () > 0 ) {
266
- String [] names = new String [strTok .countTokens ()];
258
+ StringTokenizer nameTokens = new StringTokenizer (annotation .getArgumentNames (), "," );
259
+ if (nameTokens .countTokens () > 0 ) {
260
+ String [] names = new String [nameTokens .countTokens ()];
267
261
for (int i = 0 ; i < names .length ; i ++) {
268
- names [i ] = strTok .nextToken ();
262
+ names [i ] = nameTokens .nextToken ();
269
263
}
270
264
return names ;
271
265
}
0 commit comments