SteamWar/SpigotCore
Archiviert
13
0

„SpigotCore_Main/src/de/steamwar/command/SWCommand.java“ ändern
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
YoyoNow 2021-11-10 14:10:40 +01:00
Ursprung dba1df777a
Commit ad221d21f6

Datei anzeigen

@ -115,7 +115,7 @@ public abstract class SWCommand {
} }
String name = mapper != null ? mapper.value() : clazz.getTypeName(); String name = mapper != null ? mapper.value() : clazz.getTypeName();
if (!SWCommandUtils.MAPPER_FUNCTIONS.containsKey(name) && !localTypeMapper.containsKey(name)) { if (!SWCommandUtils.MAPPER_FUNCTIONS.containsKey(name) && !localTypeMapper.containsKey(name)) {
Bukkit.getLogger().log(Level.WARNING, "The parameter '" + parameter.toString() + "' is using an unsupported Mapper of type '" + name + "'"); Bukkit.getLogger().log(Level.WARNING, () -> "The parameter '" + parameter.toString() + "' is using an unsupported Mapper of type '" + name + "'");
return; return;
} }
} }
@ -142,15 +142,15 @@ public abstract class SWCommand {
Parameter[] parameters = method.getParameters(); Parameter[] parameters = method.getParameters();
if (!parameterTester.test(parameters.length)) { if (!parameterTester.test(parameters.length)) {
Bukkit.getLogger().log(Level.WARNING, "The method '" + method.toString() + "' is lacking parameters or has too many"); Bukkit.getLogger().log(Level.WARNING, () -> "The method '" + method.toString() + "' is lacking parameters or has too many");
return; return;
} }
if (firstParameter && !CommandSender.class.isAssignableFrom(parameters[0].getType())) { if (firstParameter && !CommandSender.class.isAssignableFrom(parameters[0].getType())) {
Bukkit.getLogger().log(Level.WARNING, "The method '" + method.toString() + "' is lacking the first parameter of type '" + CommandSender.class.getTypeName() + "'"); Bukkit.getLogger().log(Level.WARNING, () -> "The method '" + method.toString() + "' is lacking the first parameter of type '" + CommandSender.class.getTypeName() + "'");
return; return;
} }
if (returnType != null && method.getReturnType() != returnType) { if (returnType != null && method.getReturnType() != returnType) {
Bukkit.getLogger().log(Level.WARNING, "The method '" + method.toString() + "' is lacking the desired return type '" + returnType.getTypeName() + "'"); Bukkit.getLogger().log(Level.WARNING, () -> "The method '" + method.toString() + "' is lacking the desired return type '" + returnType.getTypeName() + "'");
return; return;
} }
Arrays.stream(anno).forEach(t -> consumer.accept(t, parameters)); Arrays.stream(anno).forEach(t -> consumer.accept(t, parameters));