@@ -434,9 +434,15 @@ private ShadowMatch getTargetShadowMatch(Method method, @Nullable Class<?> targe
434
434
// Note: AspectJ is only going to take Method.getDeclaringClass() into account.
435
435
Set <Class <?>> ifcs = ClassUtils .getAllInterfacesForClassAsSet (targetClass );
436
436
if (ifcs .size () > 1 ) {
437
- Class <?> compositeInterface = ClassUtils .createCompositeInterface (
438
- ClassUtils .toClassArray (ifcs ), targetClass .getClassLoader ());
439
- targetMethod = ClassUtils .getMostSpecificMethod (targetMethod , compositeInterface );
437
+ try {
438
+ Class <?> compositeInterface = ClassUtils .createCompositeInterface (
439
+ ClassUtils .toClassArray (ifcs ), targetClass .getClassLoader ());
440
+ targetMethod = ClassUtils .getMostSpecificMethod (targetMethod , compositeInterface );
441
+ }
442
+ catch (IllegalArgumentException ex ) {
443
+ // Implemented interfaces probably expose conflicting method signatures...
444
+ // Proceed with original target method.
445
+ }
440
446
}
441
447
}
442
448
return getShadowMatch (targetMethod , method );
@@ -561,6 +567,19 @@ public String toString() {
561
567
return sb .toString ();
562
568
}
563
569
570
+ //---------------------------------------------------------------------
571
+ // Serialization support
572
+ //---------------------------------------------------------------------
573
+
574
+ private void readObject (ObjectInputStream ois ) throws IOException , ClassNotFoundException {
575
+ // Rely on default serialization, just initialize state after deserialization.
576
+ ois .defaultReadObject ();
577
+
578
+ // Initialize transient fields.
579
+ // pointcutExpression will be initialized lazily by checkReadyToMatch()
580
+ this .shadowMatchCache = new ConcurrentHashMap <>(32 );
581
+ }
582
+
564
583
565
584
/**
566
585
* Handler for the Spring-specific {@code bean()} pointcut designator
@@ -657,20 +676,6 @@ private boolean matchesBean(String advisedBeanName) {
657
676
}
658
677
659
678
660
- //---------------------------------------------------------------------
661
- // Serialization support
662
- //---------------------------------------------------------------------
663
-
664
- private void readObject (ObjectInputStream ois ) throws IOException , ClassNotFoundException {
665
- // Rely on default serialization, just initialize state after deserialization.
666
- ois .defaultReadObject ();
667
-
668
- // Initialize transient fields.
669
- // pointcutExpression will be initialized lazily by checkReadyToMatch()
670
- this .shadowMatchCache = new ConcurrentHashMap <>(32 );
671
- }
672
-
673
-
674
679
private static class DefensiveShadowMatch implements ShadowMatch {
675
680
676
681
private final ShadowMatch primary ;
0 commit comments