This commit is contained in:
Henry Jen 2018-12-13 11:51:06 -08:00
commit def1ac3acc
200 changed files with 1089 additions and 616 deletions

View file

@ -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);

View file

@ -337,7 +337,7 @@ public class SealedObject implements Serializable {
if (key == null) {
throw new NullPointerException("key is null");
}
if (provider == null || provider.length() == 0) {
if (provider == null || provider.isEmpty()) {
throw new IllegalArgumentException("missing provider");
}