Use Java 7 StandardCharsets instead of Guava Charsets

Replace with static imports since the class name is so much longer.

Change-Id: If2cdede62a0977db05db69b4c9ec88bd980e011f
This commit is contained in:
Dave Borowitz
2014-01-27 16:59:31 -08:00
parent c6f7459d92
commit 68a55b9074
9 changed files with 29 additions and 24 deletions

View File

@@ -14,7 +14,8 @@
package com.google.gerrit.server.mail;
import com.google.common.base.Charsets;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.common.data.ParameterizedString;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.server.GerritPersonIdent;
@@ -179,7 +180,7 @@ public class FromAddressGeneratorProvider implements
private static String hashOf(String data) {
try {
MessageDigest hash = MessageDigest.getInstance("MD5");
byte[] bytes = hash.digest(data.getBytes(Charsets.UTF_8));
byte[] bytes = hash.digest(data.getBytes(UTF_8));
return Base64.encodeBase64URLSafeString(bytes);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("No MD5 available", e);