Failed

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

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

Error Message

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

------------ but was ------------
----------\n
1. ERROR in X.java (at line 7)\n
 FileInputStream stream = new FileInputStream(file);\n
                 ^^^^^^\n
Resource leak: 'stream' is never closed\n
----------\n
2. ERROR in X.java (at line 9)\n
 FileInputStream stream2 = new FileInputStream(file); // unsure since passed to method\n
                 ^^^^^^^\n
Potential resource leak: 'stream2' may not be closed\n
----------\n
3. ERROR in X.java (at line 10)\n
 bis = getReader(stream2); // unsure since obtained from method\n
 ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: 'bis' may not be closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 7)\n
 FileInputStream stream = new FileInputStream(file);\n
                 ^^^^^^\n
Resource leak: 'stream' is never closed\n
----------\n
2. ERROR in X.java (at line 9)\n
 FileInputStream stream2 = new FileInputStream(file); // unsure since passed to method\n
                 ^^^^^^^\n
Potential resource leak: 'stream2' may not be closed\n
----------\n
3. ERROR in X.java (at line 10)\n
 bis = getReader(stream2); // unsure since obtained from method\n
 ^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: 'bis' may not be closed\n
----------\n
]>

Stacktrace

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

------------ but was ------------
----------\n
1. ERROR in X.java (at line 7)\n
	FileInputStream stream = new FileInputStream(file);\n
	                ^^^^^^\n
Resource leak: 'stream' is never closed\n
----------\n
2. ERROR in X.java (at line 9)\n
	FileInputStream stream2 = new FileInputStream(file); // unsure since passed to method\n
	                ^^^^^^^\n
Potential resource leak: 'stream2' may not be closed\n
----------\n
3. ERROR in X.java (at line 10)\n
	bis = getReader(stream2); // unsure since obtained from method\n
	^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: 'bis' may not be closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in X.java (at line 7)\n
	FileInputStream stream = new FileInputStream(file);\n
	                ^^^^^^\n
Resource leak: 'stream' is never closed\n
----------\n
2. ERROR in X.java (at line 9)\n
	FileInputStream stream2 = new FileInputStream(file); // unsure since passed to method\n
	                ^^^^^^^\n
Potential resource leak: 'stream2' may not be closed\n
----------\n
3. ERROR in X.java (at line 10)\n
	bis = getReader(stream2); // unsure since obtained from method\n
	^^^^^^^^^^^^^^^^^^^^^^^^\n
Potential resource leak: 'bis' may not be 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.test063a(ResourceLeakTests.java:2947)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#test063a - 1.8
X.java [
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.IOException;
public class X {
    void read(File file) throws IOException {
        FileInputStream stream = new FileInputStream(file);
        BufferedInputStream bis = new BufferedInputStream(stream); // never since reassigned
        FileInputStream stream2 = new FileInputStream(file); // unsure since passed to method
        bis = getReader(stream2); // unsure since obtained from method
        bis.available();
    }
    BufferedInputStream getReader(FileInputStream stream) throws IOException {
        return new BufferedInputStream(stream);
    }
}

]


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

Standard Error

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