diff --git a/checker/src/test/java/org/checkerframework/checker/test/junit/DisbarUseTest.java b/checker/src/test/java/org/checkerframework/checker/test/junit/DisbarUseTest.java index f804e80ae85..3e8904fc9c9 100644 --- a/checker/src/test/java/org/checkerframework/checker/test/junit/DisbarUseTest.java +++ b/checker/src/test/java/org/checkerframework/checker/test/junit/DisbarUseTest.java @@ -26,8 +26,10 @@ public DisbarUseTest(List testFiles) { @Parameters public static String[] getTestDirs() { // Check for JDK 16+ without using a library: - if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])\\..*")) + if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])\\..*")) { return new String[] {"disbaruse-records"}; - else return new String[] {}; + } else { + return new String[] {}; + } } } diff --git a/checker/src/test/java/org/checkerframework/checker/test/junit/LockTest.java b/checker/src/test/java/org/checkerframework/checker/test/junit/LockTest.java index 6ec8ce1a5fd..d3ec1d166ea 100644 --- a/checker/src/test/java/org/checkerframework/checker/test/junit/LockTest.java +++ b/checker/src/test/java/org/checkerframework/checker/test/junit/LockTest.java @@ -19,8 +19,10 @@ public LockTest(List testFiles) { @Parameters public static String[] getTestDirs() { // Check for JDK 16+ without using a library: - if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])\\..*")) + if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])\\..*")) { return new String[] {"lock", "lock-records", "all-systems"}; - else return new String[] {"lock", "all-systems"}; + } else { + return new String[] {"lock", "all-systems"}; + } } } diff --git a/checker/src/test/java/org/checkerframework/checker/test/junit/NullnessRecordsTest.java b/checker/src/test/java/org/checkerframework/checker/test/junit/NullnessRecordsTest.java index fafb8ddccc7..2bbba133307 100644 --- a/checker/src/test/java/org/checkerframework/checker/test/junit/NullnessRecordsTest.java +++ b/checker/src/test/java/org/checkerframework/checker/test/junit/NullnessRecordsTest.java @@ -28,8 +28,10 @@ public NullnessRecordsTest(List testFiles) { public static String[] getTestDirs() { // Check for JDK 16+ without using a library: // There is no decimal point in the JDK 17 version number. - if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])")) + if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])")) { return new String[] {"nullness-records"}; - else return new String[] {}; + } else { + return new String[] {}; + } } } diff --git a/checker/src/test/java/org/checkerframework/checker/test/junit/StubparserRecordTest.java b/checker/src/test/java/org/checkerframework/checker/test/junit/StubparserRecordTest.java index f1de05f25e0..b320b5fbb2b 100644 --- a/checker/src/test/java/org/checkerframework/checker/test/junit/StubparserRecordTest.java +++ b/checker/src/test/java/org/checkerframework/checker/test/junit/StubparserRecordTest.java @@ -27,8 +27,10 @@ public StubparserRecordTest(List testFiles) { public static String[] getTestDirs() { // Check for JDK 16+ without using a library: // There is no decimal point in the JDK 17 version number. - if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])")) + if (System.getProperty("java.version").matches("^(1[6-9]|[2-9][0-9])")) { return new String[] {"stubparser-records"}; - else return new String[] {}; + } else { + return new String[] {}; + } } } diff --git a/framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java b/framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java index 54388dde761..9b25f085303 100644 --- a/framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java +++ b/framework/src/main/java/org/checkerframework/framework/stub/AnnotationFileElementTypes.java @@ -462,8 +462,9 @@ public void injectRecordComponentType( // if there is no accessor in the stubs file: RecordComponentStub recordComponentStub = recordComponentType.componentsByName.get(elt.getSimpleName().toString()); - if (recordComponentStub != null && !recordComponentStub.hasAccessorInStubs()) + if (recordComponentStub != null && !recordComponentStub.hasAccessorInStubs()) { replaceAnnotations(memberType.getReturnType(), recordComponentStub.type); + } } } } else if (elt.getKind() == ElementKind.CONSTRUCTOR) {