From c8b1b822a409167b63bd9be11efac0bcd5476a5c Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Mon, 8 Jul 2024 14:21:45 -0700 Subject: [PATCH] [errorprone] SeparateClassloadertTestRunner: use #split(String,int) 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 --- .../org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java index c8c56b21b8..2a482df04a 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java @@ -44,7 +44,7 @@ public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner { 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(); -- 2.39.5