-
Notifications
You must be signed in to change notification settings - Fork 19
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
Separate Initialization Checker #444
Conversation
…trized with an invariant, but considers every field to be an invariant annotation
…ere monotonically initialized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your further refinement!
I've pushed a few changes directly, please review them - in particular the changelog.
A few more comments about the documentation, but I haven't gone through everything yet.
...ain/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java
Show resolved
Hide resolved
...ain/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...ain/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java
Outdated
Show resolved
Hide resolved
checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
checker/src/main/java/org/checkerframework/checker/nullness/NullnessNoInitTransfer.java
Outdated
Show resolved
Hide resolved
...al/src/main/java/org/checkerframework/checker/initialization/qual/HoldsForDefaultValues.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I really like all these improvements!
I pushed a few more changes myself and asked a few more questions.
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...g/checkerframework/checker/initialization/InitializationFieldAccessAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
...va/org/checkerframework/checker/initialization/InitializationParentAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
checker/src/test/java/org/checkerframework/checker/test/junit/NullnessTest.java
Outdated
Show resolved
Hide resolved
@@ -2625,7 +2642,7 @@ public boolean shouldSkipUses(@FullyQualifiedName String typeName) { | |||
* @param tree class to potentially skip | |||
* @return true if checker should not test {@code tree} | |||
*/ | |||
public final boolean shouldSkipDefs(ClassTree tree) { | |||
public boolean shouldSkipDefs(ClassTree tree) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of making these two methods non-final, how about adding handling of parentChecker
to these methods?
The logic in NullnessNoInitSubchecker.java
makes sense for all checkers with a parent, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be addressed by #572
framework/src/main/java/org/checkerframework/framework/type/GenericAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
…, move to top-level class, and improve comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the final touches. I'll merge this now. Let's try it in practice and see what the feedback is.
@@ -2655,7 +2672,7 @@ public final boolean shouldSkipDefs(ClassTree tree) { | |||
* @param meth method to potentially skip | |||
* @return true if checker should not test {@code meth} | |||
*/ | |||
public final boolean shouldSkipDefs(ClassTree cls, MethodTree meth) { | |||
public boolean shouldSkipDefs(ClassTree cls, MethodTree meth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo with #572
This branch rewrites the Initialization Checker such that checking of the initialization hierarchy and the target hierarchy is done in two separate checkers instead of at once. The Javadoc to the
InitializationChecker
class explains how this can be implemented for any given target type system.For every type system that uses the Initialization Checker (only nullness so far), initialization checking can now be deactivated via the
-AassumeInitialized
command-line option or via@SuppressWarnings("initialization")
annotations.Also fixes #297.
Merge together with eisop/checker-framework.demos#4.