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 CompletionOnMessageSend extends MessageSend { 39 40 public TypeBinding resolveType(BlockScope scope) { 41 if (arguments != null) { 42 int argsLength = arguments.length; 43 for (int a = argsLength; --a >= 0;) 44 arguments[a].resolveType(scope); 45 } 46 47 if (receiver.isImplicitThis()) 48 throw new CompletionNodeFound(this, null, scope); 49 50 this.actualReceiverType = receiver.resolveType(scope); 51 if (this.actualReceiverType == null || this.actualReceiverType.isBaseType()) 52 throw new CompletionNodeFound(); 53 54 if (this.actualReceiverType.isArrayType()) 55 this.actualReceiverType = scope.getJavaLangObject(); 56 throw new CompletionNodeFound(this, this.actualReceiverType, scope); 57 } 58 59 public StringBuffer printExpression(int indent, StringBuffer output) { 60 61 output.append("<CompleteOnMessageSend:"); if (!receiver.isImplicitThis()) receiver.printExpression(0, output).append('.'); 63 if (this.typeArguments != null) { 64 output.append('<'); 65 int max = typeArguments.length - 1; 66 for (int j = 0; j < max; j++) { 67 typeArguments[j].print(0, output); 68 output.append(", "); } 70 typeArguments[max].print(0, output); 71 output.append('>'); 72 } 73 output.append(selector).append('('); 74 if (arguments != null) { 75 for (int i = 0; i < arguments.length; i++) { 76 if (i > 0) output.append(", "); arguments[i].printExpression(0, output); 78 } 79 } 80 return output.append(")>"); } 82 } 83 | Popular Tags |