Failed

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.testBug411098_test2 - 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_test2 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in A.java (at line 4)\n
 try(FileInputStream in = create(new FileInputStream("a"))){}\n
                                 ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: '<unassigned Closeable value>' may not be closed\n
----------\n

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

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in A.java (at line 4)\n
 try(FileInputStream in = create(new FileInputStream("a"))){}\n
                                 ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: '<unassigned Closeable value>' may not be closed\n
----------]\n
> but was:<[A.java:4: warning: [try] auto-closeable resource in is never referenced in body of corresponding try statement\n
    try(FileInputStream in = create(new FileInputStream("a"))){}\n
                        ^\n
1 warning]\n
>

Stacktrace

junit.framework.ComparisonFailure: testBug411098_test2 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in A.java (at line 4)\n
	try(FileInputStream in = create(new FileInputStream("a"))){}\n
	                                ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: '<unassigned Closeable value>' may not be closed\n
----------\n

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

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in A.java (at line 4)\n
	try(FileInputStream in = create(new FileInputStream("a"))){}\n
	                                ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: '<unassigned Closeable value>' may not be closed\n
----------]\n
> but was:<[A.java:4: warning: [try] auto-closeable resource in is never referenced in body of corresponding try statement\n
    try(FileInputStream in = create(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_test2(ResourceLeakTests.java:4514)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#testBug411098_test2 - 1.8
A.java [
import java.io.*;
class A {
  void a(boolean b) throws Exception {
    try(FileInputStream in = create(new FileInputStream("a"))){}
  }
  FileInputStream create(FileInputStream ignored) throws IOException {
    return new FileInputStream("b"); 
  }
}
]


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 in is never referenced in body of corresponding try statement
    try(FileInputStream in = create(new FileInputStream("a"))){}
                        ^
1 warning

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