Skip to content

Commit

Permalink
Added some missing curlies that made SonarLint angry
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabuzard committed Jan 19, 2022
1 parent 1a88fab commit 0608574
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ public void updateStatusFor(@NotNull Guild guild) {
}
long channelId = guildIdToStatusChannel.get(guild.getIdLong());
TextChannel channel = guild.getTextChannelById(channelId);
if (channel == null)
if (channel == null) {
throw new IllegalStateException("Status channel %d does not exist in guild %s"
.formatted(channelId, guild.getName()));
}
return channel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ public synchronized void setFree() {
public boolean equals(final Object o) {
// TODO should I overload equals with equals(long) so that a Set may be used instead of a
// Map
if (this == o)
if (this == o) {
return true;
if (o == null || getClass() != o.getClass())
}
if (o == null || getClass() != o.getClass()) {
return false;
}

ChannelStatus channelStatus = (ChannelStatus) o;
return channelId == channelStatus.channelId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ public Instant toInstant() {

@Override
public boolean equals(Object o) {
if (!(o instanceof InstantWrapper other))
if (!(o instanceof InstantWrapper other)) {
return false;
}

return epochSecond == other.epochSecond && nanoOfSecond != other.nanoOfSecond;
}
Expand Down

0 comments on commit 0608574

Please sign in to comment.