summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-04-11 21:31:07 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-04-12 10:09:51 +0900
commite5ba2c9bdae8c0a18ae9b5b8e5f255aae254b864 (patch)
treee170061e01f33604b802b7852039708e44521b30 /org.eclipse.jgit/src
parentec84767c338d255c149a59c8766c864b42eaa0f3 (diff)
downloadjgit-e5ba2c9bdae8c0a18ae9b5b8e5f255aae254b864.tar.gz
jgit-e5ba2c9bdae8c0a18ae9b5b8e5f255aae254b864.zip
DirCache: Use constant from StandardCharsets
Instead of hard-coding the encoding name, use the constant from StandardCharsets. As a result it is no longer necessary to catch the UnsupportedEncodingException. Change-Id: I3cb6de921a78e05e2a894c220e0d5a5c85e172cc Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
index 84bb340d24..d7f975b003 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
@@ -45,6 +45,8 @@
package org.eclipse.jgit.dircache;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.EOFException;
@@ -53,7 +55,6 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.text.MessageFormat;
@@ -580,9 +581,8 @@ public class DirCache {
}
}
- private static String formatExtensionName(final byte[] hdr)
- throws UnsupportedEncodingException {
- return "'" + new String(hdr, 0, 4, "ISO-8859-1") + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ private static String formatExtensionName(final byte[] hdr) {
+ return "'" + new String(hdr, 0, 4, ISO_8859_1) + "'"; //$NON-NLS-1$ //$NON-NLS-2$
}
private static boolean is_DIRC(final byte[] hdr) {