Package org.aspectj.apache.bcel.generic

Examples of org.aspectj.apache.bcel.generic.LocalVariableTag


  static LocalVariableTag getLocalVariableTag(InstructionHandle ih, int index) {
    Iterator tIter = ih.getTargeters().iterator();
    while (tIter.hasNext()) {
      InstructionTargeter t = (InstructionTargeter) tIter.next();
      if (t instanceof LocalVariableTag) {
        LocalVariableTag lvt = (LocalVariableTag) t;
        if (lvt.getSlot() == index) {
          return lvt;
        }
      }
    }
    return null;
View Full Code Here


            if (line != currLine) {
              gen.addLineNumber(newInstructionHandle, line + lineNumberOffset);
              currLine = line;
            }
          } else if (targeter instanceof LocalVariableTag) {
            LocalVariableTag lvt = (LocalVariableTag) targeter;
            LVPosition p = localVariables.get(lvt);
            // If we don't know about it, create a new position and
            // store
            // If we do know about it - update its end position
            if (p == null) {
View Full Code Here

            if (line != currLine) {
              gen.addLineNumber(iHandle, line + lineNumberOffset);
              currLine = line;
            }
          } else if (targeter instanceof LocalVariableTag) {
            LocalVariableTag lvt = (LocalVariableTag) targeter;
            LVPosition p = localVariables.get(lvt);
            // If we don't know about it, create a new position
            // and store
            // If we do know about it - update its end position
            if (p == null) {
View Full Code Here

      } else if (inst.isLocalVariableInstruction()) {
        // LocalVariableInstruction lvinst = (LocalVariableInstruction)
        // inst;
        out.print(inst.toString(false).toUpperCase());
        int index = inst.getIndex();
        LocalVariableTag tag = getLocalVariableTag(h, index);
        if (tag != null) {
          out.print("     // ");
          out.print(tag.getType());
          out.print(" ");
          out.print(tag.getName());
        }
      } else {
        out.print(inst.toString(false).toUpperCase());
      }
    }
View Full Code Here

          Tag fresh = tagMap.get(oldTag);
          if (fresh == null) {
            fresh = oldTag.copy();
            if (old instanceof LocalVariableTag) {
              // LocalVariable
              LocalVariableTag lvTag = (LocalVariableTag) old;
              LocalVariableTag lvTagFresh = (LocalVariableTag) fresh;
              if (lvTag.getSlot() == 0) {
                fresh = new LocalVariableTag(lvTag.getRealType().getSignature(), "ajc$aspectInstance",
                    frameEnv.get(lvTag.getSlot()), 0);
              } else {
                // // Do not move it - when copying the code from the aspect to the affected target, 'this' is
                // // going to change from aspect to affected type. So just fix the type
                // System.out.println("For local variable tag at instruction " + src + " changing slot from "
                // + lvTag.getSlot() + " > " + frameEnv.get(lvTag.getSlot()));
                lvTagFresh.updateSlot(frameEnv.get(lvTag.getSlot()));
              }
            }
            tagMap.put(oldTag, fresh);
          }
          dest.addTargeter(fresh);
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.generic.LocalVariableTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.