Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99068 Details for
Bug 230864
[assist] Code assist do not work in parameterized method with 'this' as receive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug230864_001.txt (text/plain), 5.18 KB, created by
David Audel
on 2008-05-07 09:38:58 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-05-07 09:38:58 EDT
Size:
5.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java,v >retrieving revision 1.1 >diff -u -r1.1 CompletionOnMessageSendName.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java 12 Apr 2006 10:07:26 -0000 1.1 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.java 7 May 2008 13:37:14 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.jdt.internal.codeassist.complete; > > import org.eclipse.jdt.internal.compiler.ast.MessageSend; >-import org.eclipse.jdt.internal.compiler.ast.NameReference; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; > >@@ -41,12 +40,7 @@ > this.genericTypeArguments[i] = this.typeArguments[i].resolveType(scope, true /* check bounds*/); > } > } >- >- if(this.receiver instanceof NameReference) { >- throw new CompletionNodeFound(this, ((NameReference)this.receiver).binding, scope); >- } else if(this.receiver instanceof MessageSend) { >- throw new CompletionNodeFound(this, ((MessageSend)this.receiver).binding, scope); >- } >+ > throw new CompletionNodeFound(this, this.actualReceiverType, scope); > } > >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.366 >diff -u -r1.366 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 22 Apr 2008 09:15:08 -0000 1.366 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 7 May 2008 13:37:14 -0000 >@@ -1830,15 +1830,16 @@ > this.insideQualifiedReference = true; > this.completionToken = messageSend.selector; > boolean onlyStatic = false; >- TypeBinding receiverType = null; >- if(qualifiedBinding instanceof VariableBinding) { >- receiverType = ((VariableBinding)qualifiedBinding).type; >- } else if(qualifiedBinding instanceof MethodBinding) { >- receiverType = ((MethodBinding)qualifiedBinding).returnType; >- } else if(qualifiedBinding instanceof ReferenceBinding && !(qualifiedBinding instanceof TypeVariableBinding)) { >+ if (messageSend.receiver instanceof NameReference) { >+ onlyStatic = ((NameReference)messageSend.receiver).isTypeReference(); >+ } else if (!(messageSend.receiver instanceof MessageSend) && >+ !(messageSend.receiver instanceof FieldReference) && >+ !(messageSend.receiver.isThis())) { > onlyStatic = true; >- receiverType = (TypeBinding)qualifiedBinding; > } >+ >+ TypeBinding receiverType = (TypeBinding)qualifiedBinding; >+ > if(receiverType != null && receiverType instanceof ReferenceBinding) { > TypeBinding[] typeArgTypes = computeTypesIfCorrect(messageSend.typeArguments); > if(typeArgTypes != null) { >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v >retrieving revision 1.103 >diff -u -r1.103 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 22 Apr 2008 09:15:13 -0000 1.103 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 7 May 2008 13:37:18 -0000 >@@ -8652,7 +8652,8 @@ > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "zzz2[METHOD_REF]{zzz2(), Ltest.Test;, (Ljava.lang.Object;)V, zzz2, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}", >+ "zzz2[METHOD_REF]{zzz2(), Ltest.Test;, (Ljava.lang.Object;)V, zzz2, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "zzz1[METHOD_REF]{zzz1(), Ltest.Test;, (Ljava.lang.Object;)V, zzz1, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450 >@@ -8826,7 +8827,8 @@ > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "zzz2[METHOD_REF]{zzz2(), Ltest.Test;, (Ljava.lang.Object;)V, zzz2, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}", >+ "zzz2[METHOD_REF]{zzz2(), Ltest.Test;, (Ljava.lang.Object;)V, zzz2, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" + >+ "zzz1[METHOD_REF]{zzz1(), Ltest.Test;, (Ljava.lang.Object;)V, zzz1, (t), " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=133491
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 230864
: 99068