Mark generated classes as generated #116 #117
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@jjlauer this is my initial attempt at #116.
I haven't made the feature configurable yet, because there is something I want to discuss first.
My intention was to apply the annotation to every class rocker generates. The catch is, that rocker generates:
Right now java does not allow annotations on either of them.
For anonymous classes there might be a solution in the form of JSR308 (Introduced in java 8).
But this also has it's problems:
Those are the options we have in the order my preference:
0: Promote the anonymous classes and lambdas to proper classes
Let's generate the problematic classes as
static
inner classes that can be annotated.Pros:
Cons:
1: Ask JaCoCo to change
We/I can ask JaCoCO to change their logic. They should ignore anonymous classes or lambdas inside of classes marked as
@Generated
.Pros:
Cons:
2: Abandon the idea
Let's do nothing and chill.
Pros:
Cons:
3: Use JSR308 annotations
For java8 let's use JSR308 annotations. Remove the lambdas and replace them with anonymous classes.
Pros:
Cons: