Examples of LocalVariable


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

      // 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

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

    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()));
          }
        }
      }
      if (arguments.size() == 0) {
        // could be cobertura code where some extra bytecode has been stuffed in at the start of the method
        // but the local variable table hasn't been repaired - for example:
        // LocalVariable(start_pc = 6, length = 40, index = 0:com.example.ExampleAspect this)
        // LocalVariable(start_pc = 6, length = 40, index = 1:org.aspectj.lang.ProceedingJoinPoint pjp)
        // LocalVariable(start_pc = 6, length = 40, index = 2:int __cobertura__line__number__)
        // LocalVariable(start_pc = 6, length = 40, index = 3:int __cobertura__branch__number__)
        LocalVariable localVariable = lvt[0];
        if (localVariable.getStartPC() != 0) {
          // looks suspicious so let's use this information
          for (int j = 0; j < lvt.length && arguments.size() < method.getArgumentTypes().length; j++) {
            localVariable = lvt[j];
            if (localVariable.getIndex() >= startAtStackIndex) {
              arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex()));
            }
          }
        }
      }
    } else {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.LocalVariable

            maskedLimitTo,
            matchRule);
      }
      break;
    case IJavaElement.LOCAL_VARIABLE :
      LocalVariable localVar = (LocalVariable) element;
      boolean findVarDeclarations = false;
      boolean findVarReadAccess = false;
      boolean findVarWriteAccess = false;
      switch (maskedLimitTo) {
        case IJavaSearchConstants.DECLARATIONS :
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.LocalVariable

* Create an handle for a local variable declartion (may be a local variable or type parameter).
*/
protected IJavaElement createHandle(AbstractVariableDeclaration variableDeclaration, IJavaElement parent) {
  switch (variableDeclaration.getKind()) {
    case AbstractVariableDeclaration.LOCAL_VARIABLE:
      return new LocalVariable((JavaElement)parent,
        new String(variableDeclaration.name),
        variableDeclaration.declarationSourceStart,
        variableDeclaration.declarationSourceEnd,
        variableDeclaration.sourceStart,
        variableDeclaration.sourceEnd,
        new String(variableDeclaration.type.resolvedType.signature())
      );
    case AbstractVariableDeclaration.PARAMETER:
      return new LocalVariable((JavaElement)parent,
        new String(variableDeclaration.name),
        variableDeclaration.declarationSourceStart,
        variableDeclaration.declarationSourceEnd,
        variableDeclaration.sourceStart,
        variableDeclaration.sourceEnd,
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.LocalVariable

    QualifiedNameReference qNameRef = (QualifiedNameReference) reference;
    long sourcePosition = qNameRef.sourcePositions[0];
    offset = (int) (sourcePosition >>> 32);
    length = ((int) sourcePosition) - offset +1;
  } else if (reference instanceof LocalDeclaration) {
    LocalVariable localVariable = getLocalVariable();
    offset = localVariable.nameStart;
    length = localVariable.nameEnd-offset+1;
    element = localVariable;
  }
  if (offset >= 0) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.core.LocalVariable

      ASTNode node = localVar.getParent();
      sourceStart = node.getStartPosition();
      sourceLength = node.getLength();
    }
    char[] typeSig = this.binding.type.genericTypeSignature();
    return new LocalVariable(method, localVar.getName().getIdentifier(), sourceStart, sourceStart+sourceLength-1, nameStart, nameStart+nameLength-1, new String(typeSig));
  }
View Full Code Here

Examples of org.codehaus.janino.Java.LocalVariable

        return newVars;
    }
    protected void buildLocalVariableMap(CatchClause cc, Map localVars) throws CompileException {
        Map vars = new HashMap();
        vars.putAll(localVars);
        LocalVariable lv = this.getLocalVariable(cc.caughtException);
        vars.put(cc.caughtException.name, lv);
        this.buildLocalVariableMap(cc.body, vars);
    }
View Full Code Here

Examples of org.cojen.classfile.LocalVariable

            final Location endLocation = new FixedLocation(end_pc);

            final Set<LocationRange> ranges = Collections
                .singleton((LocationRange) new LocationRangeImpl(startLocation, endLocation));

            LocalVariable localVar = new LocalVariable() {
                private String mName;
                private TypeDesc mType;

                {
                    mName = varName == null ? null : varName.getValue();
View Full Code Here

Examples of org.cojen.classfile.LocalVariable

    }

    public LocalVariable getLocalVariable(int useLocation, int number) {
        // TODO: Build some sort of index to improve performance.
        for (Entry entry : mEntries) {
            LocalVariable var = entry.mLocalVar;
            if (var.getNumber() == number) {
                for (LocationRange range : var.getLocationRangeSet()) {
                    int start = range.getStartLocation().getLocation();
                    int end = range.getEndLocation().getLocation();
                    if (start >= 0 && end >= 0) {
                        if (start <= useLocation && useLocation < end) {
                            return var;
View Full Code Here

Examples of org.cojen.classfile.LocalVariable

        dout.writeShort(mRangeCount);

        int size = mCleanEntries.size();
        for (int i=0; i<size; i++) {
            Entry entry = mCleanEntries.get(i);
            LocalVariable localVar = entry.mLocalVar;

            Set<LocationRange> ranges = localVar.getLocationRangeSet();
            if (ranges == null) {
                continue;
            }

            int name_index = entry.mName.getIndex();
            int descriptor_index = entry.mDescriptor.getIndex();
            int index = localVar.getNumber();

            check("local variable table entry name index", name_index);
            check("local variable table entry descriptor index", descriptor_index);
            check("local variable table entry index", index);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.