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 233193 Details for
Bug 410114
[1.8] CCE when trying to parse method reference expression with inappropriate type arguments
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 fix + Test
Fix-for-bug-410114.patch (text/plain), 3.24 KB, created by
Jay Arthanareeswaran
on 2013-07-08 02:09:53 EDT
(
hide
)
Description:
Proposed fix + Test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2013-07-08 02:09:53 EDT
Size:
3.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >diff --git src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >index 0b00f62..218caf4 100644 >--- src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java >@@ -22,4 +22,5 @@ > package org.eclipse.jdt.core.tests.compiler.regression; > >+import java.io.IOException; > import java.util.Map; > >@@ -6663,4 +6664,32 @@ > ); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=410114, [1.8] CCE when trying to parse method reference expression with inappropriate type arguments >+public void test410114() throws IOException { >+ String source = "interface I {\n" + >+ " void foo(Y<String> y);\n" + >+ "}\n" + >+ "public class Y<T> {\n" + >+ " class Z<K> {\n" + >+ " Z(Y<String> y) {\n" + >+ " System.out.println(\"Y<T>.Z<K>:: new\");\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " I i = Y<String>.Z<Integer>::<String> new;\n" + >+ " i.foo(new Y<String>());\n" + >+ " i = Y<String>.Z<Integer>:: new;\n" + >+ " i.foo(new Y<String>());\n" + >+ " }\n" + >+ " }\n" + >+ "}\n"; >+ this.runNegativeTest( >+ new String[]{"Y.java", >+ source}, >+ "----------\n" + >+ "1. WARNING in Y.java (at line 10)\n" + >+ " I i = Y<String>.Z<Integer>::<String> new;\n" + >+ " ^^^^^^\n" + >+ "Unused type arguments for the non generic constructor Y<String>.Z<Integer>(Y<String>) of type Y<String>.Z<Integer>; it should not be parameterized with arguments <String>\n" + >+ "----------\n"); >+} > public static Class testClass() { > return NegativeLambdaExpressionsTest.class; >#P org.eclipse.jdt.core >diff --git compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >index ee461e6..1fdae07 100644 >--- compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java >@@ -41,4 +41,5 @@ > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.NestedTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; >@@ -117,5 +118,10 @@ > ReferenceBinding[] enclosingInstances = Binding.UNINITIALIZED_REFERENCE_TYPES; > if (this.receiverType.isNestedType()) { >- NestedTypeBinding nestedType = (NestedTypeBinding) this.receiverType; >+ NestedTypeBinding nestedType = null; >+ if (this.receiverType instanceof ParameterizedTypeBinding) { >+ nestedType = (NestedTypeBinding)((ParameterizedTypeBinding) this.receiverType).genericType(); >+ } else { >+ nestedType = (NestedTypeBinding) this.receiverType; >+ } > if ((enclosingInstances = nestedType.syntheticEnclosingInstanceTypes()) != null) { > int length = enclosingInstances.length;
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 410114
: 233193