Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2017-02-07 21:49:36 +0000
committerStephan Herrmann2017-02-09 20:34:27 +0000
commitcfdc0dce23c7f97f14043ba7d392dd3c94976fd4 (patch)
tree6ffa7749b263779172db05314cbebcab177dad23 /org.eclipse.jdt.core.tests.model
parent6f9e0bed6f91652da2850054c4e18b1822182312 (diff)
downloadeclipse.jdt.core-cfdc0dce23c7f97f14043ba7d392dd3c94976fd4.tar.gz
eclipse.jdt.core-cfdc0dce23c7f97f14043ba7d392dd3c94976fd4.tar.xz
eclipse.jdt.core-cfdc0dce23c7f97f14043ba7d392dd3c94976fd4.zip
Bug 510111: [compiler][inference] Type mismatch on lambda with wildcards
Change-Id: Ie7b1e81bc2587b361fa9c4d093097661743fd6b4 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
Diffstat (limited to 'org.eclipse.jdt.core.tests.model')
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
index cd25621ad2..76cd5c1bb7 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests18.java
@@ -2189,7 +2189,7 @@ public void test428968() throws JavaModelException {
IJavaElement[] elements = this.wc.codeSelect(start, length);
assertElementsEqual(
"Unexpected elements",
- "comparing(java.util.function.Function<? super T,? extends U>) {key=Ljava/util/Comparator<>;.comparing<T:Ljava/lang/Object;U::Ljava/lang/Comparable<-TU;>;>(Ljava/util/function/Function<-TT;+TU;>;)Ljava/util/Comparator<TT;>;%<LX~Person;^{260#0};>} [in Comparator [in Comparator.class [in java.util [in "+ getExternalPath() + "jclFull1.8.jar]]]]",
+ "comparing(java.util.function.Function<? super T,? extends U>) {key=Ljava/util/Comparator<>;.comparing<T:Ljava/lang/Object;U::Ljava/lang/Comparable<-TU;>;>(Ljava/util/function/Function<-TT;+TU;>;)Ljava/util/Comparator<TT;>;%<LX~Person;Ljava/lang/String;>} [in Comparator [in Comparator.class [in java.util [in "+ getExternalPath() + "jclFull1.8.jar]]]]",
elements, true
);
}
@@ -2225,6 +2225,32 @@ public void test428968a() throws JavaModelException {
elements, true
);
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=428968, [1.8] NPE while computing a text hover
+public void test428968b() throws JavaModelException {
+ this.wc = getWorkingCopy(
+ "/Resolve/src/X.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.Collections;\n" +
+ "import java.util.Comparator;\n" +
+ "import java.util.List;\n" +
+ "public class X {\n" +
+ " private void foo() {\n" +
+ " Comparator.reverseOrder();\n" +
+ " }\n" +
+ "}\n");
+
+ String str = this.wc.getSource();
+ String selection = "reverseOrder";
+ int start = str.lastIndexOf(selection);
+ int length = selection.length();
+
+ IJavaElement[] elements = this.wc.codeSelect(start, length);
+ assertElementsEqual(
+ "Unexpected elements",
+ "reverseOrder() {key=Ljava/util/Comparator<>;.reverseOrder<T::Ljava/lang/Comparable<-TT;>;>()Ljava/util/Comparator<TT;>;%<^{175#0};>} [in Comparator [in Comparator.class [in java.util [in "+ getExternalPath() + "jclFull1.8.jar]]]]",
+ elements, true
+ );
+}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=425064, [1.8][compiler] NPE in CaptureBinding.computeUniqueKey
public void test425064() throws JavaModelException {
this.wc = getWorkingCopy(

Back to the top