since Guava already in the deps, use BaseEncoding instead of commons-codec

This commit is contained in:
Vladimir Krivosheev
2018-03-23 17:48:37 +01:00
parent 99cbb28191
commit d406523586
3 changed files with 4 additions and 5 deletions
@@ -2,13 +2,13 @@
package com.intellij.facet.impl.ui.libraries;
import com.google.common.io.BaseEncoding;
import com.intellij.facet.ui.libraries.LibraryInfo;
import com.intellij.openapi.roots.libraries.LibraryUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ArrayUtil;
import org.apache.commons.codec.binary.Hex;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -76,7 +76,7 @@ public class RequiredLibrariesInfo {
md5.update(file.contentsToByteArray());
final byte[] digest = md5.digest();
return new String(Hex.encodeHex(digest));
return BaseEncoding.base16().lowerCase().encode(digest);
}
catch (Exception e) {
return null;
-1
View File
@@ -24,6 +24,5 @@
<orderEntry type="module" module-name="intellij.platform.vcs.tests" scope="TEST" />
<orderEntry type="library" scope="TEST" name="XStream" level="project" />
<orderEntry type="library" name="miglayout-swing" level="project" />
<orderEntry type="library" name="commons-codec" level="project" />
</component>
</module>
@@ -1,6 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.zmlx.hg4idea.repo;
import com.google.common.io.BaseEncoding;
import com.intellij.dvcs.DvcsUtil;
import com.intellij.dvcs.repo.RepoStateException;
import com.intellij.dvcs.repo.Repository;
@@ -11,7 +12,6 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.Hash;
import com.intellij.vcs.log.VcsLogObjectsFactory;
import org.apache.commons.codec.binary.Hex;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.zmlx.hg4idea.HgNameWithHashInfo;
@@ -105,7 +105,7 @@ public class HgRepositoryReader {
public String readCurrentRevision() {
if (!isDirStateInfoAvailable()) return null;
try {
return Hex.encodeHexString(readHashBytesFromFile(myDirStateFile));
return BaseEncoding.base16().lowerCase().encode(readHashBytesFromFile(myDirStateFile));
}
catch (IOException e) {
// dirState exists if not fresh, if we could not load dirState info repository must be corrupted