Failed

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.testBug411098_test3 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

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

Error Message

testBug411098_test3 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in A.java (at line 5)\n
 FileInputStream b = new FileInputStream("B");\n
                 ^\n
Resource leak: 'b' is never closed\n
----------\n

------------ but was ------------
A.java:4: warning: [try] auto-closeable resource a is never referenced in body of corresponding try statement\n
  try (FileInputStream a = new FileInputStream("A") {{\n
                       ^\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in A.java (at line 5)\n
 FileInputStream b = new FileInputStream("B");\n
                 ^\n
Resource leak: 'b' is never closed\n
----------]\n
> but was:<[A.java:4: warning: [try] auto-closeable resource a is never referenced in body of corresponding try statement\n
  try (FileInputStream a = new FileInputStream("A") {{\n
                       ^\n
1 warning]\n
>

Stacktrace

junit.framework.ComparisonFailure: testBug411098_test3 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in A.java (at line 5)\n
	FileInputStream b = new FileInputStream("B");\n
	                ^\n
Resource leak: 'b' is never closed\n
----------\n

------------ but was ------------
A.java:4: warning: [try] auto-closeable resource a is never referenced in body of corresponding try statement\n
		try (FileInputStream a = new FileInputStream("A") {{\n
		                     ^\n
1 warning\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in A.java (at line 5)\n
	FileInputStream b = new FileInputStream("B");\n
	                ^\n
Resource leak: 'b' is never closed\n
----------]\n
> but was:<[A.java:4: warning: [try] auto-closeable resource a is never referenced in body of corresponding try statement\n
		try (FileInputStream a = new FileInputStream("A") {{\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:2220)
	at org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.testBug411098_test3(ResourceLeakTests.java:4545)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#testBug411098_test3 - 1.8
A.java [
import java.io.*;
class A {
	void m() throws IOException {
		try (FileInputStream a = new FileInputStream("A") {{
				FileInputStream b = new FileInputStream("B");
				b.hashCode();
			}}){
		}
	}
}
]


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

Standard Error

--- javac err: ---
A.java:4: warning: [try] auto-closeable resource a is never referenced in body of corresponding try statement
		try (FileInputStream a = new FileInputStream("A") {{
		                     ^
1 warning

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