Closed emelyanovkr closed 1 month ago
This one is a bit puzzling. I assume this code is proprietary and you don't have an open-source reproducer?
Could you try with the latest NullAway version, 0.11.2? Though I don't think that should be the issue. I'm wondering why you are on 0.10.25? Is this behavior a regression?
I assume this code is proprietary and you don't have an open-source reproducer? What do you mean this code is proprietary? It's just a build.gradle configuration, standard, I think.
I'm wondering why you are on 0.10.25 You know its really strange, cause I was relying on IDE, because it always give me the latest version of libraries to upgrade. However, I didn't get any suggestions to update on this one, that why I stayed on this version. That one was from baeldung guide, as I remember.
And I still got the same error after changing version.
This error happens when I'm using build
command from gradle.
Also, I think, it might be useful to look at this message:
> Task :compileTestJava FAILED
So I guess it's failing compileTestJava task.
Sorry, by proprietary, I meant that it would be difficult for you to create a public GitHub repo where I could reproduce the issue. Generally speaking if we can get such a repo it helps us to debug.
That said, based on what you wrote I have a guess as to the issue here. Can you try tweaking your Gradle config like this:
tasks.withType(JavaCompile) {
options.errorprone {
option("NullAway:AnnotatedPackages", "helium.video")
}
}
}
NullAway runs at the warning level by default so the check("NullAway", CheckSeverity.WARN)
shouldn't be needed. With this updated config the NullAway:AnnotatedPackages
option will always be set. Does that fix the issue? If so, I will update our documentation.
Sorry, by proprietary, I meant that it would be difficult for you to create a public GitHub repo where I could reproduce the issue. Generally speaking if we can get such a repo it helps us to debug.
Ah, no, it's a public repo, just check this: https://github.com/emelyanovkr/VideoArchiveService/tree/working_branch Please refer to the working_branch.
Does that fix the issue?
Yeah, that's fixed the issue, thanks for you fast response!
However, if I would like to don't use NullAway in test
packages, how can I do it?
Here is some updated config that will turn off NullAway completely on tests:
tasks.withType(JavaCompile) {
options.errorprone {
// always set annotated packages to be safe
option("NullAway:AnnotatedPackages", "com.foo")
}
if (name.toLowerCase().contains("test")) {
options.errorprone {
disable("NullAway")
}
}
}
This works well, thank you!
Hello,
I've tried to search for the simillar issue but haven't found anything yet. When trying to build gradle project with Nullaway I'm having this exception:
build.gradle configuration:
I just don't understand what the issue with
annotating packages
when I'm using this optionoption("NullAway:AnnotatedPackages", "helium.video")
.