Failed
org.eclipse.jdt.core.tests.compiler.regression.ProgrammingProblemsTest.testBug410218a - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
testBug410218a - Eclipse found warning(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. WARNING in X.java (at line 8)\n if (set.contains("ONE")) // bad\n ^^^^^\n Unlikely argument type String for contains(Object) on a Collection<Short>\n ----------\n 2. WARNING in X.java (at line 9)\n set.remove("ONE"); // bad\n ^^^^^\n Unlikely argument type String for remove(Object) on a Collection<Short>\n ----------\n 3. WARNING in X.java (at line 10)\n if (set.contains(1)) // bad\n ^\n Unlikely argument type int for contains(Object) on a Collection<Short>\n ----------\n 4. WARNING in X.java (at line 11)\n set.remove(1); // bad (tries to remove "Integer 1")\n ^\n Unlikely argument type int for remove(Object) on a Collection<Short>\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. WARNING in X.java (at line 8)\n if (set.contains("ONE")) // bad\n ^^^^^\n Unlikely argument type String for contains(Object) on a Collection<Short>\n ----------\n 2. WARNING in X.java (at line 9)\n set.remove("ONE"); // bad\n ^^^^^\n Unlikely argument type String for remove(Object) on a Collection<Short>\n ----------\n 3. WARNING in X.java (at line 10)\n if (set.contains(1)) // bad\n ^\n Unlikely argument type int for contains(Object) on a Collection<Short>\n ----------\n 4. WARNING in X.java (at line 11)\n set.remove(1); // bad (tries to remove "Integer 1")\n ^\n Unlikely argument type int for remove(Object) on a Collection<Short>\n ----------\n ]>
Stacktrace
junit.framework.ComparisonFailure: testBug410218a - Eclipse found warning(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. WARNING in X.java (at line 8)\n if (set.contains("ONE")) // bad\n ^^^^^\n Unlikely argument type String for contains(Object) on a Collection<Short>\n ----------\n 2. WARNING in X.java (at line 9)\n set.remove("ONE"); // bad\n ^^^^^\n Unlikely argument type String for remove(Object) on a Collection<Short>\n ----------\n 3. WARNING in X.java (at line 10)\n if (set.contains(1)) // bad\n ^\n Unlikely argument type int for contains(Object) on a Collection<Short>\n ----------\n 4. WARNING in X.java (at line 11)\n set.remove(1); // bad (tries to remove "Integer 1")\n ^\n Unlikely argument type int for remove(Object) on a Collection<Short>\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. WARNING in X.java (at line 8)\n if (set.contains("ONE")) // bad\n ^^^^^\n Unlikely argument type String for contains(Object) on a Collection<Short>\n ----------\n 2. WARNING in X.java (at line 9)\n set.remove("ONE"); // bad\n ^^^^^\n Unlikely argument type String for remove(Object) on a Collection<Short>\n ----------\n 3. WARNING in X.java (at line 10)\n if (set.contains(1)) // bad\n ^\n Unlikely argument type int for contains(Object) on a Collection<Short>\n ----------\n 4. WARNING in X.java (at line 11)\n set.remove(1); // bad (tries to remove "Integer 1")\n ^\n Unlikely argument type int for remove(Object) on a Collection<Short>\n ----------\n ]> at org.eclipse.jdt.core.tests.compiler.regression.ProgrammingProblemsTest.testBug410218a(ProgrammingProblemsTest.java:2714)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.ProgrammingProblemsTest#testBug410218a - 1.8 X.java [ import java.util.*; class X { void test() { Set<Short> set = new HashSet<Short>(); short one = 1; set.add(one); if (set.contains("ONE")) // bad set.remove("ONE"); // bad if (set.contains(1)) // bad set.remove(1); // bad (tries to remove "Integer 1") System.out.println(set); // shows that the "Short 1" is still in! if (set.contains(one)) // ok set.remove(one); // ok if (set.contains(Short.valueOf(one))) // ok set.remove(Short.valueOf(one)); // ok System.out.println(set); } } ] Full results sent to /home/jenkins/agent/workspace/eclipse.jdt.core-run.javac-1.8/tmp/comptest/run.1584479137560/1.8.0_202_20200317_210541.txt
Standard Error
----------------------------------------