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