Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Fix Checkstyle errors and update geriatric Checkstyle version
Dieser Commit ist enthalten in:
Ursprung
ba7ba70f4b
Commit
3a51bee052
@ -3,7 +3,6 @@ package com.velocitypowered.api.event.player;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.api.proxy.connection.Player;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.velocitypowered.api.proxy.connection;
|
||||
|
||||
import com.velocitypowered.api.network.ProtocolVersion;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Optional;
|
||||
|
@ -11,7 +11,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
|
@ -13,7 +13,7 @@ class QueryResponseTest {
|
||||
QueryResponse response = new QueryResponse("test", "test", "test",
|
||||
1, 2, "test", 1234, ImmutableList.of("tuxed"),
|
||||
"0.0.1", ImmutableList.of(new PluginInformation("test", "1.0.0"),
|
||||
new PluginInformation("test2", null)));
|
||||
new PluginInformation("test2", null)));
|
||||
assertEquals(response, response.toBuilder().build());
|
||||
}
|
||||
}
|
@ -31,6 +31,12 @@
|
||||
<property name="file" value="${configDirectory}/suppressions.xml"/>
|
||||
</module>
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="max" value="150"/>
|
||||
<property name="ignorePattern"
|
||||
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<!-- <module name="IllegalTokenText">
|
||||
@ -45,11 +51,6 @@
|
||||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="LineLength">
|
||||
<property name="max" value="150"/>
|
||||
<property name="ignorePattern"
|
||||
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="NoLineWrap"/>
|
||||
@ -238,11 +239,8 @@
|
||||
<module name="JavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
|
@ -1,7 +1,7 @@
|
||||
checkstyle {
|
||||
def configDirectory = new File(project.rootDir, ["config", "checkstyle"].join(File.separator))
|
||||
|
||||
toolVersion '8.14'
|
||||
toolVersion '8.39'
|
||||
configFile new File(configDirectory, "checkstyle.xml")
|
||||
configProperties = [configDirectory: configDirectory.getAbsolutePath()]
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.velocitypowered.proxy;
|
||||
|
||||
import com.velocitypowered.proxy.config.VelocityConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
@ -9,7 +8,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bstats.MetricsBase;
|
||||
|
@ -3,7 +3,6 @@ package com.velocitypowered.proxy.command.builtin;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import com.google.gson.JsonArray;
|
||||
@ -20,7 +19,6 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import com.velocitypowered.api.util.ProxyVersion;
|
||||
import com.velocitypowered.proxy.VelocityServer;
|
||||
import com.velocitypowered.proxy.util.InformationUtils;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -31,7 +29,6 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
|
@ -11,12 +11,10 @@ import com.google.gson.annotations.Expose;
|
||||
import com.velocitypowered.api.proxy.config.ProxyConfig;
|
||||
import com.velocitypowered.api.util.Favicon;
|
||||
import com.velocitypowered.proxy.util.AddressUtil;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -3,11 +3,9 @@ package com.velocitypowered.proxy.connection.registry;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.velocitypowered.api.network.ProtocolVersion;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.kyori.adventure.nbt.BinaryTag;
|
||||
import net.kyori.adventure.nbt.BinaryTagTypes;
|
||||
import net.kyori.adventure.nbt.CompoundBinaryTag;
|
||||
|
@ -15,7 +15,6 @@ import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import io.netty.handler.codec.DecoderException;
|
||||
import io.netty.handler.codec.EncoderException;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
@ -23,7 +22,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.kyori.adventure.nbt.BinaryTagIO;
|
||||
import net.kyori.adventure.nbt.CompoundBinaryTag;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
|
@ -12,6 +12,7 @@ public abstract class AbstractStatusPingPacket implements Packet {
|
||||
return factory.apply(randomId);
|
||||
};
|
||||
}
|
||||
|
||||
protected static <P extends AbstractStatusPingPacket> PacketWriter<P> encoder() {
|
||||
return (buf, packet, version) -> buf.writeLong(packet.getRandomId());
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public class ClientboundStatusResponsePacket implements Packet {
|
||||
return new ClientboundStatusResponsePacket(status);
|
||||
};
|
||||
public static final PacketWriter<ClientboundStatusResponsePacket> ENCODER = (buf, packet, version) ->
|
||||
ProtocolUtils.writeString(buf, packet.status);
|
||||
ProtocolUtils.writeString(buf, packet.status);
|
||||
|
||||
private final @Nullable CharSequence status;
|
||||
|
||||
|
@ -13,7 +13,7 @@ public class ServerboundChatPacket implements Packet {
|
||||
return new ServerboundChatPacket(message);
|
||||
};
|
||||
public static final PacketWriter<ServerboundChatPacket> ENCODER = (buf, packet, version) ->
|
||||
ProtocolUtils.writeString(buf, packet.message);
|
||||
ProtocolUtils.writeString(buf, packet.message);
|
||||
|
||||
public static final int MAX_MESSAGE_LENGTH = 256;
|
||||
|
||||
|
@ -1,14 +1,12 @@
|
||||
package com.velocitypowered.proxy.network.packet.serverbound;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.velocitypowered.api.network.ProtocolVersion;
|
||||
import com.velocitypowered.proxy.network.ProtocolUtils;
|
||||
import com.velocitypowered.proxy.network.packet.Packet;
|
||||
import com.velocitypowered.proxy.network.packet.PacketHandler;
|
||||
import com.velocitypowered.proxy.network.packet.PacketReader;
|
||||
import com.velocitypowered.proxy.network.packet.PacketWriter;
|
||||
import com.velocitypowered.proxy.util.except.QuietDecoderException;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ServerboundServerLoginPacket implements Packet {
|
||||
@ -21,8 +19,9 @@ public class ServerboundServerLoginPacket implements Packet {
|
||||
}
|
||||
return new ServerboundServerLoginPacket(username);
|
||||
};
|
||||
|
||||
public static final PacketWriter<ServerboundServerLoginPacket> ENCODER = (buf, packet, version) ->
|
||||
ProtocolUtils.writeString(buf, packet.username);
|
||||
ProtocolUtils.writeString(buf, packet.username);
|
||||
|
||||
private final String username;
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class VelocityPluginManager implements PluginManager {
|
||||
for (PluginContainer container : pluginContainers.keySet()) {
|
||||
bind(PluginContainer.class)
|
||||
.annotatedWith(Names.named(container.getDescription().getId()))
|
||||
.toInstance(container);
|
||||
.toInstance(container);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -15,7 +15,6 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.config.ProxyConfig;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import com.velocitypowered.api.util.ProxyVersion;
|
||||
|
||||
import io.netty.channel.unix.DomainSocketAddress;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren