Closed xenoterracide closed 8 months ago
Thanks for the report. I've put up #913 to fix this issue. After that lands, you should get an error at the call to isDirectory()
.
I haven't dug into that file. You might want to look at the other similar methods though? Like is regular file, just to make sure they are also properly annotated.
PS on my phone at the moment
Our JDK models are quite incomplete, so we end up doing these one-off patches. We are currently working on a way to import the annotations from https://github.com/jspecify/jdk so we have much more complete coverage. In light of that, I'll probably continue doing one-off fixes for the time being rather than trying to systemically pull in the right models manually.
According to javadoc
File.getParent
should be@Nullable
and according to intellij,Files.isDirectory(
first parameter is@Nonnull
, javadoc there doesn't say. So it would seem to me that the wrong line is reported, or this a false positive entirely. EitherisDirectory
is going to blow, or it's going to return false, either wayfindGitDir
won't even be called ifgetParent()
is null.note: I tried giving parent it's own variable (
var parent = current.getParent()
), but that didn't work either.