From: aclement Date: Wed, 3 Mar 2010 19:07:07 +0000 (+0000) Subject: 303924: fix X-Git-Tag: V1_6_9M1~48 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d4f375e4f6484bd70776d12edf5cf32a2398851f;p=aspectj.git 303924: fix --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index c030e779e..b4e36cf4d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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 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());