@@ -261,6 +261,10 @@ public boolean matches(Class<?> targetClass) {
261
261
catch (BCException ex ) {
262
262
logger .debug ("PointcutExpression matching rejected target class" , ex );
263
263
}
264
+ catch (IllegalStateException ex ) {
265
+ // AspectJ 1.8.10: encountered invalid signature
266
+ logger .debug ("PointcutExpression matching rejected target class" , ex );
267
+ }
264
268
return false ;
265
269
}
266
270
@@ -413,39 +417,46 @@ private ShadowMatch getShadowMatch(Method targetMethod, Method originalMethod) {
413
417
shadowMatch = this .shadowMatchCache .get (targetMethod );
414
418
if (shadowMatch == null ) {
415
419
try {
416
- shadowMatch = this .pointcutExpression .matchesMethodExecution (methodToMatch );
417
- }
418
- catch (ReflectionWorldException ex ) {
419
- // Failed to introspect target method, probably because it has been loaded
420
- // in a special ClassLoader. Let's try the declaring ClassLoader instead...
421
- try {
422
- fallbackExpression = getFallbackPointcutExpression (methodToMatch .getDeclaringClass ());
423
- if (fallbackExpression != null ) {
424
- shadowMatch = fallbackExpression .matchesMethodExecution (methodToMatch );
425
- }
426
- }
427
- catch (ReflectionWorldException ex2 ) {
428
- fallbackExpression = null ;
429
- }
430
- }
431
- if (shadowMatch == null && targetMethod != originalMethod ) {
432
- methodToMatch = originalMethod ;
433
420
try {
434
421
shadowMatch = this .pointcutExpression .matchesMethodExecution (methodToMatch );
435
422
}
436
- catch (ReflectionWorldException ex3 ) {
437
- // Could neither introspect the target class nor the proxy class ->
438
- // let's try the original method 's declaring class before we give up ...
423
+ catch (ReflectionWorldException ex ) {
424
+ // Failed to introspect target method, probably because it has been loaded
425
+ // in a special ClassLoader. Let 's try the declaring ClassLoader instead ...
439
426
try {
440
427
fallbackExpression = getFallbackPointcutExpression (methodToMatch .getDeclaringClass ());
441
428
if (fallbackExpression != null ) {
442
429
shadowMatch = fallbackExpression .matchesMethodExecution (methodToMatch );
443
430
}
444
431
}
445
- catch (ReflectionWorldException ex4 ) {
432
+ catch (ReflectionWorldException ex2 ) {
446
433
fallbackExpression = null ;
447
434
}
448
435
}
436
+ if (shadowMatch == null && targetMethod != originalMethod ) {
437
+ methodToMatch = originalMethod ;
438
+ try {
439
+ shadowMatch = this .pointcutExpression .matchesMethodExecution (methodToMatch );
440
+ }
441
+ catch (ReflectionWorldException ex3 ) {
442
+ // Could neither introspect the target class nor the proxy class ->
443
+ // let's try the original method's declaring class before we give up...
444
+ try {
445
+ fallbackExpression = getFallbackPointcutExpression (methodToMatch .getDeclaringClass ());
446
+ if (fallbackExpression != null ) {
447
+ shadowMatch = fallbackExpression .matchesMethodExecution (methodToMatch );
448
+ }
449
+ }
450
+ catch (ReflectionWorldException ex4 ) {
451
+ fallbackExpression = null ;
452
+ }
453
+ }
454
+ }
455
+ }
456
+ catch (IllegalStateException ex ) {
457
+ // AspectJ 1.8.10: encountered invalid signature
458
+ logger .debug ("PointcutExpression matching rejected target method" , ex );
459
+ fallbackExpression = null ;
449
460
}
450
461
if (shadowMatch == null ) {
451
462
shadowMatch = new ShadowMatchImpl (org .aspectj .util .FuzzyBoolean .NO , null , null , null );
0 commit comments