Add instanceof.unsafe lint option#1209
Conversation
| @@ -0,0 +1,3 @@ | |||
| InstanceofLintOptionEnabled.java:12:15: warning: [instanceof.pattern.unsafe] instanceof pattern binding '@Tainted Object' to '@Untainted String s' cannot be statically verified. | |||
There was a problem hiding this comment.
Where is a reference to this file? It should be the expected output for one of the compile tasks.
| * @test | ||
| * @summary Test case for instanceof lint option: -Alint=instanceof | ||
| * @requires jdk.version >= 17 | ||
| * @compile -processor org.checkerframework.checker.tainting.TaintingChecker InstanceofLintOptionEnabled.java -Alint=instanceof |
There was a problem hiding this comment.
Wouldn't it make more sense for this compilation to produce the output in LintOptionDisabled? If the lint is on, it should produce the additional warnings.
There was a problem hiding this comment.
I realized I was doing it wrong. Now it should be okay.
No, I think these two PRs for different purposes. |
Co-authored-by: Werner Dietl <wdietl@gmail.com>
| private final boolean checkEnclosingExpr; | ||
|
|
||
| /** True if "-Alint=cast:redundant" was passed on the command line. */ | ||
| private final boolean lintCastRedundantEnabled; |
There was a problem hiding this comment.
I'm wondering whether we should call all these fields "xxxDisabled" and not have the negation in every check. Does it make the code easier to read either way?
If you do this, be careful in adapting the Javadocs.
There was a problem hiding this comment.
Lint option sounds optional check to me, and we enable unsafe lint options by default (maybe it could be an error?).
I think it would be nicer to keep these as xxxEnabled.
|
Also, please add a changelog entry. |
instanceof.unsafe lint option
No description provided.