Add explict this checkstyle rule and fix violations
This commit is contained in:
parent
a6eb44376c
commit
d5259dfbe4
62 changed files with 195 additions and 192 deletions
|
|
@ -77,7 +77,7 @@ public class JDACommandListener<C> extends ListenerAdapter {
|
|||
|
||||
content = content.substring(prefix.length());
|
||||
|
||||
commandManager.executeCommand(sender, content)
|
||||
this.commandManager.executeCommand(sender, content)
|
||||
.whenComplete((commandResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class JDACommandManager<C> extends CommandManager<C> {
|
|||
* @return JDA instance
|
||||
*/
|
||||
public final @NonNull JDA getJDA() {
|
||||
return jda;
|
||||
return this.jda;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
* @return List of Modes
|
||||
*/
|
||||
public @NotNull Set<ParserMode> getModes() {
|
||||
return modes;
|
||||
return this.modes;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
*/
|
||||
@Override
|
||||
public @NonNull ChannelArgument<C> build() {
|
||||
return new ChannelArgument<>(this.isRequired(), this.getName(), modes);
|
||||
return new ChannelArgument<>(this.isRequired(), this.getName(), this.modes);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
return ArgumentParseResult.failure(new IllegalArgumentException("Channel arguments can only be parsed in guilds"));
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.MENTION)) {
|
||||
if (this.modes.contains(ParserMode.MENTION)) {
|
||||
if (input.startsWith("<#") && input.endsWith(">")) {
|
||||
final String id = input.substring(2, input.length() - 1);
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.ID)) {
|
||||
if (this.modes.contains(ParserMode.ID)) {
|
||||
try {
|
||||
final ArgumentParseResult<MessageChannel> result = this.channelFromId(event, input, input);
|
||||
inputQueue.remove();
|
||||
|
|
@ -211,7 +211,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.NAME)) {
|
||||
if (this.modes.contains(ParserMode.NAME)) {
|
||||
final List<TextChannel> channels = event.getGuild().getTextChannelsByName(input, true);
|
||||
|
||||
if (channels.size() == 0) {
|
||||
|
|
@ -271,7 +271,7 @@ public final class ChannelArgument<C> extends CommandArgument<C, MessageChannel>
|
|||
* @return users input
|
||||
*/
|
||||
public final @NonNull String getInput() {
|
||||
return input;
|
||||
return this.input;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
* @return List of Modes
|
||||
*/
|
||||
public @NotNull Set<ParserMode> getModes() {
|
||||
return modes;
|
||||
return this.modes;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
*/
|
||||
@Override
|
||||
public @NonNull RoleArgument<C> build() {
|
||||
return new RoleArgument<>(this.isRequired(), this.getName(), modes);
|
||||
return new RoleArgument<>(this.isRequired(), this.getName(), this.modes);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
return ArgumentParseResult.failure(new IllegalArgumentException("Role arguments can only be parsed in guilds"));
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.MENTION)) {
|
||||
if (this.modes.contains(ParserMode.MENTION)) {
|
||||
if (input.startsWith("<@&") && input.endsWith(">")) {
|
||||
final String id = input.substring(3, input.length() - 1);
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.ID)) {
|
||||
if (this.modes.contains(ParserMode.ID)) {
|
||||
try {
|
||||
final ArgumentParseResult<Role> result = this.roleFromId(event, input, input);
|
||||
inputQueue.remove();
|
||||
|
|
@ -211,7 +211,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.NAME)) {
|
||||
if (this.modes.contains(ParserMode.NAME)) {
|
||||
final List<Role> roles = event.getGuild().getRolesByName(input, true);
|
||||
|
||||
if (roles.size() == 0) {
|
||||
|
|
@ -271,7 +271,7 @@ public final class RoleArgument<C> extends CommandArgument<C, Role> {
|
|||
* @return users input
|
||||
*/
|
||||
public final @NonNull String getInput() {
|
||||
return input;
|
||||
return this.input;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
* @return List of Modes
|
||||
*/
|
||||
public @NotNull Set<ParserMode> getModes() {
|
||||
return modes;
|
||||
return this.modes;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
*/
|
||||
@Override
|
||||
public @NonNull UserArgument<C> build() {
|
||||
return new UserArgument<>(this.isRequired(), this.getName(), modes, isolationLevel);
|
||||
return new UserArgument<>(this.isRequired(), this.getName(), this.modes, this.isolationLevel);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
final MessageReceivedEvent event = commandContext.get("MessageReceivedEvent");
|
||||
Exception exception = null;
|
||||
|
||||
if (modes.contains(ParserMode.MENTION)) {
|
||||
if (this.modes.contains(ParserMode.MENTION)) {
|
||||
if (input.startsWith("<@") && input.endsWith(">")) {
|
||||
final String id;
|
||||
if (input.startsWith("<@!")) {
|
||||
|
|
@ -251,7 +251,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.ID)) {
|
||||
if (this.modes.contains(ParserMode.ID)) {
|
||||
try {
|
||||
final ArgumentParseResult<User> result = this.userFromId(event, input, input);
|
||||
inputQueue.remove();
|
||||
|
|
@ -261,10 +261,10 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
}
|
||||
}
|
||||
|
||||
if (modes.contains(ParserMode.NAME)) {
|
||||
if (this.modes.contains(ParserMode.NAME)) {
|
||||
final List<User> users;
|
||||
|
||||
if (isolationLevel == Isolation.GLOBAL) {
|
||||
if (this.isolationLevel == Isolation.GLOBAL) {
|
||||
users = event.getJDA().getUsersByName(input, true);
|
||||
} else if (event.isFromGuild()) {
|
||||
users = event.getGuild().getMembersByEffectiveName(input, true)
|
||||
|
|
@ -302,7 +302,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
)
|
||||
throws UserNotFoundParseException, NumberFormatException {
|
||||
final User user;
|
||||
if (isolationLevel == Isolation.GLOBAL) {
|
||||
if (this.isolationLevel == Isolation.GLOBAL) {
|
||||
user = event.getJDA().getUserById(id);
|
||||
} else if (event.isFromGuild()) {
|
||||
Member member = event.getGuild().getMemberById(id);
|
||||
|
|
@ -344,7 +344,7 @@ public final class UserArgument<C> extends CommandArgument<C, User> {
|
|||
* @return Users input
|
||||
*/
|
||||
public final @NonNull String getInput() {
|
||||
return input;
|
||||
return this.input;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue