You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2017/11/09 01:02:34 UTC

svn commit: r1814683 - in /commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest: Crypt.java Sha2Crypt.java

Author: ggregory
Date: Thu Nov  9 01:02:34 2017
New Revision: 1814683

URL: http://svn.apache.org/viewvc?rev=1814683&view=rev
Log:
Fix Javadoc: These APIs actually throw IllegalArgumentException, not RuntimeException.

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

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Crypt.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Crypt.java?rev=1814683&r1=1814682&r2=1814683&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Crypt.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Crypt.java Thu Nov  9 01:02:34 2017
@@ -47,7 +47,7 @@ public class Crypt {
      * @param keyBytes
      *            plaintext password
      * @return hash value
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String crypt(final byte[] keyBytes) {
@@ -69,7 +69,7 @@ public class Crypt {
      * @return hash value
      * @throws IllegalArgumentException
      *             if the salt does not match the allowed pattern
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String crypt(final byte[] keyBytes, final String salt) {
@@ -100,7 +100,7 @@ public class Crypt {
      * @param key
      *            plaintext password
      * @return hash value
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String crypt(final String key) {
@@ -161,7 +161,7 @@ public class Crypt {
      * @return hash value, i.e. encrypted password including the salt string
      * @throws IllegalArgumentException
      *             if the salt does not match the allowed pattern
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught. *
      */
     public static String crypt(final String key, final String salt) {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Sha2Crypt.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Sha2Crypt.java?rev=1814683&r1=1814682&r2=1814683&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Sha2Crypt.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Sha2Crypt.java Thu Nov  9 01:02:34 2017
@@ -83,7 +83,7 @@ public class Sha2Crypt {
      * @param keyBytes
      *            plaintext to hash
      * @return complete hash value
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String sha256Crypt(final byte[] keyBytes) {
@@ -104,7 +104,7 @@ public class Sha2Crypt {
      * @return complete hash value including salt
      * @throws IllegalArgumentException
      *             if the salt does not match the allowed pattern
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String sha256Crypt(final byte[] keyBytes, String salt) {
@@ -528,7 +528,7 @@ public class Sha2Crypt {
      * @param keyBytes
      *            plaintext to hash
      * @return complete hash value
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String sha512Crypt(final byte[] keyBytes) {
@@ -549,7 +549,7 @@ public class Sha2Crypt {
      * @return complete hash value including salt
      * @throws IllegalArgumentException
      *             if the salt does not match the allowed pattern
-     * @throws RuntimeException
+     * @throws IllegalArgumentException
      *             when a {@link java.security.NoSuchAlgorithmException} is caught.
      */
     public static String sha512Crypt(final byte[] keyBytes, String salt) {