File#getParent can return null which caused this spotbugs warning. FS.FileStoreAttributes#get already gets the parent directory if the passed File is not a directory and checks for null. Hence there is no need to get the parent directory in the FileSnapshot constructor. Change-Id: I77f71503cffb05970ab8d9ba55b69c96c53098b9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>tags/v5.11.0.202102031030-m2
@@ -223,7 +223,7 @@ public class FileSnapshot { | |||
this.file = file; | |||
this.lastRead = Instant.now(); | |||
this.fileStoreAttributeCache = useConfig | |||
? FS.getFileStoreAttributes(file.toPath().getParent()) | |||
? FS.getFileStoreAttributes(file.toPath()) | |||
: FALLBACK_FILESTORE_ATTRIBUTES; | |||
BasicFileAttributes fileAttributes = null; | |||
try { |