Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2017-12-07 01:23:38 +0000
committerDavid Pursehouse2017-12-07 11:02:59 +0000
commit171f84a04117cfd02446f67565073a05128777a4 (patch)
treede60805128113634bc7d92cce426db59a0a96b52 /org.eclipse.jgit.junit
parent5f94e4430800f6e1352733a3ff684e959341984d (diff)
downloadjgit-171f84a04117cfd02446f67565073a05128777a4.tar.gz
jgit-171f84a04117cfd02446f67565073a05128777a4.tar.xz
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.junit')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index 382afc5cae..db6f60960c 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.junit;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -246,7 +247,7 @@ public class TestRepository<R extends Repository> {
* @throws Exception
*/
public RevBlob blob(final String content) throws Exception {
- return blob(content.getBytes("UTF-8"));
+ return blob(content.getBytes(UTF_8));
}
/**

Back to the top