-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
review: feature: add "Generated by ..." comments automatically #1465
Conversation
a8c8209
to
6033764
Compare
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.9.0-20170714.224607-7 New API: fr.inria.gforge.spoon:spoon-core:jar:5.9.0-SNAPSHOT Detected changes: 2. Change 1
Change 2
|
I like the idea of this PR. But I don't think that having a lot a boolean, somewhat cryptic, options in Environment is good. IMHO, this is already a problem we have and we should not worsen the situation. Coming back to this PR here are possible solutions:
WDYT? |
I agree. I personally cannot configure spoon launcher easily. I always copy the code from somewhere...
I agree. This is good step. But it is not enough, because clients of Templates has no easy way how to set this field. So we need some support here too. In future I would like to use TemplateBuilder, with appropriate related setter |
6033764
to
db8c084
Compare
I removed Environment setter. I added SubstitutionVisitor#addGeneratedBy(boolean) and AbstractTemplate#addGeneratedBy(boolen) OK now? |
Thanks a lot, that's much better and clearer. One more problem is the duplication of the boolean setting in SubstitutionVisitor and AbstractTemplate: one does not really know who is responsible for this. Here is a tentative solution: instead of
I'd propose something like this:
it's more verbose (but it's a special advanced case), but it follows the Single Responsibility Principle. WDYT? |
Your suggestion is not compatible with all There is also problem that Template must be configured before SubstitutionVisitor is created for the template, because the template parameters are collected at SubstitutionVisitor creation time. So I suggest to keep it as it is. It is may be not nice, but better solution would need more refactoring and would cause changes in API |
I agree. thanks Pavel for this nice feature. |
SubstitutionVisitor adds "Generated by ..." java doc comment automatically now.
For example:
TODO: make it configurable whether it is added or not