public TypeBinding resolveType(BlockScope scope) { // it can be a package, type, member type, local variable or field this.binding = scope.getBinding(this.tokens, this); if (!this.binding.isValidBinding()) { if (this.binding instanceof ProblemFieldBinding) { // tolerate some error cases if (this.binding.problemId() == ProblemReasons.NotVisible || this.binding.problemId() == ProblemReasons.InheritedNameHidesEnclosingName || this.binding.problemId() == ProblemReasons.NonStaticReferenceInConstructorInvocation || this.binding.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) { throw new SelectionNodeFound(this.binding); } scope.problemReporter().invalidField(this, (FieldBinding) this.binding); } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) { // tolerate some error cases if (this.binding.problemId() == ProblemReasons.NotVisible) { throw new SelectionNodeFound(this.binding); } scope.problemReporter().invalidType(this, (TypeBinding) this.binding); } else { scope.problemReporter().unresolvableReference(this, this.binding); } throw new SelectionNodeFound(); } throw new SelectionNodeFound(this.binding); }