Skip to content

Commit

Permalink
Use curly braces for if statements (#5034)
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Jan 31, 2022
1 parent 151bf10 commit f7e9878
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ public DisbarUseTest(List<File> 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[] {};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public LockTest(List<File> 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"};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ public NullnessRecordsTest(List<File> 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[] {};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public StubparserRecordTest(List<File> 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[] {};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f7e9878

Please sign in to comment.