本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.getMemberType()
方法的一些代码示例,展示了BlockScope.getMemberType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.getMemberType()
方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:getMemberType
暂无
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (castedExpressionType == enclosingInstanceType) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (memberType == scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (castedExpressionType == enclosingInstanceType) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (memberType == scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (castedExpressionType == enclosingInstanceType) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (memberType == scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
/**
* Casting an enclosing instance will considered as useful if removing it would actually bind to a different type
*/
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) return;
TypeBinding castedExpressionType = ((CastExpression)enclosingInstance).expression.resolvedType;
if (castedExpressionType == null) return; // cannot do better
// obvious identity cast
if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
} else if (castedExpressionType == TypeBinding.NULL){
return; // tolerate null enclosing instance cast
} else {
TypeBinding alternateEnclosingInstanceType = castedExpressionType;
if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType()) return; // error case
if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {
scope.problemReporter().unnecessaryCast((CastExpression)enclosingInstance);
}
}
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
TypeBinding memberType = this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
TypeBinding memberType = this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
TypeBinding memberType = this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
scope.problemReporter().deprecatedType(memberType, this);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) {
this.resolvedType = scope.getMemberType(this.token, enclosingType);
boolean hasError = false;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391500
resolveAnnotations(scope, 0); // defaultNullness not relevant, the only caller within the compiler: QAE
TypeBinding memberType = this.resolvedType; // load after possible update in resolveAnnotations()
if (!memberType.isValidBinding()) {
hasError = true;
scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType);
memberType = ((ReferenceBinding)memberType).closestMatch();
if (memberType == null) {
return null;
}
}
if (isTypeUseDeprecated(memberType, scope))
reportDeprecatedType(memberType, scope);
memberType = scope.environment().convertToRawType(memberType, false /*do not force conversion of enclosing types*/);
if (memberType.isRawType()
&& (this.bits & IgnoreRawTypeCheck) == 0
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){
scope.problemReporter().rawTypeReference(this, memberType);
}
if (hasError) {
// do not store the computed type, keep the problem type instead
return memberType;
}
return this.resolvedType = memberType;
}
内容来源于网络,如有侵权,请联系作者删除!