diff options
author | ssankaran | 2014-10-26 23:54:53 +0000 |
---|---|---|
committer | ssankaran | 2014-10-26 23:54:53 +0000 |
commit | 35a336ae4dee8fe75706ce1a1ce1cfa86d2ad222 (patch) | |
tree | bd0c8dd3455d158251c31911d32860fa064372fe /org.eclipse.jdt.core.tests.compiler | |
parent | b00fa1db92208aba25130872792b5257a8a769b0 (diff) | |
download | eclipse.jdt.core-35a336ae4dee8fe75706ce1a1ce1cfa86d2ad222.tar.gz eclipse.jdt.core-35a336ae4dee8fe75706ce1a1ce1cfa86d2ad222.tar.xz eclipse.jdt.core-35a336ae4dee8fe75706ce1a1ce1cfa86d2ad222.zip |
Fixed Bug 440019 - [1.8][compiler] Type mismatch error with
autoboxing/scalar types (works with 1.6)
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler')
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java index ab233ba941..162e14aa86 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java @@ -5471,7 +5471,6 @@ public void test444024() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=440019, [1.8][compiler] Type mismatch error with autoboxing/scalar types (works with 1.6) public void test440019() { - if (this.complianceLevel <= ClassFileConstants.JDK1_7) this.runConformTest( new String[] { "A.java", @@ -5509,5 +5508,44 @@ public void _test443596() { "Type safety: Potential heap pollution via varargs parameter arg\n" + "----------\n"); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=446235, Java8 generics and boxing +public void test446235() { + this.runConformTest( + new String[] { + "IntegerLongBug.java", + "public class IntegerLongBug {\n" + + " public static void main(String ar[]) {\n" + + " Integer number = 1000;\n" + + " long numberLong = number; //compiles fine\n" + + " long num = getNumber(5000); // compilation error\n" + + " }\n" + + " public static <T> T getNumber(T num) {\n" + + " return num;\n" + + " }\n" + + "}\n", + }, + ""); +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=440019, [1.8][compiler] Type mismatch error with autoboxing/scalar types (works with 1.6) +public void test440019_c9() { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public static final int CORE_POOL_SIZE = 3;\n" + + " public static final int KEEP_ALIVE_TIME = 60; // seconds\n" + + " X(final int size, final long ttl){\n" + + " System.out.println(\"size: \" + size + \" \" + \" ttl: \" + ttl);\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " new X(CORE_POOL_SIZE, get(KEEP_ALIVE_TIME)); // [1]\n" + + " }\n" + + " public static <T> T get(T value) {\n" + + " return value;\n" + + " }\n" + + "}\n", + }, + "size: 3 ttl: 60"); +} } |