GH-1404: do not try to find property files inside non-existing source folders

This commit is contained in:
Martin Lippert
2024-11-12 18:26:50 +01:00
parent dbaea71610
commit b5fff4e5f1

View File

@@ -118,6 +118,10 @@ public class AdHocSpringPropertyIndexProvider implements ProjectBasedPropertyInd
}
private void getIndexFromSourceFolder(File sourceFolder, SimplePropertyIndex index) {
if (!sourceFolder.exists()) {
return;
}
try (Stream<Path> walk = Files.walk(sourceFolder.toPath())) {
walk
.filter(path -> ValuePropertyReferencesProvider.isPropertiesFile(path))
@@ -132,7 +136,7 @@ public class AdHocSpringPropertyIndexProvider implements ProjectBasedPropertyInd
}
});
} catch (Exception e) {
e.printStackTrace();
log.error("error getting ad-hoc property index data for: " + sourceFolder.toString(), e);
}
}