Skip to content

Commit 6511e30

Browse files
committed
Consistent declaration of if-blocks
1 parent c848ed3 commit 6511e30

12 files changed

+35
-18
lines changed

junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/AnnotationBasedArgumentConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public AnnotationBasedArgumentConverter() {
4545
@Override
4646
public final void accept(A annotation) {
4747
this.annotation = Preconditions.notNull(annotation, "annotation must not be null");
48-
;
48+
4949
}
5050

5151
@Override

junit-platform-engine/src/main/java/org/junit/platform/engine/DefaultDiscoveryIssue.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public Optional<Throwable> cause() {
5959

6060
@Override
6161
public boolean equals(Object o) {
62-
if (o == null || getClass() != o.getClass())
62+
if (o == null || getClass() != o.getClass()) {
6363
return false;
64+
}
6465
DefaultDiscoveryIssue that = (DefaultDiscoveryIssue) o;
6566
return this.severity == that.severity //
6667
&& Objects.equals(this.message, that.message) //

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ void beforeMethodOfBothRule2WasExecuted() {
8080
static void afterMethodsOfBothRulesWereExecuted() {
8181
assertEquals(1, numberOfRule1InstancesCreated);
8282
assertEquals(1, numberOfRule2InstancesCreated);
83-
if (!afterOfRule1WasExecuted)
83+
if (!afterOfRule1WasExecuted) {
8484
fail();
85-
if (!afterOfRule2WasExecuted)
85+
}
86+
if (!afterOfRule2WasExecuted) {
8687
fail();
88+
}
8789
}
8890

8991
}

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ void beforeMethodsOfBothRulesWereExecuted() {
5757

5858
@AfterAll
5959
static void afterMethodsOfBothRulesWereExecuted() {
60-
if (!afterOfRule1WasExecuted)
60+
if (!afterOfRule1WasExecuted) {
6161
fail();
62-
if (!afterOfRule2WasExecuted)
62+
}
63+
if (!afterOfRule2WasExecuted) {
6364
fail();
65+
}
6466
}
6567

6668
private static class MyExternalResource1 extends ExternalResource {

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ void constructorsAndBeforeEachMethodsOfAllRulesWereExecuted() {
7070
@AfterAll
7171
static void afterMethodsOfAllRulesWereExecuted() {
7272
// beforeEach methods of rules from methods are run before those from fields but in reverse order
73-
if (!asList(initEvents.get(2), initEvents.get(3), initEvents.get(0), initEvents.get(1)).equals(afterEvents))
73+
if (!asList(initEvents.get(2), initEvents.get(3), initEvents.get(0), initEvents.get(1)).equals(afterEvents)) {
7474
fail();
75+
}
7576
}
7677

7778
static class MyExternalResource extends ExternalResource {

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ void beforeMethodsOfBothRulesWereExecuted() {
6262

6363
@AfterAll
6464
static void afterMethodsOfBothRulesWereExecuted() {
65-
if (!afterOfRule1WasExecuted)
65+
if (!afterOfRule1WasExecuted) {
6666
fail();
67-
if (!afterOfRule2WasExecuted)
67+
}
68+
if (!afterOfRule2WasExecuted) {
6869
fail();
70+
}
6971
}
7072

7173
}

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ void beforeMethodsOfBothRulesWereExecuted() {
6666

6767
@AfterAll
6868
static void afterMethodsOfBothRulesWereExecuted() {
69-
if (!afterOfRule1WasExecuted)
69+
if (!afterOfRule1WasExecuted) {
7070
fail();
71-
if (!afterOfRule2WasExecuted)
71+
}
72+
if (!afterOfRule2WasExecuted) {
7273
fail();
74+
}
7375
}
7476

7577
}

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ void testNothing() {
5353

5454
@AfterAll
5555
static void afterMethodsOfBothRulesWereExecuted() {
56-
if (!afterOfRule1WasExecuted)
56+
if (!afterOfRule1WasExecuted) {
5757
fail();
58-
if (!afterOfRule2WasExecuted)
58+
}
59+
if (!afterOfRule2WasExecuted) {
5960
fail();
61+
}
6062
}
6163

6264
}

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ void testNothing() {
3939

4040
@AfterAll
4141
static void afterMethodOfRuleWasNotExecuted() {
42-
if (afterOfRule1WasExecuted)
42+
if (afterOfRule1WasExecuted) {
4343
fail();
44+
}
4445
}
4546

4647
}

jupiter-tests/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ void testNothing() {
4343

4444
@AfterAll
4545
static void afterMethodsOfBothRulesWereExecuted() {
46-
if (afterOfRule1WasExecuted)
46+
if (afterOfRule1WasExecuted) {
4747
fail();
48+
}
4849
}
4950

5051
}

0 commit comments

Comments
 (0)