Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-02-11 21:40:51 +0000
committerAlexander Kurtakov2019-02-12 10:14:27 +0000
commitff508f4576e41ccc0fd4f0ed417e5320572fdb76 (patch)
treec34d41d41310cab1d2778a18d122a95aeff23255 /org.eclipse.ua.tests/help
parentbe07c17efd7df789819ac96dc4d99fd2e54c9ccb (diff)
downloadeclipse.platform.ua-ff508f4576e41ccc0fd4f0ed417e5320572fdb76.tar.gz
eclipse.platform.ua-ff508f4576e41ccc0fd4f0ed417e5320572fdb76.tar.xz
eclipse.platform.ua-ff508f4576e41ccc0fd4f0ed417e5320572fdb76.zip
Varargs reflection methods and try-with-resources.
Change-Id: Ib1f5311b9a5f7fde578129b96613fbeacfe0a0c0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
index 907efa2ce..09cd5759e 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/ChildLinkInsertion.java
@@ -181,19 +181,17 @@ public class ChildLinkInsertion {
}
private void checkEncoding(String input, String expectedEncoding) {
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- TestableReplacementStream filteredOutput = new TestableReplacementStream(output, null, "../");
- try {
+ try (ByteArrayOutputStream output = new ByteArrayOutputStream();
+ TestableReplacementStream filteredOutput = new TestableReplacementStream(output, null, "../")) {
filteredOutput.write(input.getBytes());
- filteredOutput.close();
+ if (expectedEncoding == null) {
+ assertNull(filteredOutput.getCharset());
+ } else {
+ assertEquals(expectedEncoding, filteredOutput.getCharset());
+ }
} catch (IOException e) {
fail("IO Exception");
}
- if (expectedEncoding == null) {
- assertNull(filteredOutput.getCharset());
- } else {
- assertEquals(expectedEncoding, filteredOutput.getCharset());
- }
}
}

Back to the top