< prev index next >
src/java.base/share/classes/java/lang/Integer.java
Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD
*** 1407,1417 ****
int radix = 10;
int index = 0;
boolean negative = false;
Integer result;
! if (nm.length() == 0)
throw new NumberFormatException("Zero length string");
char firstChar = nm.charAt(0);
// Handle sign, if present
if (firstChar == '-') {
negative = true;
--- 1407,1417 ----
int radix = 10;
int index = 0;
boolean negative = false;
Integer result;
! if (nm.isEmpty())
throw new NumberFormatException("Zero length string");
char firstChar = nm.charAt(0);
// Handle sign, if present
if (firstChar == '-') {
negative = true;
< prev index next >