mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
c998ead188
commit
a3df1d618e
155 changed files with 340 additions and 382 deletions
|
@ -649,7 +649,7 @@ public final class Security {
|
|||
}
|
||||
}
|
||||
|
||||
if ((candidates == null) || (candidates.isEmpty()))
|
||||
if (candidates == null || candidates.isEmpty())
|
||||
return null;
|
||||
|
||||
Object[] candidatesArray = candidates.toArray();
|
||||
|
@ -1005,11 +1005,11 @@ public final class Security {
|
|||
String algName = null;
|
||||
String attrName = null;
|
||||
|
||||
if (filterValue.length() == 0) {
|
||||
if (filterValue.isEmpty()) {
|
||||
// The filterValue is an empty string. So the filterKey
|
||||
// should be in the format of <crypto_service>.<algorithm_or_type>.
|
||||
algName = filterKey.substring(algIndex + 1).trim();
|
||||
if (algName.length() == 0) {
|
||||
if (algName.isEmpty()) {
|
||||
// There must be a algorithm or type name.
|
||||
throw new InvalidParameterException("Invalid filter");
|
||||
}
|
||||
|
@ -1024,7 +1024,7 @@ public final class Security {
|
|||
throw new InvalidParameterException("Invalid filter");
|
||||
} else {
|
||||
attrName = filterKey.substring(attrIndex + 1).trim();
|
||||
if (attrName.length() == 0) {
|
||||
if (attrName.isEmpty()) {
|
||||
// There is no attribute name in the filter.
|
||||
throw new InvalidParameterException("Invalid filter");
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ public final class Security {
|
|||
**/
|
||||
public static Set<String> getAlgorithms(String serviceName) {
|
||||
|
||||
if ((serviceName == null) || (serviceName.length() == 0) ||
|
||||
if ((serviceName == null) || (serviceName.isEmpty()) ||
|
||||
(serviceName.endsWith("."))) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue