-
Notifications
You must be signed in to change notification settings - Fork 356
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
We need a way to suppress all initialization errors #1590
Comments
Latest docs propose to use -AsuppressWarnings=fbc (https://checkerframework.org/manual/#initialization-checking-suppressing-warnings). Initialization warnings are gone however null checks also doesn't seem to be reported anymore:
Without suppressing any warnings I'm getting the following error:
With -AsuppressWarnings=fbc compilation just runs fine without any warnings. The other mentioned option -AsuppressWarnings=initialization. doesn't have any impact. I was using version 3.8.0. |
The manual's mention of the "fbc" SuppressWarnings string is wrong. I'm sorry about that. Thank you for pointing it out; we appreciate it. There are two relevant SuppressWarnings strings:
You did two experiments.
The behavior you are seeing seems right to me, but let us know if there is another problem. |
Thank you for the clarification. However, the problem still persists. "initialization." does not suppress initialization warnings:
I am using the following configuration for the maven plugin:
|
You are right. The behavior changed in version 3.2.0 early this year, but the documentation was not updated correctly at that time. The wrong manual is confusing to both users and developers! To revise my previous statement, there are two relevant SuppressWarnings strings:
Thanks again for reporting this and bearing with us while we fix this documentation. |
I am still puzzled. I would like to only have null checking and no initialization warnings/errors. I tried "fbc", "initialization", and "initialization." options. None of them yield the desired behavior. Am I correctly assuming that currently there is no way to suppress initialization errors but have full null validation support? |
@mernst Any update on this? |
@flix- Can you please take a look at the "Suppressing Warnings" section in the Initialization Checker manual and let me know if it is not clear? I think it directly answers your question, but if it is unclear or there is a bug, let us know and we will fix it. Thanks. |
Encountering this issue here. Adding Checker to a large existing project which does a lot of explicit dependency injection, passing class references around in constructors to be stored for later use. So we're seeing lots of errors like:
In this case we know the code is fine. We want to turn off all of the |
I'm sorry you are having trouble. Could you please provide a concrete example of code and exactly what you did that didn't work? Otherwise it is hard to make a suggestion. Did you try the suggestion in the "Suppressing Warnings" section of the "Initialization Checker" section of the manual? It says:
|
We need a way to suppress all initialization errors (but not the nullness checks).
Example:
The initialization checker of the checker-framework correctly reports the issues:
According to the docs of the Initialization Checker, it should be able to disable the initialization checker via a command line argument:
When we use this argument (in checker-framework 2.2.1) we still get an initialization error:
Quote from mernst in this Stackoverflow discussion "How to suppress all initialization errors" :
The text was updated successfully, but these errors were encountered: