Skip to content

Commit

Permalink
Add braces to inlined if-statements
Browse files Browse the repository at this point in the history
Other one line if statements do have `{ }`, so these were inconsistent.
  • Loading branch information
willkroboth committed Oct 16, 2024
1 parent a3e38e7 commit d7987b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public static MockCommandAPIPlugin load(Consumer<CommandAPIBukkitConfig> configu
public void onLoad() {
CommandAPIBukkitConfig config = new CommandAPIBukkitConfig(this);

if (configureSettings != null) configureSettings.accept(config);
if (configureSettings != null) {
configureSettings.accept(config);
}
configureSettings = null; // Reset to avoid configs persisting between tests

CommandAPI.onLoad(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public static Message translatedMessage(String key, Object... args) {
*/
public static Parser.Literal assertCanRead(Function<StringReader, CommandSyntaxException> exception) {
return reader -> {
if (!reader.canRead()) throw exception.apply(reader);
if (!reader.canRead()) {
throw exception.apply(reader);
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public interface Parser<T> {
*/
default T parse(StringReader reader) throws CommandSyntaxException {
Result<T> result = getResult(reader);
if (result.exception != null) throw result.exception;
if (result.exception != null) {
throw result.exception;
}
return result.value;
}

Expand Down

0 comments on commit d7987b2

Please sign in to comment.