Errorprone recommends to use String.split(String, int) as it has a
less surprising behaviour with empty entries.
https://errorprone.info/bugpattern/StringSplitter
Change-Id: I48a01ee18d66bbb4a177aee576629dc5132d4a38
try {
String pathSeparator = System.getProperty("path.separator");
String[] classPathEntries = System.getProperty("java.class.path")
- .split(pathSeparator);
+ .split(pathSeparator, -1);
URL[] urls = new URL[classPathEntries.length];
for (int i = 0; i < classPathEntries.length; i++) {
urls[i] = Paths.get(classPathEntries[i]).toUri().toURL();