]> source.dussan.org Git - aspectj.git/commitdiff
303924: fix
authoraclement <aclement>
Wed, 3 Mar 2010 19:07:07 +0000 (19:07 +0000)
committeraclement <aclement>
Wed, 3 Mar 2010 19:07:07 +0000 (19:07 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index c030e779edd7cf9e662412207ad3345b05a2ecf0..b4e36cf4de0ab539144815ae536a130d3e14ebdc 100644 (file)
@@ -83,6 +83,7 @@ import org.aspectj.weaver.patterns.BindingTypePattern;
 import org.aspectj.weaver.patterns.ConcreteCflowPointcut;
 import org.aspectj.weaver.patterns.DeclareAnnotation;
 import org.aspectj.weaver.patterns.DeclareParents;
+import org.aspectj.weaver.patterns.DeclareTypeErrorOrWarning;
 import org.aspectj.weaver.patterns.FastMatchInfo;
 import org.aspectj.weaver.patterns.IfPointcut;
 import org.aspectj.weaver.patterns.KindedPointcut;
@@ -1516,11 +1517,9 @@ public class BcelWeaver {
                        // ().getFileName(), wsi.getUnwovenClassFileData()));
                        // new: reweavable default with clever diff
                        if (!world.isOverWeaving()) {
-
                                byte[] bytes = wsi.getUnwovenClassFileData(classType.getJavaClass().getBytes());
                                classType.setJavaClass(Utility.makeJavaClass(classType.getJavaClass().getFileName(), bytes), true);
-                               // } else {
-                               // System.out.println("overweaving " + className);
+                               classType.getResolvedTypeX().ensureConsistent();
                        }
                        // } else {
                        // classType.resetState();
@@ -1832,6 +1831,8 @@ public class BcelWeaver {
                                                                inReweavableMode);
                                        }
 
+                               //      checkDeclareTypeErrorOrWarning(world, classType);
+
                                        if (mightNeedBridgeMethods) {
                                                isChanged = BcelClassWeaver.calculateAnyRequiredBridgeMethods(world, clazz) || isChanged;
                                        }
@@ -1863,6 +1864,8 @@ public class BcelWeaver {
                                        String messageText = "trouble in: \n" + classDebugInfo;
                                        getWorld().getMessageHandler().handleMessage(new Message(messageText, IMessage.ABORT, re, null));
                                }
+//                     } else {
+//                             checkDeclareTypeErrorOrWarning(world, classType);
                        }
                        // this is very odd return behavior trying to keep everyone happy
                        /*
@@ -1900,6 +1903,22 @@ public class BcelWeaver {
 
        // ---- writing
 
+/*     private void checkDeclareTypeErrorOrWarning(BcelWorld world2, BcelObjectType classType) {
+               List<DeclareTypeErrorOrWarning> dteows = world.getDeclareTypeEows();
+               for (DeclareTypeErrorOrWarning dteow : dteows) {
+                       if (dteow.getTypePattern().matchesStatically(classType.getResolvedTypeX())) {
+                               if (dteow.isError()) {
+                                       world.getMessageHandler().handleMessage(
+                                                       MessageUtil.error(dteow.getMessage(), classType.getResolvedTypeX().getSourceLocation()));
+                               } else {
+                                       world.getMessageHandler().handleMessage(
+                                                       MessageUtil.warn(dteow.getMessage(), classType.getResolvedTypeX().getSourceLocation()));
+                               }
+                       }
+               }
+       }
+*/
+
        private void dumpUnchanged(UnwovenClassFile classFile) throws IOException {
                if (zipOutputStream != null) {
                        writeZipEntry(getEntryName(classFile.getJavaClass().getClassName()), classFile.getBytes());