Examples of LocalVariableBinding


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

  public void consumeLocalVar(char[] varName) {
    if (this.scope == null) {
      this.scope = this.methodBinding.sourceMethod().scope;
    }
     for (int i = 0; i < this.scope.localIndex; i++) {
      LocalVariableBinding local = this.scope.locals[i];
      if (CharOperation.equals(varName, local.name)) {
        this.methodBinding = null;
        this.compilerBinding = local;
        return;
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

     */
    private JVariable possiblyReferenceOuterLocal(JVariable variable,
        Binding binding) {

      if (variable instanceof JLocal || variable instanceof JParameter) {
        LocalVariableBinding localBinding = (LocalVariableBinding) binding;
        if (localBinding.declaringScope.methodScope() != currentMethodScope) {
          variable = null;
          VariableBinding[] vars = currentMethodScope.getEmulationPath(localBinding);
          if (vars == null) {
            return null;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

     */
    private JVariable possiblyReferenceOuterLocal(JVariable variable,
        Binding binding) {

      if (variable instanceof JLocal || variable instanceof JParameter) {
        LocalVariableBinding localBinding = (LocalVariableBinding) binding;
        if (localBinding.declaringScope.methodScope() != currentMethodScope) {
          variable = null;
          VariableBinding[] vars = currentMethodScope.getEmulationPath(localBinding);
          if (vars == null) {
            return null;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

          return true;
        }

        JMethodBody enclosingBody = findEnclosingMethod(scope);
        SourceInfo info = makeSourceInfo(argument, enclosingBody.getMethod());
        LocalVariableBinding b = argument.binding;
        JType localType = (JType) typeMap.get(b.type);
        JLocal newLocal = program.createLocal(info, argument.name, localType,
            b.isFinal(), enclosingBody);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(argument, e);
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

    }

    @Override
    public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
      try {
        LocalVariableBinding b = localDeclaration.binding;
        JType localType = (JType) typeMap.get(localDeclaration.type.resolvedType);
        JMethodBody enclosingBody = findEnclosingMethod(scope);
        SourceInfo info = makeSourceInfo(localDeclaration,
            enclosingBody.getMethod());
        JLocal newLocal = program.createLocal(info, localDeclaration.name,
            localType, b.isFinal(), enclosingBody);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(localDeclaration, e);
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

          return true;
        }

        JMethodBody enclosingBody = findEnclosingMethod(scope);
        SourceInfo info = makeSourceInfo(argument, enclosingBody.getMethod());
        LocalVariableBinding b = argument.binding;
        JType localType = (JType) typeMap.get(b.type);
        JLocal newLocal = program.createLocal(info, argument.name, localType,
            b.isFinal(), enclosingBody);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(argument, e);
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

    }

    @Override
    public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
      try {
        LocalVariableBinding b = localDeclaration.binding;
        JType localType = (JType) typeMap.get(localDeclaration.type.resolvedType);
        JMethodBody enclosingBody = findEnclosingMethod(scope);
        SourceInfo info = makeSourceInfo(localDeclaration,
            enclosingBody.getMethod());
        JLocal newLocal = program.createLocal(info, localDeclaration.name,
            localType, b.isFinal(), enclosingBody);
        typeMap.put(b, newLocal);
        return true;
      } catch (Throwable e) {
        throw translateException(localDeclaration, e);
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

        }
      }
      switch(this.kind) {
        case ARRAY :
          // allocate #index secret variable (of type int)
          this.indexVariable = new LocalVariableBinding(SecretIndexVariableName, TypeBinding.INT, ClassFileConstants.AccDefault, false);
          this.scope.addLocalVariable(this.indexVariable);
          this.indexVariable.setConstant(Constant.NotAConstant); // not inlinable
          // allocate #max secret variable
          this.maxVariable = new LocalVariableBinding(SecretMaxVariableName, TypeBinding.INT, ClassFileConstants.AccDefault, false);
          this.scope.addLocalVariable(this.maxVariable);
          this.maxVariable.setConstant(Constant.NotAConstant); // not inlinable
          // add #array secret variable (of collection type)
          if (expectedCollectionType == null) {
            this.collectionVariable = new LocalVariableBinding(SecretCollectionVariableName, collectionType, ClassFileConstants.AccDefault, false);
          } else {
            this.collectionVariable = new LocalVariableBinding(SecretCollectionVariableName, expectedCollectionType, ClassFileConstants.AccDefault, false);
          }
          this.scope.addLocalVariable(this.collectionVariable);
          this.collectionVariable.setConstant(Constant.NotAConstant); // not inlinable
          break;
        case RAW_ITERABLE :
        case GENERIC_ITERABLE :
          // allocate #index secret variable (of type Iterator)
          this.indexVariable = new LocalVariableBinding(SecretIteratorVariableName, this.scope.getJavaUtilIterator(), ClassFileConstants.AccDefault, false);
          this.scope.addLocalVariable(this.indexVariable);
          this.indexVariable.setConstant(Constant.NotAConstant); // not inlinable
          break;
        default :
          if (isTargetJsr14) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

* @param scope the scope of the analysis
* @param flowContext the current flow context
* @param flowInfo the upstream flow info; caveat: may get modified
*/
public void checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo) {
  LocalVariableBinding local = localVariableBinding();
  if (local != null &&
      (local.type.tagBits & TagBits.IsBaseType) == 0) {
    if ((this.bits & ASTNode.IsNonNull) == 0) {
      flowContext.recordUsingNullReference(scope, local, this,
          FlowContext.MAY_NULL, flowInfo);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding

  if (/* (this.bits & IsNonNull) != 0 || */
    this.constant != null && this.constant != Constant.NotAConstant)
  return FlowInfo.NON_NULL; // constant expression cannot be null

  LocalVariableBinding local = localVariableBinding();
  if (local != null)
    return flowInfo.nullStatus(local);
  return FlowInfo.NON_NULL;
}
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.