Failed

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

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

Error Message

test056k - Eclipse found error(s) but Javac did not find any.
----------- Expected ------------

------------ but was ------------
----------\n
1. ERROR in X.java (at line 12)\n
 FileReader ra1 = null, ra2 = null;\n
            ^^^\n
Resource 'ra1' should be managed by try-with-resource\n
----------\n
2. ERROR in X.java (at line 15)\n
 ra2 = new FileReader(file);\n
 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'ra2' is never closed\n
----------\n
3. ERROR in X.java (at line 16)\n
 FileReader ra3 = new FileReader(file);\n
            ^^^\n
Resource 'ra3' should be managed by try-with-resource\n
----------\n
4. ERROR in X.java (at line 25)\n
 FileReader rb1 = null, rb2 = null;\n
            ^^^\n
Resource 'rb1' should be managed by try-with-resource\n
----------\n
5. ERROR in X.java (at line 28)\n
 rb2 = new FileReader(file);\n
 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'rb2' is never closed\n
----------\n
6. ERROR in X.java (at line 29)\n
 FileReader rb3 = new FileReader(file);\n
            ^^^\n
Resource 'rb3' should be managed by try-with-resource\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 12)\n
 FileReader ra1 = null, ra2 = null;\n
            ^^^\n
Resource 'ra1' should be managed by try-with-resource\n
----------\n
2. ERROR in X.java (at line 15)\n
 ra2 = new FileReader(file);\n
 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'ra2' is never closed\n
----------\n
3. ERROR in X.java (at line 16)\n
 FileReader ra3 = new FileReader(file);\n
            ^^^\n
Resource 'ra3' should be managed by try-with-resource\n
----------\n
4. ERROR in X.java (at line 25)\n
 FileReader rb1 = null, rb2 = null;\n
            ^^^\n
Resource 'rb1' should be managed by try-with-resource\n
----------\n
5. ERROR in X.java (at line 28)\n
 rb2 = new FileReader(file);\n
 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'rb2' is never closed\n
----------\n
6. ERROR in X.java (at line 29)\n
 FileReader rb3 = new FileReader(file);\n
            ^^^\n
Resource 'rb3' should be managed by try-with-resource\n
----------\n
]>

Stacktrace

junit.framework.ComparisonFailure: test056k - Eclipse found error(s) but Javac did not find any.
----------- Expected ------------

------------ but was ------------
----------\n
1. ERROR in X.java (at line 12)\n
	FileReader ra1 = null, ra2 = null;\n
	           ^^^\n
Resource 'ra1' should be managed by try-with-resource\n
----------\n
2. ERROR in X.java (at line 15)\n
	ra2 = new FileReader(file);\n
	^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'ra2' is never closed\n
----------\n
3. ERROR in X.java (at line 16)\n
	FileReader ra3 = new FileReader(file);\n
	           ^^^\n
Resource 'ra3' should be managed by try-with-resource\n
----------\n
4. ERROR in X.java (at line 25)\n
	FileReader rb1 = null, rb2 = null;\n
	           ^^^\n
Resource 'rb1' should be managed by try-with-resource\n
----------\n
5. ERROR in X.java (at line 28)\n
	rb2 = new FileReader(file);\n
	^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'rb2' is never closed\n
----------\n
6. ERROR in X.java (at line 29)\n
	FileReader rb3 = new FileReader(file);\n
	           ^^^\n
Resource 'rb3' should be managed by try-with-resource\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 12)\n
	FileReader ra1 = null, ra2 = null;\n
	           ^^^\n
Resource 'ra1' should be managed by try-with-resource\n
----------\n
2. ERROR in X.java (at line 15)\n
	ra2 = new FileReader(file);\n
	^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'ra2' is never closed\n
----------\n
3. ERROR in X.java (at line 16)\n
	FileReader ra3 = new FileReader(file);\n
	           ^^^\n
Resource 'ra3' should be managed by try-with-resource\n
----------\n
4. ERROR in X.java (at line 25)\n
	FileReader rb1 = null, rb2 = null;\n
	           ^^^\n
Resource 'rb1' should be managed by try-with-resource\n
----------\n
5. ERROR in X.java (at line 28)\n
	rb2 = new FileReader(file);\n
	^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Resource leak: 'rb2' is never closed\n
----------\n
6. ERROR in X.java (at line 29)\n
	FileReader rb3 = new FileReader(file);\n
	           ^^^\n
Resource 'rb3' should be managed by try-with-resource\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:2220)
	at org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.test056k(ResourceLeakTests.java:782)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#test056k - 1.8
X.java [
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class X {
    void foo() throws IOException {
        int i01, i02, i03, i04, i05, i06, i07, i08, i09,
            i11, i12, i13, i14, i15, i16, i17, i18, i19,
            i21, i22, i23, i24, i25, i26, i27, i28, i29,
            i31, i32, i33, i34, i35, i36, i37, i38, i39,
            i41, i42, i43, i44, i45, i46, i47, i48, i49;
        File file = new File("somefile");
        FileReader ra1 = null, ra2 = null;
        try {
            ra1 = new FileReader(file);
            ra2 = new FileReader(file);
            FileReader ra3 = new FileReader(file);
            char[] in = new char[50];
            ra1.read(in);
            ra2.read(in);
            ra3.close();
        } finally {
            ra1.close();
        }
        int i51, i52, i53, i54, i55, i56, i57, i58, i59, i60;
        FileReader rb1 = null, rb2 = null;
        try {
            rb1 = new FileReader(file);
            rb2 = new FileReader(file);
            FileReader rb3 = new FileReader(file);
            char[] in = new char[50];
            rb1.read(in);
            rb2.read(in);
            rb3.close();
        } finally {
            rb1.close();
        }
    }
    public static void main(String[] args) throws IOException {
        new X().foo();
    }
}

]


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

Standard Error

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