-
Notifications
You must be signed in to change notification settings - Fork 299
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 #657 by splitting field initialization region into smaller regions #658
Conversation
Do you mean until after that release? |
For context, we want to have a NullAway release with #656 (probably NullAway 0.10.2) and a NullAwayAutoAnnotator release with some version of ucr-riple/NullAwayAnnotator#72, then test them internally and upgrade them in lockstep. @nimakarimipour , question, does having this change in NullAway require a corresponding change in NullAwayAutoAnnotator? I think, long term, if need to keep upgrading the two in lockstep, we might either need them to be on the same repo with tight coupling and integration tests between the two components, or we need to make all these file formats versioned and keep compatibility within the NullAwayAutoAnnotator for multiple NullAway releases, it's becoming a bit of an issue that we need to coordinate releases between the two projects. |
Yes, the reason is that it requires a change in |
Yes it requires a change in Annotator, actually I thought about making NullAway output its current version in a file and Annotator either try to be compatible with that or terminate with a message informing what NullAway/Annotator version should be used. |
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.
LGTM, except for a minor nit about comment styles 🙂
/** Path to the program point of the reported error */ | ||
/** Class and member corresponding to a program point at which an error / fix was reported. */ | ||
public class ClassAndMemberInfo { | ||
/** Path to the program point of the reported error / fix */ | ||
public final TreePath path; | ||
|
||
/** | ||
* Finding values for these properties is costly and are not needed by default, hence, they are | ||
* not {@code final} and are only initialized at request. | ||
*/ |
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 comment format (starting with /**
) indicates that this is the javadoc documentation for method
. I think this is just an unrelated comment about both of the fields below, so I would just have it as:
// Finding values for these properties is costly and are not needed by default, hence, they are
// not final and are only initialized at request.
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.
Thank you for noticing this :) 9e6f062
I think it's worth doing this as a follow up PR before the next NullAway release, at least the compatibility check. Would save us some surprises in the future... |
This PR updates the region computation in `Type-Annotator-Scanner` according to latest changes in NullAway following [PR658](uber/NullAway#658). Also in this PR the infrastructure for keeping compatibility with older versions of NullAway (`0.10.4` or less) is implemented.
Note: This PR can wait until the next release of NullAway (
0.10.2
).This PR resolves #657 by splitting the field initialization region into smaller regions. We currently only consider the value "null", for all
errors/fixes
reported in this regions. In large classes which they have many number of field, this can easily create a lot builds as they all have the value "null" for enclosing method causing conflicts in regions.This PR generalizes the concept of enclosing method to enclosing member, and breaks a single regions of field initialization regions into a separate region for each field declaration and reduce the conflicts in regions dramatically.
The equivalent for enclosing member is described:
The enclosing member for
fix
orerror
is:"null"
(used for static initialization region).With the current approach the following errors will have the values below:
From the point of view of Annotator, that is 4 conflicts in regions as they all have
enclMethod = "null"
.This can be greatly improved with the new approach suggested and changed to below:
None of the error reported above have any conflicts and can be allocated to separate regions.