Package org.aspectj.apache.bcel.classfile

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


    for (int i = 0; i < size; i++) {
      lv[i] = lg[i].getLocalVariable(cp);
    }

    return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp);
  }
View Full Code Here


    if (il != null) {
      byte_code = il.getByteCode();
    }

    LineNumberTable lnt = null;
    LocalVariableTable lvt = null;
    // J5TODO: LocalVariableTypeTable support!

    /*
     * Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
     */
 
View Full Code Here

      InstructionHandle start = il.getStart();
      if (lineNumber > 0) {
        start.addTargeter(new LineNumberTag(lineNumber));
      }
      // Fix up the local variables: find any that have a startPC of 0 and ensure they target the new start of the method
      LocalVariableTable lvt = shadow.getEnclosingMethod().getMemberView().getMethod().getLocalVariableTable();
      if (lvt != null) {
        LocalVariable[] lvTable = lvt.getLocalVariableTable();
        for (int i = 0; i < lvTable.length; i++) {
          LocalVariable lv = lvTable[i];
          if (lv.getStartPC() == 0) {
            start.addTargeter(new LocalVariableTag(lv.getSignature(), lv.getName(), lv.getIndex(), 0));
          }
View Full Code Here

      return EMPTY_STRINGS;
    }

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

  public void determineParameterNames() {
    if ((bitflags & PARAMETER_NAMES_INITIALIZED) != 0) {
      return;
    }
    bitflags |= PARAMETER_NAMES_INITIALIZED;
    LocalVariableTable varTable = method.getLocalVariableTable();
    int len = getArity();
    if (varTable == null) {
      // do we have an annotation with the argNames value specified...
      AnnotationAJ[] annos = getAnnotations();
      if (annos != null && annos.length != 0) {
        AnnotationAJ[] axs = getAnnotations();
        for (int i = 0; i < axs.length; i++) {
          AnnotationAJ annotationX = axs[i];
          String typename = annotationX.getTypeName();
          if (typename.charAt(0) == 'o') {
            if (typename.equals("org.aspectj.lang.annotation.Pointcut")
                || typename.equals("org.aspectj.lang.annotation.Before")
                || typename.equals("org.aspectj.lang.annotation.Around")
                || typename.startsWith("org.aspectj.lang.annotation.After")) {
              AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
              if (a != null) {
                List<NameValuePair> values = a.getValues();
                for (NameValuePair nvPair : values) {
                  if (nvPair.getNameString().equals("argNames")) {
                    String argNames = nvPair.getValue().stringifyValue();
                    StringTokenizer argNameTokenizer = new StringTokenizer(argNames, " ,");
                    List<String> argsList = new ArrayList<String>();
                    while (argNameTokenizer.hasMoreTokens()) {
                      argsList.add(argNameTokenizer.nextToken());
                    }
                    int requiredCount = getParameterTypes().length;
                    while (argsList.size() < requiredCount) {
                      argsList.add("arg" + argsList.size());
                    }
                    setParameterNames(argsList.toArray(new String[] {}));
                    return;
                  }
                }
              }
            }
          }
        }
      }
      setParameterNames(Utility.makeArgNames(len));
    } else {
      UnresolvedType[] paramTypes = getParameterTypes();
      String[] paramNames = new String[len];
      int index = Modifier.isStatic(modifiers) ? 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();
        }
View Full Code Here

      InstructionHandle start = il.getStart();
      if (lineNumber > 0) {
        start.addTargeter(new LineNumberTag(lineNumber));
      }
      // Fix up the local variables: find any that have a startPC of 0 and ensure they target the new start of the method
      LocalVariableTable lvt = shadow.getEnclosingMethod().getMemberView().getMethod().getLocalVariableTable();
      if (lvt != null) {
        LocalVariable[] lvTable = lvt.getLocalVariableTable();
        for (int i = 0; i < lvTable.length; i++) {
          LocalVariable lv = lvTable[i];
          if (lv.getStartPC() == 0) {
            start.addTargeter(new LocalVariableTag(lv.getSignature(), lv.getName(), lv.getIndex(), 0));
          }
View Full Code Here

    for (int i = 0; i < size; i++) {
      lv[i] = lg[i].getLocalVariable(cp);
    }

    return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp);
  }
View Full Code Here

            + this.getName() + this.getSignature(), e);
      }
    }

    LineNumberTable lnt = null;
    LocalVariableTable lvt = null;
    // J5TODO: LocalVariableTypeTable support!

    /*
     * Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
     */
 
View Full Code Here

    if (!(forMember instanceof AccessibleObject))
      return null;

    try {
      JavaClass jc = bcelRepository.loadClass(forMember.getDeclaringClass());
      LocalVariableTable lvt = null;
      int numVars = 0;
      if (forMember instanceof Method) {
        org.aspectj.apache.bcel.classfile.Method bcelMethod = jc.getMethod((Method) forMember);
        lvt = bcelMethod.getLocalVariableTable();
        numVars = bcelMethod.getArgumentTypes().length;
View Full Code Here

      return EMPTY_STRINGS;
    }

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

TOP

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

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.