{"record":{"id":"2df8813cf9bc943c","repo":"junit-team/junit5","slug":"implement-scanforresourcesinclasspathroot-uri-res","errorCode":null,"errorMessage":"Implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead","messagePattern":"Implement scanForResourcesInClasspathRoot\\(URI, ResourceFilter\\) instead","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"junit-platform-commons/src/main/java/org/junit/platform/commons/support/scanning/ClasspathScanner.java","lineNumber":111,"sourceCode":"\t * that match the specified {@code resourceFilter} predicate.\n\t *\n\t * <p>The classpath scanning algorithm searches recursively in subpackages\n\t * beginning with the root of the classpath.\n\t *\n\t * @param root the URI for the classpath root in which to scan; never\n\t * {@code null}\n\t * @param resourceFilter the resource type filter; never {@code null}\n\t * @return a list of all such resources found; never {@code null}\n\t * but potentially empty\n\t * @deprecated Please implement\n\t * {@link #scanForResourcesInClasspathRoot(URI, ResourceFilter)} instead\n\t */\n\t@API(status = DEPRECATED, since = \"1.14\")\n\t@Deprecated(since = \"1.14\", forRemoval = true)\n\t@SuppressWarnings(\"removal\")\n\tdefault List<org.junit.platform.commons.support.Resource> scanForResourcesInClasspathRoot(URI root,\n\t\t\tPredicate<org.junit.platform.commons.support.Resource> resourceFilter) {\n\t\tthrow new UnsupportedOperationException(\n\t\t\t\"Implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead\");\n\t}\n\n\t/**\n\t * Find all {@linkplain Resource resources} in the supplied classpath {@code root}\n\t * that match the specified {@code resourceFilter} predicate.\n\t *\n\t * <p>The classpath scanning algorithm searches recursively in subpackages\n\t * beginning with the root of the classpath.\n\t *\n\t * @param basePackageName the name of the base package in which to start\n\t * scanning; must not be {@code null} and must be valid in terms of Java\n\t * syntax\n\t * @param resourceFilter the resource type filter; never {@code null}\n\t * @return a list of all such resources found; never {@code null}\n\t * but potentially empty\n\t * @since 1.14\n\t */","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/scanning/ClasspathScanner.java#L93-L129","documentation":"UnsupportedOperationException thrown by the deprecated default method scanForResourcesInClasspathRoot(URI, Predicate<Resource>) on the ClasspathScanner interface (deprecated since 1.14, forRemoval=true). Implementers must override the new scanForResourcesInClasspathRoot(URI, ResourceFilter) variant that takes the typed ResourceFilter.","triggerScenarios":"A ClasspathScanner implementation lacking the new scanForResourcesInClasspathRoot(URI, ResourceFilter) override, while the framework or a caller invokes the deprecated Predicate-based default method.","commonSituations":"Unmigrated custom ClasspathScanner SPI implementation; version skew between junit-platform-commons and a third-party scanner; shading pulling in an old scanner that only implements the Predicate overload.","solutions":["Override scanForResourcesInClasspathRoot(URI, ResourceFilter) in the custom ClasspathScanner","Stop calling the deprecated overload","Align all junit-platform-* artifacts on the same version"],"exampleFix":"// before\n@Override\npublic List<Resource> scanForResourcesInClasspathRoot(URI root, Predicate<Resource> f) { ... }\n\n// after\n@Override\npublic List<Resource> scanForResourcesInClasspathRoot(URI root, ResourceFilter f) { ... }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate custom ClasspathScanner implementations to the 1.14 ResourceFilter API","Keep all junit-platform-* versions aligned via junit-bom","Treat @Deprecated(forRemoval=true) SPI methods as already removed"],"tags":["classpath-scanning","deprecated-api","migration","spi"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}