Skip to content

Commit 46dad6e

Browse files
committed
Simplified the if statements
1 parent 54eb438 commit 46dad6e

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

strongback-tests/src/org/strongback/command/CommandGroupTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
package org.strongback.command;
1818

19-
import static org.fest.assertions.Assertions.assertThat;
19+
import org.junit.Before;
20+
import org.junit.Test;
21+
import org.strongback.Logger;
2022

2123
import java.util.Arrays;
2224
import java.util.LinkedList;
2325
import java.util.List;
2426
import java.util.Queue;
2527

26-
import org.junit.Before;
27-
import org.junit.Test;
28-
import org.strongback.Logger;
28+
import static org.fest.assertions.Assertions.assertThat;
2929

3030
public class CommandGroupTest {
3131
private Scheduler scheduler;

strongback/src/org/strongback/command/CommandGroup.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,11 @@ private CommandGroup(Command[] commands, Type type) {
151151
}
152152

153153
Type getType() {
154-
if (root != null) {
155-
return root.type;
156-
} else {
157-
return type;
158-
}
154+
return root != null ? root.type : type;
159155
}
160156

161157
Command[] getCommands() {
162-
if (root != null) {
163-
return root.getCommands();
164-
} else {
165-
return commands;
166-
}
158+
return root != null ? root.getCommands() : commands;
167159
}
168160

169161
/**

0 commit comments

Comments
 (0)