groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Rename variable name and refine javadoc
Date Sat, 24 Mar 2018 13:27:18 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X fff7f617e -> e3bcd6219


Rename variable name and refine javadoc

(cherry picked from commit fde8e7c)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/e3bcd621
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/e3bcd621
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/e3bcd621

Branch: refs/heads/GROOVY_2_5_X
Commit: e3bcd62197b2b4e14e0686294eb943471dd10c89
Parents: fff7f61
Author: danielsun1106 <realbluesun@hotmail.com>
Authored: Sat Mar 24 19:41:17 2018 +0800
Committer: danielsun1106 <realbluesun@hotmail.com>
Committed: Sat Mar 24 21:27:08 2018 +0800

----------------------------------------------------------------------
 .../org/codehaus/groovy/runtime/EncodingGroovyMethods.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e3bcd621/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java
index 1fabef1..273fc41 100644
--- a/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java
@@ -395,6 +395,7 @@ public class EncodingGroovyMethods {
      * @return digested value
      * @throws NoSuchAlgorithmException if the algorithm not found
      * @since 2.5.0
+     * @see MessageDigest#getInstance(java.lang.String)
      */
     public static String digest(CharSequence self, String algorithm) throws NoSuchAlgorithmException
{
         final String text = self.toString();
@@ -408,11 +409,12 @@ public class EncodingGroovyMethods {
      * @return digested value
      * @throws NoSuchAlgorithmException if the algorithm not found
      * @since 2.5.0
+     * @see MessageDigest#getInstance(java.lang.String)
      */
     public static String digest(byte[] self, String algorithm) throws NoSuchAlgorithmException
{
-        MessageDigest md5 = MessageDigest.getInstance(algorithm);
-        md5.update(ByteBuffer.wrap(self));
+        MessageDigest md = MessageDigest.getInstance(algorithm);
+        md.update(ByteBuffer.wrap(self));
 
-        return String.format("%032x", new BigInteger(1, md5.digest()));
+        return String.format("%032x", new BigInteger(1, md.digest()));
     }
 }


Mime
View raw message