mirror of https://github.com/apache/lucene.git
throw NullPointerException instead of IllegalArgumentException; small typo fixes
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150667 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d0623a8e13
commit
742417162a
|
@ -55,7 +55,7 @@ public class NumberTools {
|
||||||
+ "1y2p0ij32e8e7";
|
+ "1y2p0ij32e8e7";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the length of (all) strings returned by {@link #longToString}
|
* The length of (all) strings returned by {@link #longToString}
|
||||||
*/
|
*/
|
||||||
public static final int STR_SIZE = MIN_STRING_VALUE.length();
|
public static final int STR_SIZE = MIN_STRING_VALUE.length();
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class NumberTools {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String that was returned by {@link #longToString}back to a
|
* Converts a String that was returned by {@link #longToString} back to a
|
||||||
* long.
|
* long.
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException
|
* @throws IllegalArgumentException
|
||||||
|
@ -100,7 +100,7 @@ public class NumberTools {
|
||||||
*/
|
*/
|
||||||
public static long stringToLong(String str) {
|
public static long stringToLong(String str) {
|
||||||
if (str == null) {
|
if (str == null) {
|
||||||
throw new IllegalArgumentException("string cannot be null");
|
throw new NullPointerException("string cannot be null");
|
||||||
}
|
}
|
||||||
if (str.length() != STR_SIZE) {
|
if (str.length() != STR_SIZE) {
|
||||||
throw new NumberFormatException("string is the wrong size");
|
throw new NumberFormatException("string is the wrong size");
|
||||||
|
|
Loading…
Reference in New Issue