-
Notifications
You must be signed in to change notification settings - Fork 2
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
No compiler message when referencing an inaccessible variable #27
Comments
As discussed in a previous meeting, these cases should be manually inspected and reclassified accordingly. As mentioned before, there is a mismatch between the JDT and the Maven compiler. Nevertheless, it is worth reflecting upon the use of reporting this broken use: any reference to the field whose type has been impacted will be reported as an error. Have a look at this method: maracas/core/src/main/java/com/github/maracas/visitors/BreakingChangeVisitor.java Line 91 in cdf2a33
|
My understanding is that the code you're referring to is only invoked when a type is removed/not visible anymore, and it attempts to find every place in the code where this type was used (as a field type, as a parameter type, a variable declaration, an extension/implementation, or anything). What do you mean with "any reference to the field whose type has been impacted"? Does it mean that, e.g., if |
That's exactly the situation we have here. Maracas is actually reporting such situations where we reference On a side note, this case is not reported anymore given that I added the requirement to only consider the breaking changes that are to be expected for a specific package (see #34 (comment)). |
So, if
lines 2 and 5 would be impacted? That's wrong imho, only line 2 should be a broken use. But it makes sense that it happens: |
Yeap, that's the situation we have right now. The JDT compiler also reports these cases but Maven does not. I don't think it is right or wrong but more related to the information we want to share with the developer. Having these additional broken uses give added value to them? Personally, I think it will depend on the case. Suppose that instead of setting |
The Maven compiler does not report an error when referencing a variable that cannot be accessed anymore (e.g. class no longer public, class less accessible). The broken use is correctly reported but there is no matching compiler message (true positives reported as false positives).
Related broken use:
The text was updated successfully, but these errors were encountered: