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 135127 Details for
Bug 274466
[assist] Assert expressions should be proposed with high relevance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
bug_274466.txt (text/plain), 3.16 KB, created by
Jay Arthanareeswaran
on 2009-05-11 07:44:28 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2009-05-11 07:44:28 EDT
Size:
3.16 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.395 >diff -u -r1.395 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 27 Apr 2009 09:38:22 -0000 1.395 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 11 May 2009 11:41:58 -0000 >@@ -3630,6 +3630,9 @@ > addExpectedType(TypeBinding.BOOLEAN, scope); > } else if (parent instanceof IfStatement) { > addExpectedType(TypeBinding.BOOLEAN, scope); >+ } >+ else if (parent instanceof AssertStatement) { >+ addExpectedType(TypeBinding.BOOLEAN, scope); > } else if (parent instanceof ForStatement) { // astNodeParent set to ForStatement only for the condition > addExpectedType(TypeBinding.BOOLEAN, scope); > >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v >retrieving revision 1.203 >diff -u -r1.203 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 7 May 2009 08:49:30 -0000 1.203 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 11 May 2009 11:42:29 -0000 >@@ -20101,5 +20101,33 @@ > "methodReturningBoolean[METHOD_REF]{methodReturningBoolean(), Ltest.Test253008;, ()Z, methodReturningBoolean, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } >+// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=274466 >+// Check for boolean methods with higher relevance in assert statements >+public void test274466() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test274466.java", >+ "package test;" + >+ "public class Test274466 {\n" + >+ " boolean methodReturningBoolean() { return true; }\n" + >+ " void methodReturningBlah() { return; }\n" + >+ " int foo(int p) {\n" + >+ " assert methodR" + >+ " }\n" + >+ "}\n"); >+ >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "methodR"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ assertResults( >+ "methodReturningBlah[METHOD_REF]{methodReturningBlah(), Ltest.Test274466;, ()V, methodReturningBlah, " + >+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" + >+ "methodReturningBoolean[METHOD_REF]{methodReturningBoolean(), Ltest.Test274466;, ()Z, methodReturningBoolean, " + >+ (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > > }
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 274466
:
135127
|
135526
|
135528
|
135737