1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 34 35 import org.eclipse.jdt.internal.compiler.ast.*; 36 import org.eclipse.jdt.internal.compiler.lookup.*; 37 38 public class CompletionOnExplicitConstructorCall extends ExplicitConstructorCall { 39 40 public CompletionOnExplicitConstructorCall(int accessMode) { 41 super(accessMode); 42 } 43 44 public StringBuffer printStatement(int tab, StringBuffer output) { 45 46 printIndent(tab, output); 47 output.append("<CompleteOnExplicitConstructorCall:"); if (this.qualification != null) this.qualification.printExpression(0, output).append('.'); 49 if (this.accessMode == This) { 50 output.append("this("); } else { 52 output.append("super("); } 54 if (this.arguments != null) { 55 for (int i = 0; i < this.arguments.length; i++) { 56 if (i > 0) output.append(", "); this.arguments[i].printExpression(0, output); 58 } 59 } 60 return output.append(")>;"); } 62 63 public void resolve(BlockScope scope) { 64 65 ReferenceBinding receiverType = scope.enclosingSourceType(); 66 67 if (this.arguments != null) { 68 int argsLength = this.arguments.length; 69 for (int a = argsLength; --a >= 0;) 70 this.arguments[a].resolveType(scope); 71 } 72 73 if (this.accessMode != This && receiverType != null) { 74 if (receiverType.isHierarchyInconsistent()) 75 throw new CompletionNodeFound(); 76 receiverType = receiverType.superclass(); 77 } 78 if (receiverType == null) 79 throw new CompletionNodeFound(); 80 else 81 throw new CompletionNodeFound(this, receiverType, scope); 82 } 83 } 84 | Popular Tags |