Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2020-02-20 09:05:45 +0000
committerKarsten Thoms2020-03-29 21:11:07 +0000
commit5e2b2514fadb5ddea9bcfe8b723e8eb7d15e525d (patch)
treed6fb9f0c0aabc6e304c0c758f540f77fffa808c8
parent4f984bac9597c5b0e8422a9923e971b0e502261f (diff)
downloadeclipse.platform.debug-I20200329-1800.tar.gz
eclipse.platform.debug-I20200329-1800.tar.xz
eclipse.platform.debug-I20200329-1800.zip
And add comment why it is no leak. Change-Id: I67364abc6f2c8cc607219946e8c9bad56f8d0fc6 Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java1
2 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java
index b3ed3ef00..3f66da872 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java
@@ -78,6 +78,8 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
fDetectRoots = detectRootPaths;
}
+ // Suppress resource leak warning. The ZipFile is provided from
+ // SourceLookupUtils which take care to close them at some point.
@SuppressWarnings("resource")
@Override
public Object[] findSourceElements(String name) throws CoreException {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java
index ea44ed1c5..5891e9258 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java
@@ -51,6 +51,7 @@ public class SourceLookupUtils {
* @exception IOException if unable to create the specified zip
* file
*/
+ @SuppressWarnings("resource")
public static ZipFile getZipFile(String name) throws IOException {
synchronized (fgZipFileCache) {
if (fgCleaner == null) {

Back to the top