From 2ad944d907492436690d91ab71c80c14040e5f10 Mon Sep 17 00:00:00 2001 From: "Marc R. Hoffmann" Date: Tue, 19 May 2020 20:16:51 +0200 Subject: [PATCH] Fix validation test for Java 15 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. --- .../core/test/validation/java14/targets/RecordsTarget.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.jacoco.core.test.validation.java14/src/org/jacoco/core/test/validation/java14/targets/RecordsTarget.java b/org.jacoco.core.test.validation.java14/src/org/jacoco/core/test/validation/java14/targets/RecordsTarget.java index da2b8804c6..b203b84aa9 100644 --- a/org.jacoco.core.test.validation.java14/src/org/jacoco/core/test/validation/java14/targets/RecordsTarget.java +++ b/org.jacoco.core.test.validation.java14/src/org/jacoco/core/test/validation/java14/targets/RecordsTarget.java @@ -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() }