diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-12-07 10:23:38 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2017-12-07 20:02:59 +0900 |
commit | 171f84a04117cfd02446f67565073a05128777a4 (patch) | |
tree | de60805128113634bc7d92cce426db59a0a96b52 /org.eclipse.jgit.http.test/tst/org/eclipse/jgit | |
parent | 5f94e4430800f6e1352733a3ff684e959341984d (diff) | |
download | jgit-171f84a04117cfd02446f67565073a05128777a4.tar.gz jgit-171f84a04117cfd02446f67565073a05128777a4.zip |
Use constants from StandardCharsets instead of hard-coded strings
Instead of hard-coding the charset strings "US-ASCII", "UTF-8", and
"ISO-8859-1", use the corresponding constants from StandardCharsets.
UnsupportedEncodingException is not thrown when the StandardCharset
constants are used, so remove the now redundant handling.
Because the encoding names are no longer hard-coded strings, also
remove redundant $NON-NLS warning suppressions.
Also replace existing usages of the constants with static imports.
Change-Id: I0a4510d3d992db5e277f009a41434276f95bda4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 51b79903c6..5f40be4e05 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -43,6 +43,7 @@ package org.eclipse.jgit.http.test; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_ENCODING; import static org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_LENGTH; import static org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_TYPE; @@ -56,7 +57,6 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.io.PrintWriter; import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; import java.text.MessageFormat; import java.util.Arrays; import java.util.Collection; @@ -1084,7 +1084,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { public void testInvalidWant() throws Exception { @SuppressWarnings("resource") ObjectId id = new ObjectInserter.Formatter().idFor(Constants.OBJ_BLOB, - "testInvalidWant".getBytes(StandardCharsets.UTF_8)); + "testInvalidWant".getBytes(UTF_8)); Repository dst = createBareRepository(); try (Transport t = Transport.open(dst, remoteURI); |