[Checkers] Flow and IGJ
Mahmood Ali
mahmood at MIT.EDU
Tue Jun 24 09:55:01 EDT 2008
Greetings,
So I managed to get flow to work with IGJ. When I experimented with
it, I realize that it has some undesired consequences (for
readability). The question I have is how to deal with the qualifiers
users specify himself.
In Nullness Checker, the following is allowed (when using Flow):
@Nullable Date d = new Date();
d.setDate(3); // d guaranteed to be nonnull
When porting it to IGJ, I have the following case:
@ReadOnly Date d = new @Mutable Date();
d.setDate(3); // d guaranteed to be mutable
I find it to be a bit troubling from readability standpoint and (I
assume) would complicate the mutation rules.
In one sense they are similar (especially if a programmer reuse a
reference for mutable and immutable object); yet I think that flow
should only operate if the user doesn't specify a qualifier.
What do you think?
What should be the default for flow: only propagate if user doesn't
specify qualifiers, or always propagate if the value of the variable
is guaranteed to be a subtype of variable declaration qualifier?
- Mahmood
More information about the checkers
mailing list