< 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,612 **** return Set.of(); } else { Set<String> modules = new HashSet<>(); while (value != null) { for (String s : value.split(",")) { ! if (s.length() > 0) modules.add(s); } index++; value = getAndRemoveProperty(prefix + index); } return modules; --- 602,613 ---- return Set.of(); } else { Set<String> modules = new HashSet<>(); while (value != null) { for (String s : value.split(",")) { ! if (!s.isEmpty()) ! modules.add(s); } index++; value = getAndRemoveProperty(prefix + index); } return modules;
*** 893,903 **** 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) { values.add(s); ntargets++; } } if (ntargets == 0) --- 894,904 ---- 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.isEmpty()) { values.add(s); ntargets++; } } if (ntargets == 0)
< prev index next >