< prev index next >

src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java

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

@@ -602,11 +602,12 @@
             return Set.of();
         } else {
             Set<String> modules = new HashSet<>();
             while (value != null) {
                 for (String s : value.split(",")) {
-                    if (s.length() > 0) modules.add(s);
+                    if (!s.isEmpty())
+                        modules.add(s);
                 }
                 index++;
                 value = getAndRemoveProperty(prefix + index);
             }
             return modules;

@@ -893,11 +894,11 @@
             if (!allowDuplicates && map.containsKey(key))
                 fail(key + " specified more than once to " + option(prefix));
             List<String> values = map.computeIfAbsent(key, k -> new ArrayList<>());
             int ntargets = 0;
             for (String s : rhs.split(regex)) {
-                if (s.length() > 0) {
+                if (!s.isEmpty()) {
                     values.add(s);
                     ntargets++;
                 }
             }
             if (ntargets == 0)
< prev index next >