-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
review: refactor: CtScanner to report CtRole of scanned element #1632
Conversation
b23a2d3
to
a8bbfb0
Compare
Only these tests fails:
It is fixable. WDYT? Will we go this way? |
a8bbfb0
to
d14544b
Compare
I really like this solution, which can probably be 100% backward compatible, without any API change (incl the one detected by Revapi). |
I am glad to hear that we are on the same side ;-) The little problem is that refactored CtScanner is harder for maintenance, because we have to actually manually take care about consistency of CtRole and method call pairs. It would be cool if CtScanner might be generated from Spoon model. But actually there are missing annotations, which would define scanning order. Let's discuss it in #1634 |
The little problem is that refactored CtScanner is harder for
maintenance, because we have to actually manually take care about
consistency of CtRole and method call pairs.
Yes, but once this is done, this evolves very little. I don't see this
as a big problem.
|
I agree, it is not big problem ... it can be covered by test, which checks that CtRole is matching method. |
6f93a04
to
5788240
Compare
I have implemented the test which checks whether correct role is user in CtScanner. But that test does not work well, because it is based on existing test CtScannerTest#testScannerCallsAllProperties, which is buggy - some methods are not checked. For example @monperrus Could you please have a look at it and fix the origin test? |
There is also bug in CtScanner#visitCtAnnotationFieldAccess, which calls derived |
It actually fails on inconsistency in @DerivedProperty. Problem: WDYT? should check @DerivedProperty on implementation classes and not on intefaces? |
5ea70a4
to
6e676b0
Compare
This PR now uses new SpoonMetaModel and it's detection of isDerived field. @monperrus, Now I stuck on scanning of COMMENT field. It is missing many CtScanner.visitXxx methods. Is it intentional??? |
ping @monperrus I need your answer to continue here. Thanks! ;-) |
I don't remember there was any discussion, I had very quickly the support of comment, I probably forgot to add some scanner. |
Actually I started to work on it but I stopped and I never created any PR, so I'm not sure I can really help here :) |
Yes, it is. As far as I remember, the main idea is that comments are not part of equality checking. Since EqualVisitor is derived from CtScanner we explicitly exclude all calls to getComments |
You are not right, or it must be a misunderstanding, because there are already 65 calls of |
5f5cd60
to
d4b0f8b
Compare
d4b0f8b
to
9018e53
Compare
Something bad happened to CI? Please check it. |
there is a problem with travis: https://www.traviscistatus.com/incidents/4vdl52d28hz3 |
This PR is ready for merge from my point of view |
Is it possible to keep |
Done. It should work like this. I am done here |
I have found that this PR contained some changes in |
thanks Pavel! |
This is an alternative to #1631 which directly modifies CtScanner ... to see how much Spoon will be broken...