diff --git a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/PathUtils.java b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/PathUtils.java index 233b7bd8c..922537f8d 100644 --- a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/PathUtils.java +++ b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/PathUtils.java @@ -38,12 +38,8 @@ public static List removeRedundantPaths(List paths) { */ public static List filterResourcePaths(List paths) { return paths.stream() - .filter(path -> { - String pathString = path.toString(); - return !pathString.contains("src/main/resources") - && !pathString.contains("src/test/resources") - && !pathString.contains("src/test/java"); - }) + .filter(path -> path.toString().endsWith("src/main/java") + || path.toString().endsWith("src/test/java")) .collect(Collectors.toList()); } } diff --git a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/SpoonAnalyzer.java b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/SpoonAnalyzer.java index 9ecc1404f..f4f468441 100644 --- a/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/SpoonAnalyzer.java +++ b/spoon-analyzer/src/main/java/io/github/martinwitt/spoon_analyzer/SpoonAnalyzer.java @@ -54,6 +54,7 @@ public List analyze(String path) { launcher.getEnvironment().setNoClasspath(true); launcher.getEnvironment().setComplianceLevel(17); launcher.getEnvironment().setIgnoreSyntaxErrors(true); + launcher.getEnvironment().setLevel("ERROR"); var model = launcher.buildModel(); logger.atInfo().log("Found %s types.", model.getAllTypes().size()); for (CtType type : model.getAllTypes()) {