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

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

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

BlockScope.tagAsAccessingEnclosingInstanceStateOf介绍

暂无

代码示例

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

@Override
public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
  // this/super cannot be used in constructor call
  MethodScope methodScope = scope.methodScope();
  if (this.evaluationContext.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  }
  scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
  // this/super cannot be used in constructor call
  MethodScope methodScope = scope.methodScope();
  if (this.evaluationContext.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  }
  scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
  // this/super cannot be used in constructor call
  MethodScope methodScope = scope.methodScope();
  if (this.evaluationContext.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  }
  scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
  // this/super cannot be used in constructor call
  MethodScope methodScope = scope.methodScope();
  if (this.evaluationContext.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  }
  scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding thisType) {
  // this/super cannot be used in constructor call
  MethodScope methodScope = scope.methodScope();
  if (this.evaluationContext.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (this.evaluationContext.declaringTypeName == null || this.evaluationContext.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  }
  scope.tagAsAccessingEnclosingInstanceStateOf(thisType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  // static methods with receiver value never get here
  if (this.haveReceiver) {
    this.lhs.checkNPE(currentScope, flowContext, flowInfo);
    this.lhs.analyseCode(currentScope, flowContext, flowInfo, true);
  } else if (isConstructorReference()) {
    TypeBinding type = this.receiverType.leafComponentType();
    if (type.isNestedType() &&
      type instanceof ReferenceBinding && !((ReferenceBinding)type).isStatic()) {
      currentScope.tagAsAccessingEnclosingInstanceStateOf((ReferenceBinding)type, false);
      this.shouldCaptureInstance = true;
      ReferenceBinding allocatedTypeErasure = (ReferenceBinding) type.erasure();
      if (allocatedTypeErasure.isLocalType()) {
        ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
        // request cascade of accesses
      }
    }
  }
  manageSyntheticAccessIfNecessary(currentScope, flowInfo);
  return flowInfo;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  // static methods with receiver value never get here
  if (this.haveReceiver) {
    this.lhs.checkNPE(currentScope, flowContext, flowInfo);
    this.lhs.analyseCode(currentScope, flowContext, flowInfo, true);
  } else if (isConstructorReference()) {
    TypeBinding type = this.receiverType.leafComponentType();
    if (type.isNestedType() &&
      type instanceof ReferenceBinding && !((ReferenceBinding)type).isStatic()) {
      currentScope.tagAsAccessingEnclosingInstanceStateOf((ReferenceBinding)type, false);
      this.shouldCaptureInstance = true;
      ReferenceBinding allocatedTypeErasure = (ReferenceBinding) type.erasure();
      if (allocatedTypeErasure.isLocalType()) {
        ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
        // request cascade of accesses
      }
    }
  }
  manageSyntheticAccessIfNecessary(currentScope, flowInfo);
  return flowInfo;
}

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

public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
  // static methods with receiver value never get here
  if (this.haveReceiver) {
    this.lhs.checkNPE(currentScope, flowContext, flowInfo);
    this.lhs.analyseCode(currentScope, flowContext, flowInfo, true);
  } else if (isConstructorReference()) {
    TypeBinding type = this.receiverType.leafComponentType();
    if (type.isNestedType() &&
      type instanceof ReferenceBinding && !((ReferenceBinding)type).isStatic()) {
      currentScope.tagAsAccessingEnclosingInstanceStateOf((ReferenceBinding)type, false);
      this.shouldCaptureInstance = true;
      ReferenceBinding allocatedTypeErasure = (ReferenceBinding) type.erasure();
      if (allocatedTypeErasure.isLocalType()) {
        ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
        // request cascade of accesses
      }
    }
  }
  manageSyntheticAccessIfNecessary(currentScope, flowInfo);
  return flowInfo;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

public boolean checkAccess(BlockScope scope, ReferenceBinding receiverType) {
  MethodScope methodScope = scope.methodScope();
  // this/super cannot be used in constructor call
  if (methodScope.isConstructorCall) {
    methodScope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
    return false;
  }
  // static may not refer to this/super
  if (methodScope.isStatic) {
    methodScope.problemReporter().errorThisSuperInStatic(this);
    return false;
  } else if (this.isUnqualifiedSuper()) {
    TypeDeclaration type = methodScope.referenceType();
    if (type != null && TypeDeclaration.kind(type.modifiers) == TypeDeclaration.INTERFACE_DECL) {
      methodScope.problemReporter().errorNoSuperInInterface(this);
      return false;
    }
  }
  if (receiverType != null)
    scope.tagAsAccessingEnclosingInstanceStateOf(receiverType, false /* type variable access */);
  return true;
}

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

scope.tagAsAccessingEnclosingInstanceStateOf(this.currentCompatibleType, false /* type variable access */);

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

return fieldBinding.type;
} else {
  scope.tagAsAccessingEnclosingInstanceStateOf(fieldBinding.declaringClass, false /* type variable access */);

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

return fieldBinding.type;
} else {
  scope.tagAsAccessingEnclosingInstanceStateOf(fieldBinding.declaringClass, false /* type variable access */);

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

return fieldBinding.type;
} else {
  scope.tagAsAccessingEnclosingInstanceStateOf(fieldBinding.declaringClass, false /* type variable access */);

相关文章

微信公众号

最新文章

更多

BlockScope类方法