Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation not found in provided JUnit5 stub file #6961

Open
joe-mojo opened this issue Jan 22, 2025 · 0 comments
Open

Annotation not found in provided JUnit5 stub file #6961

joe-mojo opened this issue Jan 22, 2025 · 0 comments

Comments

@joe-mojo
Copy link

Working with checker-framework 3.48.4.
When configuring checker framework ti use provided JUnit5 stub (junit-assertions.astub), I have the following warning:
junit-assertions.astub:(line 56,col 2): Unknown annotation @EnsuresNonNull("#1").
Aside this warning, because the @EnsuresNonNull("#1") on assertNonNull is "not known", assertNonNull are not considered as ensuring non-nullness and my tests are not compiling.

I tried to copy the file in my project's resource folder, and specifying this folder in annotation processor -Astubs argument, and added the following missing import: import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
...but I get the same waning.

The warning is triggered by line 56 though my modified stub has the @EnsuresNonNull("#1") on line 57 because of the newly inserted import.

Thus :

  • I failed to override JUnit5 stub location, annotation processor is obviously working with embedded junit-assertions.astub instead of mine
  • an import is missing in JUnit5 stub; we sould insert import org.checkerframework.checker.nullness.qual.EnsuresNonNull; at line 13.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant