@@ -307,33 +307,23 @@ public void addClasspathOverride(final Object overrideClasspathElement) {
307307 }
308308
309309 /**
310- * Add a classpath element filter. The provided {@link ClasspathElementFilter} should return true if the path
311- * string passed to it is a path you want to scan.
310+ * Add a classpath element filter. The provided {@link ClasspathElementFilter} or
311+ * {@link ClasspathElementURLFilter} should return true if the path string or {@link URL} passed to it is a path
312+ * that should be scanned.
312313 *
313- * @param classpathElementFilter
314+ * @param filterLambda
314315 * The classpath element filter to apply to all discovered classpath elements, to decide which should
315316 * be scanned.
316317 */
317- public void filterClasspathElements (final ClasspathElementFilter classpathElementFilter ) {
318- if (this .classpathElementFilters == null ) {
319- this .classpathElementFilters = new ArrayList <>(2 );
318+ public void filterClasspathElements (final Object filterLambda ) {
319+ if (!(filterLambda instanceof ClasspathElementFilter
320+ || filterLambda instanceof ClasspathElementURLFilter )) {
321+ throw new IllegalArgumentException ();
320322 }
321- this .classpathElementFilters .add (classpathElementFilter );
322- }
323-
324- /**
325- * Add a classpath element URL filter. The provided {@link ClasspathElementURLFilter} should return true if the
326- * URL passed to it is one you want to scan.
327- *
328- * @param classpathElementURLFilter
329- * The classpath element URL filter to apply to all discovered classpath elements, to decide which
330- * should be scanned.
331- */
332- public void filterClasspathElements (final ClasspathElementURLFilter classpathElementURLFilter ) {
333323 if (this .classpathElementFilters == null ) {
334324 this .classpathElementFilters = new ArrayList <>(2 );
335325 }
336- this .classpathElementFilters .add (classpathElementURLFilter );
326+ this .classpathElementFilters .add (filterLambda );
337327 }
338328
339329 /**
0 commit comments