mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -341,7 +341,7 @@ public class Cipher {
|
|||
throw new NoSuchAlgorithmException("Invalid transformation " +
|
||||
"format:" + transformation);
|
||||
}
|
||||
if ((parts[0] == null) || (parts[0].length() == 0)) {
|
||||
if ((parts[0] == null) || (parts[0].isEmpty())) {
|
||||
throw new NoSuchAlgorithmException("Invalid transformation:" +
|
||||
"algorithm not specified-"
|
||||
+ transformation);
|
||||
|
@ -445,10 +445,10 @@ public class Cipher {
|
|||
String alg = parts[0];
|
||||
String mode = parts[1];
|
||||
String pad = parts[2];
|
||||
if ((mode != null) && (mode.length() == 0)) {
|
||||
if ((mode != null) && (mode.isEmpty())) {
|
||||
mode = null;
|
||||
}
|
||||
if ((pad != null) && (pad.length() == 0)) {
|
||||
if ((pad != null) && (pad.isEmpty())) {
|
||||
pad = null;
|
||||
}
|
||||
|
||||
|
@ -634,7 +634,7 @@ public class Cipher {
|
|||
if ((transformation == null) || transformation.isEmpty()) {
|
||||
throw new NoSuchAlgorithmException("Null or empty transformation");
|
||||
}
|
||||
if ((provider == null) || (provider.length() == 0)) {
|
||||
if ((provider == null) || (provider.isEmpty())) {
|
||||
throw new IllegalArgumentException("Missing provider");
|
||||
}
|
||||
Provider p = Security.getProvider(provider);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue