Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.ProgrammingProblemsTest.testBug410218a - 10 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 22 builds (Since #111 )
Took 1.2 sec.

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 - 10
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 /tmp/comptest/run.1584245034298/10.0.2_20200315_040443.txt

Standard Error

----------------------------------------