From c2b5871a6d0f6c7620421482a8438bcafc9f9ee8 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 7 Apr 2004 12:58:47 +0000 Subject: [PATCH] Some of the fix for Bugzilla Bug 57432 NPE when creating declare messages [Allow for null targeters - for example when the class file has no debug info in it] --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index fc5c0c1a8..ca41e2aec 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -438,13 +438,15 @@ public class BcelShadow extends Shadow { int slot = ((StoreInstruction)startOfHandler.getInstruction()).getIndex(); //System.out.println("got store: " + startOfHandler.getInstruction() + ", " + index); InstructionTargeter[] targeters = startOfHandler.getNext().getTargeters(); - for (int i=targeters.length-1; i >= 0; i--) { - if (targeters[i] instanceof LocalVariableTag) { - LocalVariableTag t = (LocalVariableTag)targeters[i]; - if (t.getSlot() == slot) { - return t.getName(); + if (targeters!=null) { + for (int i=targeters.length-1; i >= 0; i--) { + if (targeters[i] instanceof LocalVariableTag) { + LocalVariableTag t = (LocalVariableTag)targeters[i]; + if (t.getSlot() == slot) { + return t.getName(); + } + //System.out.println("tag: " + targeters[i]); } - //System.out.println("tag: " + targeters[i]); } } } -- 2.39.5