< prev index next >

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

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

*** 544,554 **** try (InputStream in = jf.getInputStream(entry)) { BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); String cn; while ((cn = nextLine(reader)) != null) { ! if (cn.length() > 0) { String pn = packageName(cn); if (!packages.contains(pn)) { String msg = "Provider class " + cn + " not in module"; throw new InvalidModuleDescriptorException(msg); } --- 544,554 ---- try (InputStream in = jf.getInputStream(entry)) { BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); String cn; while ((cn = nextLine(reader)) != null) { ! if (!cn.isEmpty()) { String pn = packageName(cn); if (!packages.contains(pn)) { String msg = "Provider class " + cn + " not in module"; throw new InvalidModuleDescriptorException(msg); }
*** 597,607 **** // collapse repeating dots mn = Patterns.REPEATING_DOTS.matcher(mn).replaceAll("."); // drop leading dots ! if (mn.length() > 0 && mn.charAt(0) == '.') mn = Patterns.LEADING_DOTS.matcher(mn).replaceAll(""); // drop trailing dots int len = mn.length(); if (len > 0 && mn.charAt(len-1) == '.') --- 597,607 ---- // collapse repeating dots mn = Patterns.REPEATING_DOTS.matcher(mn).replaceAll("."); // drop leading dots ! if (!mn.isEmpty() && mn.charAt(0) == '.') mn = Patterns.LEADING_DOTS.matcher(mn).replaceAll(""); // drop trailing dots int len = mn.length(); if (len > 0 && mn.charAt(len-1) == '.')
< prev index next >