Skip to content

Commit

Permalink
Adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed May 11, 2022
1 parent 3e12f16 commit 692ae03
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private static class Classpath {
* @return a set of types names satisfying the condition
*/
static Set<String> getTypes(Environment env, String packageName) {
return getReflections(env, packageName).getStore().keys(TypeElementsScanner.class.getSimpleName());
return getReflections(env, packageName).getStore().getOrDefault(TypeElementsScanner.class.getSimpleName(), Collections.emptyMap()).keySet();
}
private static Reflections getReflections(Environment env, String packageName) {
// This is not supposed to happen very often, but just when starting the application.
Expand All @@ -232,7 +232,7 @@ private static Reflections getReflections(Environment env, String packageName) {
private static ConfigurationBuilder getReflectionsConfiguration(String packageName, ClassLoader classLoader) {
return new ConfigurationBuilder()
.addUrls(ClasspathHelper.forPackage(packageName, classLoader))
.filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName + ".")))
.filterInputsBy(new FilterBuilder().includePackage((packageName + ".").replace(".","\\.") + ".*"))
.setScanners(new TypeElementsScanner(), new TypeAnnotationsScanner(), new SubTypesScanner());
}

Expand Down

0 comments on commit 692ae03

Please sign in to comment.