diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-08 09:42:02 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-11 22:28:30 +0100 |
commit | 62bc48df60bc852f4f93a721b1599232133ad289 (patch) | |
tree | 3e97b97a5046a12fa9532ac20d4610a405c58ef2 | |
parent | b7651da4e8c75181bf6c6955e77428f32dd274e9 (diff) | |
download | jgit-62bc48df60bc852f4f93a721b1599232133ad289.tar.gz jgit-62bc48df60bc852f4f93a721b1599232133ad289.zip |
Constants: Initialize CHARSET and CHARACTER_ENCODING from StandardCharsets.UTF_8
Change-Id: Ib4e0a35429892fa1581db09a9b77717120d03275
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index bb85229f82..29189a9d74 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java @@ -45,6 +45,8 @@ package org.eclipse.jgit.lib; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.security.MessageDigest; @@ -226,10 +228,10 @@ public final class Constants { public static final byte[] PACK_SIGNATURE = { 'P', 'A', 'C', 'K' }; /** Native character encoding for commit messages, file names... */ - public static final String CHARACTER_ENCODING = "UTF-8"; + public static final Charset CHARSET = UTF_8; /** Native character encoding for commit messages, file names... */ - public static final Charset CHARSET; + public static final String CHARACTER_ENCODING = CHARSET.name(); /** Default main branch name */ public static final String MASTER = "master"; @@ -652,7 +654,6 @@ public final class Constants { static { if (OBJECT_ID_LENGTH != newMessageDigest().getDigestLength()) throw new LinkageError(JGitText.get().incorrectOBJECT_ID_LENGTH); - CHARSET = Charset.forName(CHARACTER_ENCODING); } /** name of the file containing the commit msg for a merge commit */ |