]> source.dussan.org Git - aspectj.git/commitdiff
312839: WeaverStateInfo compression and move to signatures in 'aspectsAffectingType...
authoraclement <aclement>
Tue, 18 May 2010 21:59:03 +0000 (21:59 +0000)
committeraclement <aclement>
Tue, 18 May 2010 21:59:03 +0000 (21:59 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 547f0ad7d5def6f5e07854ad3774b422031ea00f..74e6d1c25307cd3871631fa365ca9e4c0a2777cf 100644 (file)
@@ -434,7 +434,7 @@ class BcelClassWeaver implements IClassWeaver {
                        if (typeMungerAffectedType) {
                                isChanged = true;
                                if (inReweavableMode || clazz.getType().isAspect()) {
-                                       aspectsAffectingType.add(munger.getAspectType().getName());
+                                       aspectsAffectingType.add(munger.getAspectType().getSignature());
                                }
                        }
                }
@@ -510,7 +510,7 @@ class BcelClassWeaver implements IClassWeaver {
                                        if (typeMungerAffectedType) {
                                                isChanged = true;
                                                if (inReweavableMode || clazz.getType().isAspect()) {
-                                                       aspectsAffectingType.add(munger.getAspectType().getName());
+                                                       aspectsAffectingType.add(munger.getAspectType().getSignature());
                                                }
                                        }
                                }
@@ -1512,7 +1512,7 @@ class BcelClassWeaver implements IClassWeaver {
                                if (munger instanceof BcelAdvice) {
                                        BcelAdvice bcelAdvice = (BcelAdvice) munger;
                                        if (bcelAdvice.getConcreteAspect() != null) {
-                                               aspectsAffectingType.add(bcelAdvice.getConcreteAspect().getName());
+                                               aspectsAffectingType.add(bcelAdvice.getConcreteAspect().getSignature());
                                        }
                                } else {
                                        // It is a 'Checker' - we don't need to remember aspects
index b4448162125b6d991e019d16db06f92e6bf7ecf5..a0edd7e22577602c884920b6b739c197b99e8b08 100644 (file)
@@ -1319,42 +1319,40 @@ public class BcelWeaver {
                        // are around!
                        world.showMessage(IMessage.INFO, WeaverMessages.format(WeaverMessages.PROCESSING_REWEAVABLE, className, classType
                                        .getSourceLocation().getSourceFile()), null, null);
-                       Set aspectsPreviouslyInWorld = wsi.getAspectsAffectingType();
-                       if (aspectsPreviouslyInWorld != null) {
-                               // keep track of them just to ensure unique missing aspect error
-                               // reporting
-                               Set<String> alreadyConfirmedReweavableState = new HashSet<String>();
-                               for (Iterator iter = aspectsPreviouslyInWorld.iterator(); iter.hasNext();) {
-                                       String requiredTypeName = (String) iter.next();
-                                       if (!alreadyConfirmedReweavableState.contains(requiredTypeName)) {
-                                               ResolvedType rtx = world.resolve(UnresolvedType.forName(requiredTypeName), true);
-                                               boolean exists = !rtx.isMissing();
-                                               if (!exists) {
-                                                       world.getLint().missingAspectForReweaving.signal(new String[] { requiredTypeName, className },
-                                                                       classType.getSourceLocation(), null);
-                                                       // world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.MISSING_REWEAVABLE_TYPE,
-                                                       // requiredTypeName, className), classType.getSourceLocation(), null);
+                       Set<String> aspectsPreviouslyInWorld = wsi.getAspectsAffectingType();
+                       // keep track of them just to ensure unique missing aspect error
+                       // reporting
+                       Set<String> alreadyConfirmedReweavableState = new HashSet<String>();
+                       for (String requiredTypeSignature : aspectsPreviouslyInWorld) {
+                               // for (Iterator iter = aspectsPreviouslyInWorld.iterator(); iter.hasNext();) {
+                               // String requiredTypeName = (String) iter.next();
+                               if (!alreadyConfirmedReweavableState.contains(requiredTypeSignature)) {
+                                       ResolvedType rtx = world.resolve(UnresolvedType.forSignature(requiredTypeSignature), true);
+                                       boolean exists = !rtx.isMissing();
+                                       if (!exists) {
+                                               world.getLint().missingAspectForReweaving.signal(new String[] { rtx.getName(), className }, classType
+                                                               .getSourceLocation(), null);
+                                               // world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.MISSING_REWEAVABLE_TYPE,
+                                               // requiredTypeName, className), classType.getSourceLocation(), null);
+                                       } else {
+                                               if (world.isOverWeaving()) {
+                                                       // System.out.println(">> Removing " + requiredTypeName + " from weaving process: "
+                                                       // + xcutSet.deleteAspect(rtx));
                                                } else {
-                                                       if (world.isOverWeaving()) {
-                                                               // System.out.println(">> Removing " + requiredTypeName + " from weaving process: "
-                                                               // + xcutSet.deleteAspect(rtx));
-                                                       } else {
-                                                               // weaved in aspect that are not declared in aop.xml
-                                                               // trigger an error for now
-                                                               // may cause headhache for LTW and packaged lib
-                                                               // without aop.xml in
-                                                               // see #104218
-                                                               if (!xcutSet.containsAspect(rtx)) {
-                                                                       world.showMessage(IMessage.ERROR, WeaverMessages.format(
-                                                                                       WeaverMessages.REWEAVABLE_ASPECT_NOT_REGISTERED, requiredTypeName, className), null,
-                                                                                       null);
-                                                               } else if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
-                                                                       world.showMessage(IMessage.INFO, WeaverMessages.format(WeaverMessages.VERIFIED_REWEAVABLE_TYPE,
-                                                                                       requiredTypeName, rtx.getSourceLocation().getSourceFile()), null, null);
-                                                               }
+                                                       // weaved in aspect that are not declared in aop.xml
+                                                       // trigger an error for now
+                                                       // may cause headhache for LTW and packaged lib
+                                                       // without aop.xml in
+                                                       // see #104218
+                                                       if (!xcutSet.containsAspect(rtx)) {
+                                                               world.showMessage(IMessage.ERROR, WeaverMessages.format(
+                                                                               WeaverMessages.REWEAVABLE_ASPECT_NOT_REGISTERED, rtx.getName(), className), null, null);
+                                                       } else if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
+                                                               world.showMessage(IMessage.INFO, WeaverMessages.format(WeaverMessages.VERIFIED_REWEAVABLE_TYPE, rtx
+                                                                               .getName(), rtx.getSourceLocation().getSourceFile()), null, null);
                                                        }
-                                                       alreadyConfirmedReweavableState.add(requiredTypeName);
                                                }
+                                               alreadyConfirmedReweavableState.add(requiredTypeSignature);
                                        }
                                }
                        }