From 72219780ef1f7d0e8f7d45fa83bfad92a18dcbca Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 6 Apr 2014 03:20:51 -0500 Subject: [PATCH] AE Optional Transformer should not be fully operational. --- transformer/asm/ASMIntegration.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/transformer/asm/ASMIntegration.java b/transformer/asm/ASMIntegration.java index 2ab23d9e8..7c47818de 100644 --- a/transformer/asm/ASMIntegration.java +++ b/transformer/asm/ASMIntegration.java @@ -98,12 +98,16 @@ public class ASMIntegration implements IClassTransformer { if ( hasAnnotation( an, integration.Interface.class ) ) { - changed = changed || stripInterface( classNode, integration.Interface.class, an ); + if ( stripInterface( classNode, integration.Interface.class, an ) ) + changed = true; } else if ( hasAnnotation( an, integration.InterfaceList.class ) ) { for (Object o : ((List) an.values.get( 1 ))) - changed = changed || stripInterface( classNode, integration.InterfaceList.class, (AnnotationNode) o ); + { + if ( stripInterface( classNode, integration.InterfaceList.class, (AnnotationNode) o ) ) + changed = true; + } } } } @@ -119,13 +123,17 @@ public class ASMIntegration implements IClassTransformer { if ( hasAnnotation( an, integration.Method.class ) ) { - changed = changed || stripMethod( classNode, mn, i, integration.Method.class, an ); + if ( stripMethod( classNode, mn, i, integration.Method.class, an ) ) + changed = true; } } } } + if ( changed ) + log( "Updated " + classNode.name ); + return changed; } @@ -150,7 +158,10 @@ public class ASMIntegration implements IClassTransformer { log( "Removing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is disabled." ); i.remove(); + return true; } + else + log( "Allowing Method " + mn.name + " from " + classNode.name + " because " + iName + " integration is enabled." ); } else throw new RuntimeException( "Unable to handle Method annotation on " + classNode.name ); @@ -181,8 +192,11 @@ public class ASMIntegration implements IClassTransformer if ( !IntegrationRegistry.instance.isEnabled( iName ) ) { log( "Removing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is disabled." ); - classNode.interfaces.remove( iFace ); + classNode.interfaces.remove( iFace.replace( '.', '/' ) ); + return true; } + else + log( "Allowing Interface " + iFace + " from " + classNode.name + " because " + iName + " integration is enabled." ); } else throw new RuntimeException( "Unable to handle Method annotation on " + classNode.name );