Bug 412639 - ResourceLeakTests.testBug381445_1b failed
Summary: ResourceLeakTests.testBug381445_1b failed
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 4.4 M1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2013-07-10 03:49 EDT by Dani Megert CLA
Modified: 2013-07-15 04:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2013-07-10 03:49:18 EDT
N20130709-2000.

ResourceLeakTests.testBug381445_1b failed.

http://download.eclipse.org/eclipse/downloads/drops4/N20130709-2000/testresults/html/org.eclipse.jdt.core.tests.compiler_linux.gtk.x86_6.0.html


Invalid problem log . ----------- Expected ------------ ----------\n 1. ERROR in Bug381445.java (at line 8)\n ResultSet rset2 = stat.executeQuery(q2);\n ^^^^^\n Potential resource leak: 'rset2' may not be closed\n ----------\n ------------ but was ------------ ----------\n 1. ERROR in Bug381445.java (at line 15)\n Closeables.closeQuietly(rset2);\n ^^^^^^^^^^^^\n The method closeQuietly(AutoCloseable) from the type Closeables refers to the missing type AutoCloseable\n ----------\n 2. ERROR in Bug381445.java (at line 30)\n public static void closeQuietly(java.lang.AutoCloseable closeable) {}\n ^^^^^^^^^^^^^^^^^^^^^^^\n java.lang.AutoCloseable cannot be resolved to a type\n ----------\n --------- Difference is ---------- expected:<...81445.java (at line [8)\n ResultSet rset2 = stat.executeQuery(q2);\n ^^^^^\n Potential resource leak: 'rset2' may not be closed]\n ----------\n > but was:<...81445.java (at line [15)\n Closeables.closeQuietly(rset2);\n ^^^^^^^^^^^^\n The method closeQuietly(AutoCloseable) from the type Closeables refers to the missing type AutoCloseable\n ----------\n 2. ERROR in Bug381445.java (at line 30)\n public static void closeQuietly(java.lang.AutoCloseable closeable) {}\n ^^^^^^^^^^^^^^^^^^^^^^^\n java.lang.AutoCloseable cannot be resolved to a type]\n ----------\n >

junit.framework.ComparisonFailure: Invalid problem log .
----------- Expected ------------
----------\n
1. ERROR in Bug381445.java (at line 8)\n
ResultSet rset2 = stat.executeQuery(q2);\n
^^^^^\n
Potential resource leak: 'rset2' may not be closed\n
----------\n

------------ but was ------------
----------\n
1. ERROR in Bug381445.java (at line 15)\n
Closeables.closeQuietly(rset2);\n
^^^^^^^^^^^^\n
The method closeQuietly(AutoCloseable) from the type Closeables refers to the missing type AutoCloseable\n
----------\n
2. ERROR in Bug381445.java (at line 30)\n
public static void closeQuietly(java.lang.AutoCloseable closeable) {}\n
^^^^^^^^^^^^^^^^^^^^^^^\n
java.lang.AutoCloseable cannot be resolved to a type\n
----------\n

--------- Difference is ----------
expected:<...81445.java (at line [8)\n
ResultSet rset2 = stat.executeQuery(q2);\n
^^^^^\n
Potential resource leak: 'rset2' may not be closed]\n
----------\n
> but was:<...81445.java (at line [15)\n
Closeables.closeQuietly(rset2);\n
^^^^^^^^^^^^\n
The method closeQuietly(AutoCloseable) from the type Closeables refers to the missing type AutoCloseable\n
----------\n
2. ERROR in Bug381445.java (at line 30)\n
public static void closeQuietly(java.lang.AutoCloseable closeable) {}\n
^^^^^^^^^^^^^^^^^^^^^^^\n
java.lang.AutoCloseable cannot be resolved to a type]\n
----------\n
>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:238)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:214)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.checkCompilerLog(AbstractRegressionTest.java:873)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2285)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2120)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest(AbstractRegressionTest.java:1922)
at org.eclipse.jdt.core.tests.compiler.regression.ResourceLeakTests.testBug381445_1b(ResourceLeakTests.java:4098)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:55)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:655)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:310)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Dani Megert CLA 2013-07-10 03:53:02 EDT
Stephan, I'm assigning this to you, as it looks related to your recent work in bug 405569.
Comment 2 Stephan Herrmann CLA 2013-07-10 14:09:55 EDT
Sorry, my bad. It seems I forgot to protect a test case needing type
AutoCloseable against running on older JRE's.

What puzzled me at first: the test only failed on linux, the very platform on
which I ran the test before committing (green).
At a closer look the linux tests run on jre6, while the others use jre7,
so that actually explains ...
Comment 3 Stephan Herrmann CLA 2013-07-11 14:16:56 EDT
Trivial fix released via commit 1beadf5b4bd07b60b68336f300a25d7d5f732449
Comment 4 Dani Megert CLA 2013-07-15 04:10:12 EDT
Verified in N20130714-2000.