commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1395065 - /commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
Date Sat, 06 Oct 2012 14:07:11 GMT
Author: sebb
Date: Sat Oct  6 14:07:10 2012
New Revision: 1395065

URL: http://svn.apache.org/viewvc?rev=1395065&view=rev
Log:
Remove unnecessary private method; call the underlying method directly

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java?rev=1395065&r1=1395064&r2=1395065&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
Sat Oct  6 14:07:10 2012
@@ -58,17 +58,6 @@ public class DigestUtils {
     }
 
     /**
-     * Calls {@link StringUtils#getBytesUtf8(String)}
-     *
-     * @param data
-     *            the String to encode
-     * @return encoded bytes
-     */
-    private static byte[] getBytesUtf8(String data) {
-        return StringUtils.getBytesUtf8(data);
-    }
-
-    /**
      * Returns a <code>MessageDigest</code> for the given <code>algorithm</code>.
      *
      * @param algorithm
@@ -226,7 +215,7 @@ public class DigestUtils {
      * @since 1.7
      */
     public static byte[] md2(String data) {
-        return md2(getBytesUtf8(data));
+        return md2(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -300,7 +289,7 @@ public class DigestUtils {
      * @return MD5 digest
      */
     public static byte[] md5(String data) {
-        return md5(getBytesUtf8(data));
+        return md5(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -415,7 +404,7 @@ public class DigestUtils {
      * @return SHA-1 digest
      */
     public static byte[] sha1(String data) {
-        return sha1(getBytesUtf8(data));
+        return sha1(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -500,7 +489,7 @@ public class DigestUtils {
      * @since 1.4
      */
     public static byte[] sha256(String data) {
-        return sha256(getBytesUtf8(data));
+        return sha256(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -594,7 +583,7 @@ public class DigestUtils {
      * @since 1.4
      */
     public static byte[] sha384(String data) {
-        return sha384(getBytesUtf8(data));
+        return sha384(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -688,7 +677,7 @@ public class DigestUtils {
      * @since 1.4
      */
     public static byte[] sha512(String data) {
-        return sha512(getBytesUtf8(data));
+        return sha512(StringUtils.getBytesUtf8(data));
     }
 
     /**
@@ -806,7 +795,7 @@ public class DigestUtils {
      * @since 1.7
      */
     public static MessageDigest updateDigest(final MessageDigest messageDigest, final String
valueToDigest) {
-        messageDigest.update(getBytesUtf8(valueToDigest));
+        messageDigest.update(StringUtils.getBytesUtf8(valueToDigest));
         return messageDigest;
     }
 }



Mime
View raw message