示例#1
0
 public TypeBinding checkResolvedType(
     TypeBinding type, Scope scope, int location, boolean hasError) {
   // SH}
   if (type.isArrayType() && ((ArrayBinding) type).leafComponentType == TypeBinding.VOID) {
     scope.problemReporter().cannotAllocateVoidArray(this);
     return null;
   }
   if (!(this
           instanceof
           QualifiedTypeReference) // QualifiedTypeReference#getTypeBinding called above will have
                                   // already checked deprecation
       && isTypeUseDeprecated(type, scope)) {
     reportDeprecatedType(type, scope);
   }
   type =
       scope
           .environment()
           .convertToRawType(type, false /*do not force conversion of enclosing types*/);
   if (type.leafComponentType().isRawType()
       && (this.bits & ASTNode.IgnoreRawTypeCheck) == 0
       && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference)
           != ProblemSeverities.Ignore) {
     scope.problemReporter().rawTypeReference(this, type);
   }
   if (hasError) {
     resolveAnnotations(scope, 0); // don't apply null defaults to buggy type
     return type;
   } else {
     // store the computed type only if no error, otherwise keep the problem type instead
     this.resolvedType = type;
     resolveAnnotations(scope, location);
     return this
         .resolvedType; // pick up value that may have been changed in resolveAnnotations(..)
   }
 }