< prev index next >
src/java.base/share/classes/sun/security/jca/ProviderList.java
Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD
@@ -173,11 +173,11 @@
String entry;
int i = 1;
while ((entry = Security.getProperty("security.provider." + i)) != null) {
entry = entry.trim();
- if (entry.length() == 0) {
+ if (entry.isEmpty()) {
System.err.println("invalid entry for " +
"security.provider." + i);
break;
}
int k = entry.indexOf(' ');
@@ -198,11 +198,11 @@
}
configs = configList.toArray(PC0);
// Load config entries for use when getInstance is called
entry = Security.getProperty("jdk.security.provider.preferred");
- if (entry != null && (entry = entry.trim()).length() > 0) {
+ if (entry != null && !(entry = entry.trim()).isEmpty()) {
String[] entries = entry.split(",");
if (ProviderList.preferredPropList == null) {
ProviderList.preferredPropList = new PreferredList();
}
< prev index next >