diff options
| author | Manju Mathew | 2013-02-04 15:23:00 +0000 |
|---|---|---|
| committer | Jayaprakash Arthanareeswaran | 2013-04-03 09:01:51 +0000 |
| commit | f9f36e1c7cc2b7cae10c64feb71a05c0771ac940 (patch) | |
| tree | 2ab8e7178c47c350e969fc07cea702ab317c0813 | |
| parent | b55af0d251839febd524bd542ba1eea20d1a7dc4 (diff) | |
| download | eclipse.jdt.core-f9f36e1c7cc2b7cae10c64feb71a05c0771ac940.tar.gz eclipse.jdt.core-f9f36e1c7cc2b7cae10c64feb71a05c0771ac940.tar.xz eclipse.jdt.core-f9f36e1c7cc2b7cae10c64feb71a05c0771ac940.zip | |
Fix for bug 392581 - [content assist] after "super.", enclosing method
should be first proposal
| -rw-r--r-- | org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java index 0409ada870..08fcd086f5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java @@ -4259,17 +4259,14 @@ public final class CompletionEngine if (site instanceof CompletionOnMemberAccess) { CompletionOnMemberAccess access = (CompletionOnMemberAccess) site; if (access.isSuperAccess() && this.parser.assistNodeParent == null) { - ReferenceContext referenceContext = scope.referenceContext(); - if (referenceContext instanceof AbstractMethodDeclaration) { - MethodBinding binding = ((AbstractMethodDeclaration) referenceContext).binding; - if (binding != null) { - if (CharOperation.equals(binding.selector, method.selector)) { - if (binding.areParameterErasuresEqual(method)) { - return R_EXACT_NAME + R_METHOD_OVERIDE; - } - return R_EXACT_NAME; - } + MethodBinding binding = ((MethodDeclaration) scope.referenceContext()).binding; + String methodName = String.valueOf(binding.selector); + String currentMethodName = String.valueOf(method.selector); + if (currentMethodName != null && currentMethodName.equals(methodName)) { + if (binding.areParametersEqual(method)) { + return R_EXACT_NAME + R_METHOD_OVERIDE; } + return R_EXACT_NAME; } } } @@ -12878,4 +12875,4 @@ public final class CompletionEngine if(foundConflicts) return substituedParameterNames; return null; } -}
\ No newline at end of file +} |
