mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad
This commit is contained in:
parent
df5b42f33b
commit
938b844088
95 changed files with 195 additions and 195 deletions
|
@ -2226,10 +2226,10 @@ public final class Locale implements Cloneable, Serializable {
|
|||
default:
|
||||
return Arrays.stream(stringList).reduce("",
|
||||
(s1, s2) -> {
|
||||
if (s1.equals("")) {
|
||||
if (s1.isEmpty()) {
|
||||
return s2;
|
||||
}
|
||||
if (s2.equals("")) {
|
||||
if (s2.isEmpty()) {
|
||||
return s1;
|
||||
}
|
||||
return MessageFormat.format(pattern, s1, s2);
|
||||
|
@ -3069,7 +3069,7 @@ public final class Locale implements Cloneable, Serializable {
|
|||
|
||||
private static boolean isSubtagIllFormed(String subtag,
|
||||
boolean isFirstSubtag) {
|
||||
if (subtag.equals("") || subtag.length() > 8) {
|
||||
if (subtag.isEmpty() || subtag.length() > 8) {
|
||||
return true;
|
||||
} else if (subtag.equals("*")) {
|
||||
return false;
|
||||
|
|
|
@ -704,7 +704,7 @@ public abstract class Pack200 {
|
|||
if (impl == null) {
|
||||
// The first time, we must decide which class to use.
|
||||
implName = GetPropertyAction.privilegedGetProperty(prop,"");
|
||||
if (implName != null && !implName.equals(""))
|
||||
if (implName != null && !implName.isEmpty())
|
||||
impl = Class.forName(implName);
|
||||
else if (PACK_PROVIDER.equals(prop))
|
||||
impl = com.sun.java.util.jar.pack.PackerImpl.class;
|
||||
|
|
|
@ -1290,7 +1290,7 @@ public final class Pattern
|
|||
// Construct result
|
||||
int resultSize = matchList.size();
|
||||
if (limit == 0)
|
||||
while (resultSize > 0 && matchList.get(resultSize-1).equals(""))
|
||||
while (resultSize > 0 && matchList.get(resultSize-1).isEmpty())
|
||||
resultSize--;
|
||||
String[] result = new String[resultSize];
|
||||
return matchList.subList(0, resultSize).toArray(result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue