Issue #17158: fix invalid javadoc position for compact constructor#17249
Conversation
|
@romani I suppose these tests are old and I must write tests as we write them now for branch coverage purposes right? |
|
yes, we need coverage for new code in this PR thought Inputs and real Check usage. pure junit testing as you see it, does not contribute much to quality, as they migh be unrealistic and just test code for main code. One day in future we will convert all such pure unit testing to ent-to-end (Input based testing) |
428a453 to
1692554
Compare
|
Github, generate report for InvalidJavadocPosition/all-examples-in-one |
There was a problem hiding this comment.
Just to be on the safe side, please also add this input case so we can ensure that no new false positive is introduced:
PS: If you use a canonical constructor instead of a compact constructor, the error goes away. Similarly, if you use public accessibility instead of package-protected, the error goes away.
|
Report for InvalidJavadocPosition/all-examples-in-one: |
1692554 to
b4fcf7a
Compare
412876d to
eeebf7b
Compare
|
Github, generate report for InvalidJavadocPosition/all-examples-in-one |
|
Report for InvalidJavadocPosition/all-examples-in-one: |
eeebf7b to
a57a335
Compare
|
Github, generate report for InvalidJavadocPosition/all-examples-in-one |
|
Report for InvalidJavadocPosition/all-examples-in-one: |
Zopsss
left a comment
There was a problem hiding this comment.
please add below suggested cases to the Check's input files too.
| Mapping(String from, String to) { | ||
| this.from = from; | ||
| this.to = to; | ||
| } |
There was a problem hiding this comment.
please also add a canonical constructor with public modifier
| @SizeType(max = 1) | ||
| BindMount {} |
There was a problem hiding this comment.
please also use public keyword with compact constructor. Similarly for canonical constructor with annotation, create two cases - one with public modifier and other without any modifier.
There was a problem hiding this comment.
can you also create a top-level record class? it is not necessary but it is always good to have all the cases covered
|
@mohitsatr let's resume working on this PR. It is almost ready to merge, only few changes are required :) |
a57a335 to
4d44910
Compare
4d44910 to
3bd4c48
Compare
| public record Mapping2(String to) { | ||
|
|
||
| /** | ||
| * The constructor for Mapping. | ||
| * | ||
| * @param to The source | ||
| */ | ||
| @SizeType(max = 3) | ||
| public Mapping2(String to) { | ||
| this.to = to; | ||
| } | ||
| } |
There was a problem hiding this comment.
The input file is for compact constructors but we have used canonical constructor here. I would suggest to split examples into 2 files - one for compact constructors and second for canonical constructor.
Sorry for asking this but it will make the inputs more manageable and it will also simplify the process of adding more cases in future for other contributors.
There was a problem hiding this comment.
Sorry for asking this but it will make the inputs more manageable
no it does make sense.
3bd4c48 to
c48f2e5
Compare
…or compact constructor
c48f2e5 to
7781f15
Compare
fixes #17158