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

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

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

BlockScope.compilationUnitScope介绍

暂无

代码示例

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

@Override
public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

public CompilationUnitDeclaration getCompilationUnitDeclaration() {
  return this.enclosingScope == null ? null : this.enclosingScope.compilationUnitScope().referenceContext;
}

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

private MethodBinding findCloseMethod(final ASTNode resource, TypeBinding type) {
  MethodBinding closeMethod = null;
  if (type != null && type.isValidBinding() && type instanceof ReferenceBinding) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final ASTNode resource, TypeBinding type) {
  MethodBinding closeMethod = null;
  if (type != null && type.isValidBinding() && type instanceof ReferenceBinding) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

private MethodBinding findCloseMethod(final LocalDeclaration resource, LocalVariableBinding resourceBinding) {
  MethodBinding closeMethod = null;
  TypeBinding type = resourceBinding.type;
  if (type != null && type.isValidBinding()) {
    ReferenceBinding binding = (ReferenceBinding) type;
    closeMethod = binding.getExactMethod(ConstantPool.Close, new TypeBinding [0], this.scope.compilationUnitScope()); // scope needs to be tighter
    if(closeMethod == null) {
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=380112
      // closeMethod could be null if the binding is from an interface
      // extending from multiple interfaces.
      InvocationSite site = new InvocationSite.EmptyWithAstNode(resource);
      closeMethod = this.scope.compilationUnitScope().findMethod(binding, ConstantPool.Close, new TypeBinding[0], site, false);
    }
  }
  return closeMethod;
}
private FlowInfo prepareCatchInfo(FlowInfo flowInfo, ExceptionHandlingFlowContext handlingContext, FlowInfo tryInfo, int i) {

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

/**
 *    Flow analysis for a local innertype
 *
 */
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  if (this.ignoreFurtherInvestigation)
    return flowInfo;
  try {
    if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
      this.bits |= ASTNode.IsReachable;
      LocalTypeBinding localType = (LocalTypeBinding) this.binding;
      localType.setConstantPoolName(currentScope.compilationUnitScope().computeConstantPoolName(localType));
    }
    manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
    updateMaxFieldCount(); // propagate down the max field count
    internalAnalyseCode(flowContext, flowInfo);
  } catch (AbortType e) {
    this.ignoreFurtherInvestigation = true;
  }
  return flowInfo;
}

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

/**
 *    Flow analysis for a local innertype
 *
 */
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  if (this.ignoreFurtherInvestigation)
    return flowInfo;
  try {
    if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
      this.bits |= ASTNode.IsReachable;
      LocalTypeBinding localType = (LocalTypeBinding) this.binding;
      localType.setConstantPoolName(currentScope.compilationUnitScope().computeConstantPoolName(localType));
    }
    manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
    updateMaxFieldCount(); // propagate down the max field count
    internalAnalyseCode(flowContext, flowInfo);
  } catch (AbortType e) {
    this.ignoreFurtherInvestigation = true;
  }
  return flowInfo;
}

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

@Override
  public void run() {
    if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType)
        || valueType.isCompatibleWith(requiredType))) {
      if (!(requiredType.isArrayType()
          && requiredType.dimensions() == 1
          && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType)
              || valueType.isCompatibleWith(leafType)))) {
        
        if (leafType.isAnnotationType() && !valueType.isAnnotationType()) {
          scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass,
              MemberValuePair.this.name, MemberValuePair.this.value, leafType);
        } else {
          scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null);
        }
        shouldExit[0] = true; // TODO may allow to proceed to find more errors at once
      }
    } else {
      scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType());
      MemberValuePair.this.value.computeConversion(scope, requiredType, valueType);
    }
  }
};

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

@Override
  public void run() {
    if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType)
        || valueType.isCompatibleWith(requiredType))) {
      if (!(requiredType.isArrayType()
          && requiredType.dimensions() == 1
          && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType)
              || valueType.isCompatibleWith(leafType)))) {
        
        if (leafType.isAnnotationType() && !valueType.isAnnotationType()) {
          scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass,
              MemberValuePair.this.name, MemberValuePair.this.value, leafType);
        } else {
          scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null);
        }
        shouldExit[0] = true; // TODO may allow to proceed to find more errors at once
      }
    } else {
      scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType());
      MemberValuePair.this.value.computeConversion(scope, requiredType, valueType);
    }
  }
};

相关文章

微信公众号

最新文章

更多

BlockScope类方法