-
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
Fix WPI Non-Termination Issue with @UnknownInitialization Annotations #6657
base: master
Are you sure you want to change the base?
Changes from 23 commits
ebb561b
30d842f
05ef6fb
ebf782c
5167ed1
ee517ea
f3a08a7
5df02b7
42d7812
711ae4d
d9a6504
342bc94
b5a62d8
5f3f89d
81f1f2b
8c345fd
118b771
4818ac2
134e76f
1c31423
131e864
4691e84
872d7e1
33c82a6
5b642c3
d7acb57
1b1d56f
8826275
388e584
fd16cc8
eb79855
6ae7fba
f057894
1a32487
90129a3
cf451ba
8eafe7d
1d5fb60
217ba50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5523,6 +5523,15 @@ public boolean wpiShouldInferTypesForReceivers() { | |
return true; | ||
} | ||
|
||
/** | ||
* Changes the type of {@code rhsATM} when being assigned to anything, for use by whole-program | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "when being assigned to anything" isn't quite correct, I think. This method is called anytime an annotation set is updated, so it is not called just at assignments - instead, it is called any time that WPI does an update, which conceptually is at all pseudo-assignments. The other text that you have here makes that clear, as well; please make this consistent. |
||
* inference. The default implementation does nothing. | ||
* | ||
* @param rhsATM the type of the rhs of the pseudo-assignment, which is side-effected by this | ||
* method | ||
*/ | ||
public void wpiAdjustAnnotationsBeforeUpdate(AnnotatedTypeMirror rhsATM) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest the name Moreover, I'm not sure that you actually need this new method at all. Conceptually, I don't see any difference between this and calling the code you've written in the implementation in the Nullness Checker from both |
||
|
||
/** | ||
* Side-effects the method or constructor annotations to make any desired changes before writing | ||
* to an annotation file. | ||
|
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.
This call to
areSameByName
cannot possibly return true, because the string input toareSameByName
must be a qualified name of an annotation - that is, it cannot have arguments. You could replace this with a call toareSame
that takesUNDER_INITIALIZATION
as the other argument, I think, to get the semantics that you're looking for.I'm not sure that this check is really necessary, though. When it resolves to true, it doesn't really matter whether the call to
replaceAnnotation
below occurs or not, since "replacing" an annotation with another copy of the same annotation has no effect. So, I'd just remove this condition rather than try to get the semantics correct.