Skip to content

Commit

Permalink
Fix validation test for Java 15 (#1052)
Browse files Browse the repository at this point in the history
With second preview the constructors of records now get the same access
modifier than the class (see JDK-8242479).

For "record WithoutFields" this leads to an private empty default
constructor which is filtered out by PrivateEmptyNoArgConstructorFilter.

Removing private modifiers from records to have consistent results
between first and second preview.
  • Loading branch information
marchof committed May 19, 2020
1 parent c53d987 commit d60a5b2
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -17,15 +17,15 @@
*/
public class RecordsTarget {

private record WithoutFields() { // assertFullyCovered()
record WithoutFields() { // assertFullyCovered()
}

private record WithFields( // assertPartlyCovered()
record WithFields( // assertPartlyCovered()
int x // assertEmpty()
) {
}

private record WithCustomMethods(int x) { // assertFullyCovered()
record WithCustomMethods(int x) { // assertFullyCovered()
public int x() {
return x; // assertNotCovered()
}
Expand Down

0 comments on commit d60a5b2

Please sign in to comment.