Failed

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

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

------------ but was ------------
----------\n
1. ERROR in Bug381445.java (at line 11)\n
 InputStream stream4 = new FileInputStream(path);\n
             ^^^^^^^\n
Potential resource leak: 'stream4' may not be closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in Bug381445.java (at line 11)\n
 InputStream stream4 = new FileInputStream(path);\n
             ^^^^^^^\n
Potential resource leak: 'stream4' may not be closed\n
----------\n
]>

Stacktrace

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

------------ but was ------------
----------\n
1. ERROR in Bug381445.java (at line 11)\n
	InputStream stream4 = new FileInputStream(path);\n
	            ^^^^^^^\n
Potential resource leak: 'stream4' may not be closed\n
----------\n

--------- Difference is ----------
 expected:<[]> but was:<[----------\n
1. ERROR in Bug381445.java (at line 11)\n
	InputStream stream4 = new FileInputStream(path);\n
	            ^^^^^^^\n
Potential resource leak: 'stream4' 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:2301)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:2289)
	at org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.testBug381445_1(ResourceLeakTests.java:4046)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests#testBug381445_1 - 1.8
com/google/common/io/Closeables.java [
package com.google.common.io;
public class Closeables {
    public static void closeQuietly(java.io.Closeable closeable) {}
    public static void close(java.io.Closeable closeable, boolean flag) {}
}

]
org/apache/commons/io/IOUtils.java [
package org.apache.commons.io;
public class IOUtils {
    public static void closeQuietly(java.io.Closeable closeable) {}
}

]
Bug381445.java [
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class Bug381445 {
	public void readFile(String path) throws Exception {
		File file = new File(path);
		InputStream stream1 = new FileInputStream(path);
		InputStream stream2 = new FileInputStream(path);
		InputStream stream3 = new FileInputStream(path);
		InputStream stream4 = new FileInputStream(path);
		try {
			// Use the opened streams here
			stream1.read();
			stream2.read();
			stream3.read();
			stream4.read();
		} finally {
			com.google.common.io.Closeables.closeQuietly(stream1);
			com.google.common.io.Closeables.close(stream2, false);
			org.apache.commons.io.IOUtils.closeQuietly(stream3);
			Closeables.closeQuietly(stream4);
		}
	}
}
class Closeables {
	public static void closeQuietly(java.io.Closeable closeable) {}
}

]


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

Standard Error

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