< prev index next >

src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -78,11 +78,11 @@
      * separately.
      * <p>
      * Please override the method if need to support more name pattern.
      */
     public Set<String> decompose(String algorithm) {
-        if (algorithm == null || algorithm.length() == 0) {
+        if (algorithm == null || algorithm.isEmpty()) {
             return new HashSet<>();
         }
 
         Set<String> elements = decomposeImpl(algorithm);
 

@@ -165,11 +165,11 @@
     /*
      * This decomposes a standard name into sub-elements with a consistent
      * message digest algorithm name to avoid overly complicated checking.
      */
     public static Set<String> decomposeOneHash(String algorithm) {
-        if (algorithm == null || algorithm.length() == 0) {
+        if (algorithm == null || algorithm.isEmpty()) {
             return new HashSet<>();
         }
 
         Set<String> elements = decomposeImpl(algorithm);
 
< prev index next >