diff options
author | Isira Seneviratne <31027858+Isira-Seneviratne@users.noreply.github.com> | 2020-07-10 01:26:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 21:26:19 -0400 |
commit | 3700641b4e745a1804b4409c58dee15b459dad16 (patch) | |
tree | c952ab4de1a4f05e2dec17e8eadca75b2694f6fe /src/main/java/org/apache/commons/lang3/CharUtils.java | |
parent | 031f4f61b70ec88d16affc982a7092935fd4a0c9 (diff) | |
download | apache-commons-lang-3700641b4e745a1804b4409c58dee15b459dad16.tar.gz |
Correct Javadocs of methods that use Validate.notNull() and replace some uses of Validate.isTrue() with Validate.notNull(). (#525)
* Update Javadocs of methods that call Validate.notNull() to refer to NullPointerException instead of IllegalArgumentException for null values.
* Use Validate.notNull() instead of Validate.isTrue() to check for null values, and update the associated tests to check for NullPointerException instead of IllegalArgumentException.
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/CharUtils.java')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/CharUtils.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/apache/commons/lang3/CharUtils.java b/src/main/java/org/apache/commons/lang3/CharUtils.java index b4e8ccf7e..4e07693fb 100644 --- a/src/main/java/org/apache/commons/lang3/CharUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharUtils.java @@ -131,7 +131,7 @@ public class CharUtils { * * @param ch the character to convert * @return the char value of the Character - * @throws IllegalArgumentException if the Character is null + * @throws NullPointerException if the Character is null */ public static char toChar(final Character ch) { Validate.notNull(ch, "The Character must not be null"); @@ -172,6 +172,7 @@ public class CharUtils { * * @param str the character to convert * @return the char value of the first letter of the String + * @throws NullPointerException if the string is null * @throws IllegalArgumentException if the String is empty */ public static char toChar(final String str) { @@ -260,7 +261,8 @@ public class CharUtils { * * @param ch the character to convert, not null * @return the int value of the character - * @throws IllegalArgumentException if the Character is not ASCII numeric or is null + * @throws NullPointerException if the Character is null + * @throws IllegalArgumentException if the Character is not ASCII numeric */ public static int toIntValue(final Character ch) { Validate.notNull(ch, "The character must not be null"); |