From 35e8ffa0b1b37fe2abc9321c057ed16ff19c5d69 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 30 Oct 2025 12:50:04 +0100 Subject: [PATCH] Remove workaround for bug fixed in JDK 9 and later --- .../platform/commons/util/DefaultClasspathScanner.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/DefaultClasspathScanner.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/DefaultClasspathScanner.java index e19efc373bdf..849c78cd654d 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/DefaultClasspathScanner.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/DefaultClasspathScanner.java @@ -260,12 +260,7 @@ private String determineSimpleResourceName(Path resourceFile) { private String determineSubpackageName(Path baseDir, Path file) { Path relativePath = baseDir.relativize(file.getParent()); String pathSeparator = baseDir.getFileSystem().getSeparator(); - String subpackageName = relativePath.toString().replace(pathSeparator, PACKAGE_SEPARATOR_STRING); - if (subpackageName.endsWith(pathSeparator)) { - // TODO: Remove workaround for JDK bug: https://bugs.openjdk.org/browse/JDK-8153248 - subpackageName = subpackageName.substring(0, subpackageName.length() - pathSeparator.length()); - } - return subpackageName; + return relativePath.toString().replace(pathSeparator, PACKAGE_SEPARATOR_STRING); } private void handleInternalError(Path classFile, String fullyQualifiedClassName, InternalError ex) {