81923
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
index 4924ba7..0c84d27 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java
@@ -1984,39 +1984,8 @@
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
"----------\n");
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82432 - variation
- public void test077() {
- this.runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " Object e() {\n" +
- " int i = 12; \n" +
- " boolean b = false;\n" +
- " switch(i) {\n" +
- " case 0: return i > 0;\n" +
- " case 1: return i >= 0;\n" +
- " case 2: return i < 0;\n" +
- " case 3: return i <= 0;\n" +
- " case 4: return i == 0;\n" +
- " case 5: return i != 0;\n" +
- " case 6: return i & 0;\n" +
- " case 7: return i ^ 0;\n" +
- " case 8: return i | 0;\n" +
- " case 9: return b && b;\n" +
- " default: return b || b;\n" +
- " }\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " System.out.print(new X().e());\n" +
- " }\n" +
- "}",
- },
- "false");
- }
-
+ }
+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82432 - variation
public void test076() {
this.runNegativeTest(
@@ -2107,5 +2076,57 @@
" ^^^^\n" +
"Zork cannot be resolved to a type\n" +
"----------\n");
- }
+ }
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=82432 - variation
+ public void test077() {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " Object e() {\n" +
+ " int i = 12; \n" +
+ " boolean b = false;\n" +
+ " switch(i) {\n" +
+ " case 0: return i > 0;\n" +
+ " case 1: return i >= 0;\n" +
+ " case 2: return i < 0;\n" +
+ " case 3: return i <= 0;\n" +
+ " case 4: return i == 0;\n" +
+ " case 5: return i != 0;\n" +
+ " case 6: return i & 0;\n" +
+ " case 7: return i ^ 0;\n" +
+ " case 8: return i | 0;\n" +
+ " case 9: return b && b;\n" +
+ " default: return b || b;\n" +
+ " }\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.print(new X().e());\n" +
+ " }\n" +
+ "}",
+ },
+ "false");
+ }
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81923
+ public void test078() {
+ this.runConformTest(
+ new String[] {
+ "X.java",
+ "public class X<T> {\n" +
+ " public <A extends T> X(A... t) {}\n" +
+ " <T> void foo(T... t) {}\n" +
+ " <T> void zip(T t) {}\n" +
+ " void test() {\n" +
+ " new X<Integer>(10, 20);\n" +
+ " foo(10);\n" +
+ " foo(10, 20);\n" +
+ " zip(10);\n" +
+ " }\n" +
+ "}\n"
+ },
+ ""
+ );
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index f75a89e..322565c 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -61,7 +61,9 @@
</ul>
<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=82250">82250</a>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=81923">81923</a>
+In certain cases generics seens to be applied before autoboxing
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=82250">82250</a>
[5.0] don't allow duplicate interface bounds
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=82432">82432</a>
[1.5] VerifyError with Autoboxing
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index a93b515..1ad5e5a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -167,6 +167,19 @@
return null; // incompatible
if (typeVariables != NoTypeVariables) { // generic method
+ TypeBinding[] newArgs = null;
+ for (int i = 0; i < argLength; i++) {
+ TypeBinding param = i < paramLength ? parameters[i] : parameters[paramLength - 1];
+ if (arguments[i].isBaseType() != param.isBaseType()) {
+ if (newArgs == null) {
+ newArgs = new TypeBinding[argLength];
+ System.arraycopy(arguments, 0, newArgs, 0, argLength);
+ }
+ newArgs[i] = environment().computeBoxingType(arguments[i]);
+ }
+ }
+ if (newArgs != null)
+ arguments = newArgs;
method = ParameterizedGenericMethodBinding.computeCompatibleMethod(method, arguments, this, invocationSite);
if (method == null) return null; // incompatible
if (!method.isValidBinding()) return method; // bound check issue is taking precedence