diff options
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java index ef5ed425e..ec65a8edc 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java @@ -4,7 +4,6 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * $Id: JavadocMessageSend.java 23405 2010-02-03 17:02:18Z stephan $ * * Contributors: * IBM Corporation - initial API and implementation @@ -61,26 +60,25 @@ public class JavadocMessageSend extends MessageSend { // will check for null after args are resolved - TypeBinding[] argumentTypes = Binding.NO_PARAMETERS; boolean hasArgsTypeVar = false; if (this.arguments != null) { - boolean argHasError = false; // typeChecks all arguments + this.argumentsHaveErrors = false; // typeChecks all arguments int length = this.arguments.length; - argumentTypes = new TypeBinding[length]; + this.argumentTypes = new TypeBinding[length]; for (int i = 0; i < length; i++){ Expression argument = this.arguments[i]; if (scope.kind == Scope.CLASS_SCOPE) { - argumentTypes[i] = argument.resolveType((ClassScope)scope); + this.argumentTypes[i] = argument.resolveType((ClassScope)scope); } else { - argumentTypes[i] = argument.resolveType((BlockScope)scope); + this.argumentTypes[i] = argument.resolveType((BlockScope)scope); } - if (argumentTypes[i] == null) { - argHasError = true; + if (this.argumentTypes[i] == null) { + this.argumentsHaveErrors = true; } else if (!hasArgsTypeVar) { - hasArgsTypeVar = argumentTypes[i].isTypeVariable(); + hasArgsTypeVar = this.argumentTypes[i].isTypeVariable(); } } - if (argHasError) { + if (this.argumentsHaveErrors) { return null; } } @@ -97,15 +95,15 @@ public class JavadocMessageSend extends MessageSend { // base type cannot receive any message if (this.actualReceiverType.isBaseType()) { - scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, argumentTypes, scope.getDeclarationModifiers()); + scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, this.argumentTypes, scope.getDeclarationModifiers()); return null; } // {ObjectTeams: AnchorMapping anchorMapping = null; try { - anchorMapping = beforeMethodLookup(argumentTypes, scope); + anchorMapping = beforeMethodLookup(this.argumentTypes, scope); // jwl} - this.binding = scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this); + this.binding = scope.getMethod(this.actualReceiverType, this.selector, this.argumentTypes, this); // {ObjectTeams: } finally { // added by haebor according to MessageSend.resolveType(BlockScope) @@ -120,7 +118,7 @@ public class JavadocMessageSend extends MessageSend { MethodBinding methodBinding = this.binding; while (!methodBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) { enclosingTypeBinding = enclosingTypeBinding.enclosingType(); - methodBinding = scope.getMethod(enclosingTypeBinding, this.selector, argumentTypes, this); + methodBinding = scope.getMethod(enclosingTypeBinding, this.selector, this.argumentTypes, this); } if (methodBinding.isValidBinding()) { this.binding = methodBinding; @@ -129,12 +127,12 @@ public class JavadocMessageSend extends MessageSend { enclosingTypeBinding = this.actualReceiverType; MethodBinding contructorBinding = this.binding; if (!contructorBinding.isValidBinding() && CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) { - contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, argumentTypes, this); + contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, this.argumentTypes, this); } while (!contructorBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) { enclosingTypeBinding = enclosingTypeBinding.enclosingType(); if (CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) { - contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, argumentTypes, this); + contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, this.argumentTypes, this); } } if (contructorBinding.isValidBinding()) { @@ -164,7 +162,7 @@ public class JavadocMessageSend extends MessageSend { if (this.actualReceiverType instanceof ReferenceBinding) { this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType; } else { - scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, argumentTypes, scope.getDeclarationModifiers()); + scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, this.argumentTypes, scope.getDeclarationModifiers()); return null; } } @@ -176,19 +174,19 @@ public class JavadocMessageSend extends MessageSend { } return this.resolvedType = this.binding == null ? null : this.binding.returnType; } else if (hasArgsTypeVar) { - MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound); + MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound); scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers()); } else if (this.binding.isVarargs()) { - int length = argumentTypes.length; - if (!(this.binding.parameters.length == length && argumentTypes[length-1].isArrayType())) { - MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound); + int length = this.argumentTypes.length; + if (!(this.binding.parameters.length == length && this.argumentTypes[length-1].isArrayType())) { + MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound); scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers()); } } else { - int length = argumentTypes.length; + int length = this.argumentTypes.length; for (int i=0; i<length; i++) { - if (TypeBinding.notEquals(this.binding.parameters[i].erasure(), argumentTypes[i].erasure())) { - MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound); + if (TypeBinding.notEquals(this.binding.parameters[i].erasure(), this.argumentTypes[i].erasure())) { + MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound); scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers()); break; } |