Failed

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

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

Error Message

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

------------ but was ------------
----------\n
1. ERROR in X.java (at line 26)\n
 InputStream stream3  = new FileInputStream(file);\n
             ^^^^^^^\n
Resource leak: 'stream3' is never closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 26)\n
 InputStream stream3  = new FileInputStream(file);\n
             ^^^^^^^\n
Resource leak: 'stream3' is never closed\n
----------\n
]>

Stacktrace

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

------------ but was ------------
----------\n
1. ERROR in X.java (at line 26)\n
	InputStream stream3  = new FileInputStream(file);\n
	            ^^^^^^^\n
Resource leak: 'stream3' is never closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 26)\n
	InputStream stream3  = new FileInputStream(file);\n
	            ^^^^^^^\n
Resource leak: 'stream3' is never closed\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.test061i(ResourceLeakTests.java:2323)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#test061i - 1.8
X.java [
import java.io.File;
import java.io.InputStream;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class X {
    void closeMiddle() throws IOException {
        File file = new File("somefile");
        InputStream stream  = new FileInputStream(file);
        stream = new BufferedInputStream(stream);
        InputStream middle;
        stream = new BufferedInputStream(middle = stream);
        System.out.println(stream.available());
        middle.close();
    }
    void closeOuter() throws IOException {
        File file = new File("somefile");
        InputStream stream2  = new FileInputStream(file);
        stream2 = new BufferedInputStream(stream2);
        stream2 = new BufferedInputStream(stream2);
        System.out.println(stream2.available());
        stream2.close();
    }
    void neverClosed() throws IOException {
        File file = new File("somefile");
        InputStream stream3  = new FileInputStream(file);
        stream3 = new BufferedInputStream(stream3);
        stream3 = new BufferedInputStream(stream3);
        System.out.println(stream3.available());
    }
}

]


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

Standard Error

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