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 240596 Details for
Bug 429738
[1.8][search] Find Declarations (Ctrl + G) shows no result for type-less lambda parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed Patch
Fix-for-Bug-429738-18search-Find-Declarations-Ctrl--.patch (text/plain), 2.87 KB, created by
Manoj N Palat
on 2014-03-06 09:08:15 EST
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Manoj N Palat
Created:
2014-03-06 09:08:15 EST
Size:
2.87 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java >index aead304..29d5a2e 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs8Tests.java >@@ -155,6 +155,7 @@ > suite.addTest(new JavaSearchBugs8Tests("testBug400905_0028")); > suite.addTest(new JavaSearchBugs8Tests("testBug400905_0029")); > suite.addTest(new JavaSearchBugs8Tests("testBug400905_0030")); >+ suite.addTest(new JavaSearchBugs8Tests("testBug429738")); > return suite; > } > class TestCollector extends JavaSearchResultCollector { >@@ -3530,6 +3531,34 @@ > search(this.workingCopies[0].getType("Y").getType("Z").getMethod("goo", new String[] { "I" }), IMPLICIT_THIS_REFERENCE); > assertSearchResults(""); > } >+/** >+ * @bug 429738 >+ * @test test finds Declarations (Ctrl + G) for type-less lambda parameter. >+ * >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=429738" >+ * >+ */ >+public void testBug429738() throws CoreException { >+ String buffer = "interface Foo {\n" + >+ " int foo(int x);\n" + >+ "}\n" + >+ "public class X {\n" + >+ " // Select 'x' and press Ctrl+G.\n" + >+ " Foo f1 = x -> x;\n" + >+ "}\n"; >+ >+ this.workingCopies = new ICompilationUnit[1]; >+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b429738/X.java", buffer); >+ IType type = this.workingCopies[0].getType("X"); >+ int start = buffer.indexOf("x;"); >+ IJavaElement[] elements = this.workingCopies[0].codeSelect(start, 1); >+ assertEquals("Incorrect no of elements", 1, elements.length); >+ assertEquals("Incorrect element type", IJavaElement.LOCAL_VARIABLE, elements[0].getElementType()); >+ search(elements[0],DECLARATIONS); >+ assertSearchResults( >+ "src/b429738/X.java int b429738.X.f1:Lambda(Foo).foo(int).x [x] EXACT_MATCH" >+ ); >+} > // Add new tests in JavaSearchBugs8Tests > } > >diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >index 0cacc7b..722f7d7 100644 >--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >@@ -665,6 +665,11 @@ > } > } > >+protected void consumeTypeElidedLambdaParameter(boolean parenthesized) { >+ super.consumeTypeElidedLambdaParameter(parenthesized); >+ this.patternLocator.match((LocalDeclaration) this.astStack[this.astPtr], this.nodeSet); >+} >+ > protected void consumeTypeParameter1WithExtends() { > super.consumeTypeParameter1WithExtends(); > if ((this.patternFineGrain & IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE) != 0) {
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 429738
:
240592
| 240596