Failed
org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest.testBug486912PotNullInLoop - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
testBug486912PotNullInLoop - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in test\PotNullInLoop.java (at line 13)\n potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 2. ERROR in test\PotNullInLoop.java (at line 24)\n potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 3. ERROR in test\PotNullInLoop.java (at line 36)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 4. ERROR in test\PotNullInLoop.java (at line 47)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 5. ERROR in test\PotNullInLoop.java (at line 58)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in test\PotNullInLoop.java (at line 13)\n potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 2. ERROR in test\PotNullInLoop.java (at line 24)\n potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 3. ERROR in test\PotNullInLoop.java (at line 36)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 4. ERROR in test\PotNullInLoop.java (at line 47)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 5. ERROR in test\PotNullInLoop.java (at line 58)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n ]>
Stacktrace
junit.framework.ComparisonFailure: testBug486912PotNullInLoop - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in test\PotNullInLoop.java (at line 13)\n potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 2. ERROR in test\PotNullInLoop.java (at line 24)\n potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 3. ERROR in test\PotNullInLoop.java (at line 36)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 4. ERROR in test\PotNullInLoop.java (at line 47)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 5. ERROR in test\PotNullInLoop.java (at line 58)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in test\PotNullInLoop.java (at line 13)\n potNull.hashCode(); // ERROR 1: pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 2. ERROR in test\PotNullInLoop.java (at line 24)\n potNull.hashCode(); // ERROR 3 : pot null, but nothing reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 3. ERROR in test\PotNullInLoop.java (at line 36)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 4. ERROR in test\PotNullInLoop.java (at line 47)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n 5. ERROR in test\PotNullInLoop.java (at line 58)\n potNull.hashCode(); // OK: pot null, is reported\n ^^^^^^^\n Potential null pointer access: The variable potNull may be null at this location\n ----------\n ]> at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:260) at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:236) at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runJavac(AbstractRegressionTest.java:2044) at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2814) at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2539) at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2113) at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2102) at org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest.testBug486912PotNullInLoop(NullReferenceTest.java:17882)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest#testBug486912PotNullInLoop - 1.8 test/PotNullInLoop.java [ package test; public class PotNullInLoop { boolean b; public void testDoWhile1(Object o0) { Object o1 = null; Object o2 = new Object(); Object potNonNull = b ? o2 : o0; Object potNull = b ? o1 : o0; do { potNonNull.hashCode(); // OK potNull.hashCode(); // ERROR 1: pot null, but nothing reported } while (false); } public void testWhileWithBreak(Object o0) { Object o1 = null; Object o2 = new Object(); Object potNonNull = b ? o2 : o0; Object potNull = b ? o1 : o0; while (b) { potNonNull.hashCode(); // OK potNull.hashCode(); // ERROR 3 : pot null, but nothing reported break; } } public void testWhile(Object o0) { Object o1 = null; Object o2 = new Object(); Object potNonNull = b ? o2 : o0; Object potNull = b ? o1 : o0; while (b) { potNonNull.hashCode(); // OK potNull.hashCode(); // OK: pot null, is reported } } public void testFor(Object o0) { Object o1 = null; Object o2 = new Object(); Object potNonNull = b ? o2 : o0; Object potNull = b ? o1 : o0; for (int i = 0; i < 1; i++) { potNonNull.hashCode(); // OK potNull.hashCode(); // OK: pot null, is reported } } public void testForEach(Object o0) { Object o1 = null; Object o2 = new Object(); Object potNonNull = b ? o2 : o0; Object potNull = b ? o1 : o0; for (int i = 0; i < 1; i++) { potNonNull.hashCode(); // OK potNull.hashCode(); // OK: pot null, is reported } } } ] Full results sent to /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.txt
Standard Error
----------------------------------------