Failed

org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest.test358827 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 4 builds (Since #6 )
Took 0.63 sec.

Error Message

test358827 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in Bug358827.java (at line 6)\n
 o = o.toUpperCase();\n
     ^\n
Null pointer access: The variable o can only be null at this location\n
----------\n

------------ but was ------------
Bug358827.java:5: warning: [try] auto-closeable resource rf is never referenced in body of corresponding try statement\n
  try (FileReader rf = new FileReader("file")){\n
                  ^\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in Bug358827.java (at line 6)\n
 o = o.toUpperCase();\n
     ^\n
Null pointer access: The variable o can only be null at this location\n
----------]\n
> but was:<[Bug358827.java:5: warning: [try] auto-closeable resource rf is never referenced in body of corresponding try statement\n
  try (FileReader rf = new FileReader("file")){\n
                  ^\n
1 warning]\n
>

Stacktrace

junit.framework.ComparisonFailure: test358827 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in Bug358827.java (at line 6)\n
	o = o.toUpperCase();\n
	    ^\n
Null pointer access: The variable o can only be null at this location\n
----------\n

------------ but was ------------
Bug358827.java:5: warning: [try] auto-closeable resource rf is never referenced in body of corresponding try statement\n
		try (FileReader rf = new FileReader("file")){\n
		                ^\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in Bug358827.java (at line 6)\n
	o = o.toUpperCase();\n
	    ^\n
Null pointer access: The variable o can only be null at this location\n
----------]\n
> but was:<[Bug358827.java:5: warning: [try] auto-closeable resource rf is never referenced in body of corresponding try statement\n
		try (FileReader rf = new FileReader("file")){\n
		                ^\n
1 warning]\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:2048)
	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.test358827(NullReferenceTest.java:15820)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest#test358827 - 1.8
Bug358827.java [
import java.io.FileReader;
public class Bug358827 {
	Object foo2() throws Exception {
		String o = null;
		try (FileReader rf = new FileReader("file")){
			o = o.toUpperCase();
		} finally {
			o = "OK";
		}
		return o;
	}
}

]


Full results sent to /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.txt

Standard Error

--- javac err: ---
Bug358827.java:5: warning: [try] auto-closeable resource rf is never referenced in body of corresponding try statement
		try (FileReader rf = new FileReader("file")){
		                ^
1 warning

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