< prev index next >
src/java.base/share/classes/java/lang/Long.java
Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
@@ -1227,11 +1227,11 @@
int radix = 10;
int index = 0;
boolean negative = false;
Long result;
- if (nm.length() == 0)
+ 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 >