diff --git a/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java b/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java index 1884cd3d377..3a565577b4c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java @@ -72,13 +72,13 @@ public ClasspathScanningLoader(Properties properties, String[] acceptPackages) { */ public ClasspathScanningLoader(Properties properties, ClassLoader classLoader) { scanClasses(new ClassGraph() - .ignoreParentClassLoaders() - .overrideClassLoaders(classLoader), classLoader); + .ignoreParentClassLoaders() + .overrideClassLoaders(classLoader), classLoader); scanYaml(new ClassGraph() - .ignoreParentClassLoaders() - .overrideClassLoaders(classLoader) - .acceptPaths("META-INF/rewrite"), + .ignoreParentClassLoaders() + .overrideClassLoaders(classLoader) + .acceptPaths("META-INF/rewrite"), properties, emptyList(), classLoader); @@ -163,10 +163,9 @@ private void scanClasses(ClassGraph classGraph, ClassLoader classLoader) { private void configureRecipes(ScanResult result, String className) { for (ClassInfo classInfo : result.getSubclasses(className)) { Class recipeClass = classInfo.loadClass(); - if (recipeClass.getName().equals(DeclarativeRecipe.class.getName()) - || recipeClass.getEnclosingClass() != null + if (recipeClass.getName().equals(DeclarativeRecipe.class.getName()) || // `ScanningRecipe` is an example of an abstract `Recipe` subtype - || (recipeClass.getModifiers() & Modifier.ABSTRACT) != 0) { + (recipeClass.getModifiers() & Modifier.ABSTRACT) != 0) { continue; } Timer.Builder builder = Timer.builder("rewrite.scan.configure.recipe");