Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2020-01-13 10:33:31 +0000
committerAlexander Kurtakov2020-01-13 10:33:31 +0000
commit3ee6b6b032dcf9bdd5380d6469f8874368ddb44a (patch)
treeb0c82e25e95b6799f856d1b18b425f9ff7baee75 /org.eclipse.ua.tests
parent890f62e121fbde1b3f7c6f17b3d42c4b72c0ce92 (diff)
downloadeclipse.platform.ua-3ee6b6b032dcf9bdd5380d6469f8874368ddb44a.tar.gz
eclipse.platform.ua-3ee6b6b032dcf9bdd5380d6469f8874368ddb44a.tar.xz
eclipse.platform.ua-3ee6b6b032dcf9bdd5380d6469f8874368ddb44a.zip
Bug 559097 - Compile warnings in I20200113-0130
Fix platform.ua. Warnings in places where dealing with ServletResponse.getWriter are just suppressed as writer shouldn't be closed in this places. Change-Id: I2d18b200ec008f05aa67fa07cd22da18c6360d2e Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
index 154b1021e..5c7dc1d32 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -34,7 +34,9 @@ public class FileUtil {
public static String getContents(Bundle bundle, String relativePath) throws IOException {
URL url = bundle.getEntry(relativePath);
if (url != null) {
- return readString(url.openStream());
+ try (InputStream is = url.openStream()) {
+ return readString(is);
+ }
}
return null;
}

Back to the top