org.eclipse.jdt.internal.compiler.lookup.BlockScope.getJavaLangObject()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(14.2k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.getJavaLangObject()方法的一些代码示例,展示了BlockScope.getJavaLangObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.getJavaLangObject()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:getJavaLangObject

BlockScope.getJavaLangObject介绍

暂无

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public void resolve (BlockScope scope) {
  // only need the binding, which is used as reference in FlowInfo methods.
  this.binding = new LocalVariableBinding(
      this.name,
      scope.getJavaLangObject(),  // dummy, just needs to be a reference type
      0,
      false);
  this.binding.closeTracker = this;
  this.binding.declaringScope = scope;
  this.binding.setConstant(Constant.NotAConstant);
  this.binding.useFlag = LocalVariableBinding.USED;
  // use a free slot without assigning it:
  this.binding.id = scope.registerTrackingVariable(this);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private MethodBinding getAnonymousConstructorBinding(ReferenceBinding receiverType, BlockScope scope) {
  ReferenceBinding superType = receiverType;
  // an anonymous class inherits from java.lang.Object when declared "after" an interface
  ReferenceBinding anonymousSuperclass = superType.isInterface() ? scope.getJavaLangObject() : superType;
  // insert anonymous type in scope
  scope.addAnonymousType(this.anonymousType, superType);
  this.anonymousType.resolve(scope);
  // find anonymous super constructor
  this.resolvedType = this.anonymousType.binding; // 1.2 change
  if ((this.resolvedType.tagBits & TagBits.HierarchyHasProblems) != 0) {
    return null; // stop secondary errors
  }
  return findConstructorBinding(scope, this, anonymousSuperclass, this.argumentTypes);
}
@Override

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

private MethodBinding getAnonymousConstructorBinding(ReferenceBinding receiverType, BlockScope scope) {
  ReferenceBinding superType = receiverType;
  // an anonymous class inherits from java.lang.Object when declared "after" an interface
  ReferenceBinding anonymousSuperclass = superType.isInterface() ? scope.getJavaLangObject() : superType;
  // insert anonymous type in scope
  scope.addAnonymousType(this.anonymousType, superType);
  this.anonymousType.resolve(scope);
  // find anonymous super constructor
  this.resolvedType = this.anonymousType.binding; // 1.2 change
  if ((this.resolvedType.tagBits & TagBits.HierarchyHasProblems) != 0) {
    return null; // stop secondary errors
  }
  return findConstructorBinding(scope, this, anonymousSuperclass, this.argumentTypes);
}
public void traverse(ASTVisitor visitor, BlockScope scope) {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  this.constant = Constant.NotAConstant;
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  this.constant = Constant.NotAConstant;
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  this.constant = Constant.NotAConstant;
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public TypeBinding resolveType(BlockScope scope) {
  this.constant = Constant.NotAConstant;
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public TypeBinding resolveType(BlockScope scope) {
  this.constant = Constant.NotAConstant;
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }
  if (this.receiver.isImplicitThis())
    throw new CompletionNodeFound(this, null, scope);
  this.actualReceiverType = this.receiver.resolveType(scope);
  if (this.actualReceiverType == null || this.actualReceiverType.isBaseType())
    throw new CompletionNodeFound();
  if (this.actualReceiverType.isArrayType())
    this.actualReceiverType = scope.getJavaLangObject();
  throw new CompletionNodeFound(this, this.actualReceiverType, scope);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void resolve(BlockScope scope) {
  if (this.expression != null) {
    if (this.expression.resolveType(scope) != null) {
      TypeBinding javaLangClass = scope.getJavaLangClass();
      if (!javaLangClass.isValidBinding()) {
        scope.problemReporter().codeSnippetMissingClass("java.lang.Class", this.sourceStart, this.sourceEnd); //$NON-NLS-1$
        return;
      }
      TypeBinding javaLangObject = scope.getJavaLangObject();
      if (!javaLangObject.isValidBinding()) {
        scope.problemReporter().codeSnippetMissingClass("java.lang.Object", this.sourceStart, this.sourceEnd); //$NON-NLS-1$
        return;
      }
      TypeBinding[] argumentTypes = new TypeBinding[] {javaLangObject, javaLangClass};
      this.setResultMethod = scope.getImplicitMethod(SETRESULT_SELECTOR, argumentTypes, this);
      if (!this.setResultMethod.isValidBinding()) {
        scope.problemReporter().codeSnippetMissingMethod(ROOT_FULL_CLASS_NAME, new String(SETRESULT_SELECTOR), new String(SETRESULT_ARGUMENTS), this.sourceStart, this.sourceEnd);
        return;
      }
      // in constant case, the implicit conversion cannot be left uninitialized
      if (this.expression.constant != Constant.NotAConstant) {
        // fake 'no implicit conversion' (the return type is always void)
        this.expression.implicitConversion = this.expression.constant.typeID() << 4;
      }
    }
  }
}
public void setActualReceiverType(ReferenceBinding receiverType) {

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private TypeBinding checkInferredLocalVariableInitializer(BlockScope scope) {
  TypeBinding errorType = null;
  if (this.initialization instanceof ArrayInitializer) {
    scope.problemReporter().varLocalCannotBeArrayInitalizers(this);
    errorType = scope.createArrayType(scope.getJavaLangObject(), 1); // Treat as array of anything
  } else {
    // Catch-22: isPolyExpression() is not reliable BEFORE resolveType, so we need to peek to suppress the errors
    Expression polyExpression = findPolyExpression(this.initialization);
    if (polyExpression instanceof ReferenceExpression) {
      scope.problemReporter().varLocalCannotBeMethodReference(this);
      errorType = TypeBinding.NULL;
    } else if (polyExpression != null) { // Should be instanceof LambdaExpression, but this is safer
      scope.problemReporter().varLocalCannotBeLambda(this);
      errorType = TypeBinding.NULL;
    }
  }
  if (this.type.dimensions() > 0 || this.type.extraDimensions() > 0) {
    scope.problemReporter().varLocalCannotBeArray(this);
    errorType = scope.createArrayType(scope.getJavaLangObject(), 1); // This is just to quell some warnings
  }
  if ((this.bits & ASTNode.IsAdditionalDeclarator) != 0) {
    scope.problemReporter().varLocalMultipleDeclarators(this);
    errorType = this.initialization.resolveType(scope);
  }
  return errorType;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public TypeBinding resolveType(BlockScope scope) {
  if (this.arguments != null) {
    int argsLength = this.arguments.length;
    for (int a = argsLength; --a >= 0;)
      this.arguments[a].resolveType(scope);
  }

  if (this.enclosingInstance != null) {
    TypeBinding enclosingType = this.enclosingInstance.resolveType(scope);
    if (enclosingType == null || !(enclosingType instanceof ReferenceBinding)) {
      throw new CompletionNodeFound();
    }
    this.resolvedType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingType);
    if (!(this.resolvedType instanceof ReferenceBinding))
      throw new CompletionNodeFound(); // no need to continue if its an array or base type
    if (this.resolvedType.isInterface()) // handle the anonymous class definition case
      this.resolvedType = scope.getJavaLangObject();
  } else {
    this.resolvedType = this.type.resolveType(scope, true /* check bounds*/);
    if (!(this.resolvedType instanceof ReferenceBinding))
      throw new CompletionNodeFound(); // no need to continue if its an array or base type
  }

  throw new CompletionNodeFound(this, this.resolvedType, scope);
}
public StringBuffer printExpression(int indent, StringBuffer output) {

相关文章

微信公众号

最新文章

更多

BlockScope类方法