Package org.aspectj.apache.bcel.classfile

Examples of org.aspectj.apache.bcel.classfile.LocalVariable


   }
   
    int name_index      = cp.addUtf8(name);
    int signature_index = cp.addUtf8(type.getSignature());

    return new LocalVariable(start_pc, length, name_index,
           signature_index, index, cp.getConstantPool());
  }
View Full Code Here


        final int startAtStackIndex = method.isStatic() ? 0 : 1;
        final List arguments = new ArrayList();
        LocalVariableTable lt = (LocalVariableTable) method.getLocalVariableTable();
        if (lt != null) {
            for (int j = 0; j < lt.getLocalVariableTable().length; j++) {
                LocalVariable localVariable = lt.getLocalVariableTable()[j];
                if (localVariable.getStartPC() == 0) {
                    if (localVariable.getIndex() >= startAtStackIndex) {
                        arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex()));
                    }
                }
            }
        }
View Full Code Here

      LocalVariable[] lv = ((LocalVariableTable)a).getLocalVariableTable();

      removeLocalVariables();

      for(int k=0; k < lv.length; k++) {
        LocalVariable     l     = lv[k];
        InstructionHandle start = il.findHandle(l.getStartPC());
        InstructionHandle end   = il.findHandle(l.getStartPC() + l.getLength());
        // AMC, this actually gives us the first instruction AFTER the range,
        // so move back one... (findHandle can't cope with mid-instruction indices)
        if (end != null) end = end.getPrev();

        // Repair malformed handles
        if(null == start) {
    start = il.getStart();
        }

        if(null == end) {
    end = il.getEnd();
        }

        addLocalVariable(l.getName(), Type.getType(l.getSignature()),
             l.getIndex(), start, end);
      }
    } else
      addCodeAttribute(a);
  }
      } else if(a instanceof ExceptionTable) {
  String[] names = ((ExceptionTable)a).getExceptionNames();
  for(int j=0; j < names.length; j++)
    addException(names[j]);
      } else if (a instanceof RuntimeAnnotations) {
    RuntimeAnnotations runtimeAnnotations = (RuntimeAnnotations)a;
    List l = runtimeAnnotations.getAnnotations();
    for (Iterator it = l.iterator(); it.hasNext();) {
      Annotation element = (Annotation) it.next();
      addAnnotation(new AnnotationGen(element,cp,false));
    }
      } else {
        addAttribute(a);
View Full Code Here

    } else {
      UnresolvedType[] paramTypes = getParameterTypes();
      String[] paramNames = new String[len];
      int index = isStatic() ? 0 : 1;
      for (int i = 0; i < len; i++) {
        LocalVariable lv = varTable.getLocalVariable(index);
        if (lv == null) {
          paramNames[i] = "arg" + i;
        } else {
          paramNames[i] = lv.getName();
        }
        index += paramTypes[i].getSize();
      }
      this.parameterNames = paramNames;
    }
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.LocalVariable

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.