You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An execution of WPI on a Java project with the Optional Checker will yield a set of .ajava files where the implicit @MaybePresent annotation is inserted for most (if not all) method arguments and return types, e.g.,
A research discussion with @mernst and @rjust showed that this was not an error; since .ajava files are not meant to be human-read.
That said, I am opening this issue to at least document the possibility that @MaybePresent annotations will no longer be inserted into the .ajava files. The manual suggests that the
[MaybePresent] type is a default value, so programmers do not have to write it
@jyoo980 This is expected (though not really desirable) WPI behavior: effectively, WPI writes all "true" annotations, even those that are equivalent to the default.
WPI makes an effort to avoid doing this when it can: see
// Do not print invisible qualifiers, to avoid cluttering the output.
. This code only works for qualifiers that are marked as @InvisibleQualifer, so it's only useful for qualifiers that the type system designer genuinely intended to never be written. It would be great if WPI could do a better job of filtering "default" qualifiers than this.
Summary
An execution of WPI on a Java project with the Optional Checker will yield a set of
.ajava
files where the implicit@MaybePresent
annotation is inserted for most (if not all) method arguments and return types, e.g.,A research discussion with @mernst and @rjust showed that this was not an error; since
.ajava
files are not meant to be human-read.That said, I am opening this issue to at least document the possibility that
@MaybePresent
annotations will no longer be inserted into the.ajava
files. The manual suggests that theSee this manual section for details.
The text was updated successfully, but these errors were encountered: