< prev index next >
src/java.base/share/classes/java/lang/reflect/Parameter.java
Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad
*** 172,184 ****
* file or synthesized if the class file does not provide
* a name.
*/
public String getName() {
// Note: empty strings as parameter names are now outlawed.
! // The .equals("") is for compatibility with current JVM
// behavior. It may be removed at some point.
! if(name == null || name.equals(""))
return "arg" + index;
else
return name;
}
--- 172,184 ----
* file or synthesized if the class file does not provide
* a name.
*/
public String getName() {
// Note: empty strings as parameter names are now outlawed.
! // The .isEmpty() is for compatibility with current JVM
// behavior. It may be removed at some point.
! if(name == null || name.isEmpty())
return "arg" + index;
else
return name;
}
< prev index next >