1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 36 37 import org.eclipse.jdt.internal.compiler.ast.*; 38 import org.eclipse.jdt.internal.compiler.lookup.*; 39 40 public class CompletionOnQualifiedAllocationExpression extends QualifiedAllocationExpression { 41 public TypeBinding resolveType(BlockScope scope) { 42 if (arguments != null) { 43 int argsLength = arguments.length; 44 for (int a = argsLength; --a >= 0;) 45 arguments[a].resolveType(scope); 46 } 47 48 if (enclosingInstance != null) { 49 TypeBinding enclosingType = enclosingInstance.resolveType(scope); 50 if (enclosingType == null || !(enclosingType instanceof ReferenceBinding)) { 51 throw new CompletionNodeFound(); 52 } 53 this.resolvedType = ((SingleTypeReference) type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingType); 54 if (!(this.resolvedType instanceof ReferenceBinding)) 55 throw new CompletionNodeFound(); if (this.resolvedType.isInterface()) this.resolvedType = scope.getJavaLangObject(); 58 } else { 59 this.resolvedType = type.resolveType(scope, true ); 60 if (!(this.resolvedType instanceof ReferenceBinding)) 61 throw new CompletionNodeFound(); } 63 64 throw new CompletionNodeFound(this, this.resolvedType, scope); 65 } 66 public StringBuffer printExpression(int indent, StringBuffer output) { 67 if (this.enclosingInstance == null) 68 output.append("<CompleteOnAllocationExpression:" ); else 70 output.append("<CompleteOnQualifiedAllocationExpression:"); return super.printExpression(indent, output).append('>'); 72 } 73 } 74 | Popular Tags |