From 5667939a3ab03eaf895ca8013f773ad98fa516fc Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Thu, 11 Jan 2024 22:22:53 +0100 Subject: [PATCH] Avoid recommending t-w-r within custom close method --- .../compiler/regression/ResourceLeakAnnotatedTests.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakAnnotatedTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakAnnotatedTests.java index f9c74ba24ba..8163ea97ca8 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakAnnotatedTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakAnnotatedTests.java @@ -1379,12 +1379,7 @@ public void consume(@Owning F this) throws Exception { }, """ ---------- - 1. INFO in F.java (at line 6) - public void consume(@Owning F this) throws Exception { - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Resource 'rc1' should be managed by try-with-resource - ---------- - 2. ERROR in F.java (at line 6) + 1. ERROR in F.java (at line 6) public void consume(@Owning F this) throws Exception { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Resource leak: 'this.rc2' is never closed