diff options
author | aclement <aclement> | 2011-06-17 22:39:50 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-06-17 22:39:50 +0000 |
commit | 9bfb220fc9dd84207340aba97e5c365b12918250 (patch) | |
tree | 1017ab0d2f2dcfc531458c9bc7596332a1bf3b26 | |
parent | f7b11932d5e3bdbb2de85fe21af8443ad9351530 (diff) | |
download | aspectj-9bfb220fc9dd84207340aba97e5c365b12918250.tar.gz aspectj-9bfb220fc9dd84207340aba97e5c365b12918250.zip |
refactoring
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 4c5bceff0..42daa4ca6 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -537,9 +537,9 @@ public class BcelShadow extends Shadow { if (startOfHandler.getInstruction().isStoreInstruction() && startOfHandler.getNext() != null) { int slot = startOfHandler.getInstruction().getIndex(); // System.out.println("got store: " + startOfHandler.getInstruction() + ", " + index); - Iterator tIter = startOfHandler.getNext().getTargeters().iterator(); + Iterator<InstructionTargeter> tIter = startOfHandler.getNext().getTargeters().iterator(); while (tIter.hasNext()) { - InstructionTargeter targeter = (InstructionTargeter) tIter.next(); + InstructionTargeter targeter = tIter.next(); if (targeter instanceof LocalVariableTag) { LocalVariableTag t = (LocalVariableTag) targeter; if (t.getSlot() == slot) { @@ -856,12 +856,12 @@ public class BcelShadow extends Shadow { private BcelVar thisVar = null; private BcelVar targetVar = null; private BcelVar[] argVars = null; - private Map/* <UnresolvedType,BcelVar> */<ResolvedType, AnnotationAccessVar> kindedAnnotationVars = null; - private Map/* <UnresolvedType,BcelVar> */<ResolvedType, TypeAnnotationAccessVar> thisAnnotationVars = null; - private Map/* <UnresolvedType,BcelVar> */<ResolvedType, TypeAnnotationAccessVar> targetAnnotationVars = null; - private Map/* <UnresolvedType,BcelVar> */[] argAnnotationVars = null; - private Map/* <UnresolvedType,BcelVar> */<ResolvedType, AnnotationAccessVar> withinAnnotationVars = null; - private Map/* <UnresolvedType,BcelVar> */<ResolvedType, AnnotationAccessVar> withincodeAnnotationVars = null; + private Map<ResolvedType, AnnotationAccessVar> kindedAnnotationVars = null; + private Map<ResolvedType, TypeAnnotationAccessVar> thisAnnotationVars = null; + private Map<ResolvedType, TypeAnnotationAccessVar> targetAnnotationVars = null; + // private Map/* <UnresolvedType,BcelVar> */[] argAnnotationVars = null; + private Map<ResolvedType, AnnotationAccessVar> withinAnnotationVars = null; + private Map<ResolvedType, AnnotationAccessVar> withincodeAnnotationVars = null; private boolean allArgVarsInitialized = false; @Override @@ -918,13 +918,14 @@ public class BcelShadow extends Shadow { @Override public Var getArgAnnotationVar(int i, UnresolvedType forAnnotationType) { - initializeArgAnnotationVars(); - - Var v = (Var) argAnnotationVars[i].get(forAnnotationType); - if (v == null) { - v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getArgVar(i)); - } - return v; + return new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getArgVar(i)); + // initializeArgAnnotationVars(); + // + // Var v = (Var) argAnnotationVars[i].get(forAnnotationType); + // if (v == null) { + // v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getArgVar(i)); + // } + // return v; } @Override @@ -1435,18 +1436,18 @@ public class BcelShadow extends Shadow { } } - public void initializeArgAnnotationVars() { - if (argAnnotationVars != null) { - return; - } - int numArgs = getArgCount(); - argAnnotationVars = new Map[numArgs]; - for (int i = 0; i < argAnnotationVars.length; i++) { - argAnnotationVars[i] = new HashMap(); - // FIXME asc just delete this logic - we always build the Var on demand, as we don't know at weave time - // what the full set of annotations could be (due to static/dynamic type differences...) - } - } + // public void initializeArgAnnotationVars() { + // if (argAnnotationVars != null) { + // return; + // } + // int numArgs = getArgCount(); + // argAnnotationVars = new Map[numArgs]; + // for (int i = 0; i < argAnnotationVars.length; i++) { + // argAnnotationVars[i] = new HashMap(); + // // FIXME asc just delete this logic - we always build the Var on demand, as we don't know at weave time + // // what the full set of annotations could be (due to static/dynamic type differences...) + // } + // } protected ResolvedMember getRelevantMember(ResolvedMember foundMember, Member relevantMember, ResolvedType relevantType) { if (foundMember != null) { |