Failed

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.test056u - 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

test056u - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 5)\n
 FileReader reader2 = new FileReader("file2");\n
            ^^^^^^^\n
Resource leak: 'reader2' is never closed\n
----------\n
2. ERROR in X.java (at line 13)\n
 reader2 = reader1; // warning 1 regarding original reader1\n
 ^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n
3. ERROR in X.java (at line 14)\n
 reader2 = reader1; // warning 2 regarding original reader1\n
 ^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n

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

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 5)\n
 FileReader reader2 = new FileReader("file2");\n
            ^^^^^^^\n
Resource leak: 'reader2' is never closed\n
----------\n
2. ERROR in X.java (at line 13)\n
 reader2 = reader1; // warning 1 regarding original reader1\n
 ^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n
3. ERROR in X.java (at line 14)\n
 reader2 = reader1; // warning 2 regarding original reader1\n
 ^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------]\n
> but was:<[X.java:7: warning: [try] auto-closeable resource reader3 is never referenced in body of corresponding try statement\n
        try (FileReader reader3 = new FileReader("file3")) {\n
                        ^\n
1 warning]\n
>

Stacktrace

junit.framework.ComparisonFailure: test056u - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 5)\n
	FileReader reader2 = new FileReader("file2");\n
	           ^^^^^^^\n
Resource leak: 'reader2' is never closed\n
----------\n
2. ERROR in X.java (at line 13)\n
	reader2 = reader1; // warning 1 regarding original reader1\n
	^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n
3. ERROR in X.java (at line 14)\n
	reader2 = reader1; // warning 2 regarding original reader1\n
	^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n

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

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 5)\n
	FileReader reader2 = new FileReader("file2");\n
	           ^^^^^^^\n
Resource leak: 'reader2' is never closed\n
----------\n
2. ERROR in X.java (at line 13)\n
	reader2 = reader1; // warning 1 regarding original reader1\n
	^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------\n
3. ERROR in X.java (at line 14)\n
	reader2 = reader1; // warning 2 regarding original reader1\n
	^^^^^^^^^^^^^^^^^\n
Resource leak: 'reader1' is not closed at this location\n
----------]\n
> but was:<[X.java:7: warning: [try] auto-closeable resource reader3 is never referenced in body of corresponding try statement\n
        try (FileReader reader3 = new FileReader("file3")) {\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.test056u(ResourceLeakTests.java:1264)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#test056u - 1.8
X.java [
import java.io.FileReader;
public class X {
    void foo() throws Exception {
        FileReader reader1 = new FileReader("file1");
        FileReader reader2 = new FileReader("file2");
        reader2 = reader1;// this disconnects reader 2
        try (FileReader reader3 = new FileReader("file3")) {
            int ch;
            while ((ch = reader2.read()) != -1) {
                System.out.println(ch);
                reader1.read();
            }
            reader2 = reader1; // warning 1 regarding original reader1
            reader2 = reader1; // warning 2 regarding original reader1
        } finally {
            if (reader2 != null) {
                reader2.close();
            } else {
                System.out.println();
            }
        }
    }
}

]


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

Standard Error

--- javac err: ---
X.java:7: warning: [try] auto-closeable resource reader3 is never referenced in body of corresponding try statement
        try (FileReader reader3 = new FileReader("file3")) {
                        ^
1 warning

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