Remove obsolete/unused findbugs-annotations

This commit is contained in:
md_5 2025-05-31 13:07:09 +10:00
parent 5dad41034b
commit aa44ebe770
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
22 changed files with 1 additions and 61 deletions

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.log;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
@ -13,13 +12,6 @@ public class BungeeLogger extends Logger
private final LogDispatcher dispatcher = new LogDispatcher( this );
// CHECKSTYLE:OFF
@SuppressWarnings(
{
"CallToPrintStackTrace", "CallToThreadStartDuringObjectConstruction"
})
// CHECKSTYLE:ON
@SuppressFBWarnings("SC_START_IN_CTOR")
public BungeeLogger(String loggerName, String filePattern, ConsoleReader reader)
{
super( loggerName, null );

View File

@ -18,7 +18,6 @@ public class ConciseFormatter extends Formatter
private final boolean coloured;
@Override
@SuppressWarnings("ThrowableResultIgnored")
public String format(LogRecord record)
{
StringBuilder formatted = new StringBuilder();

View File

@ -105,12 +105,6 @@
<version>33.3.1-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs-annotations</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>

View File

@ -6,7 +6,6 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelException;
@ -179,7 +178,6 @@ public class BungeeCord extends ProxyServer
private BungeeChannelInitializer serverInfoChannelInitializer;
};
@SuppressFBWarnings("DM_DEFAULT_ENCODING")
public BungeeCord() throws IOException
{
// Java uses ! to indicate a resource inside of a jar/zip/other container. Running Bungee from within a directory that has a ! will cause this to muck up.
@ -259,7 +257,6 @@ public class BungeeCord extends ProxyServer
*
* @throws Exception any critical errors encountered
*/
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
public void start() throws Exception
{
System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); // Seems to cause Bungee to stop accepting connections
@ -429,8 +426,6 @@ public class BungeeCord extends ProxyServer
}
// This must be run on a separate thread to avoid deadlock!
@SuppressFBWarnings("DM_EXIT")
@SuppressWarnings("TooBroadCatch")
private void independentThreadStop(final String reason, boolean callSystemExit)
{
// Acquire the shutdown lock

View File

@ -383,7 +383,6 @@ public final class UserConnection implements ProxiedPlayer
ChannelFutureListener listener = new ChannelFutureListener()
{
@Override
@SuppressWarnings("ThrowableResultIgnored")
public void operationComplete(ChannelFuture future) throws Exception
{
if ( callback != null )

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.conf;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -230,7 +229,6 @@ public class YamlConfig implements ConfigurationAdapter
@Override
@SuppressWarnings("unchecked")
@SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE")
public Collection<ListenerInfo> getListeners()
{
Collection<Map<String, Object>> base = get( "listeners", (Collection) Arrays.asList( new Map[]
@ -305,7 +303,7 @@ public class YamlConfig implements ConfigurationAdapter
Map<String, Collection<String>> raw = get( "groups", Collections.emptyMap() );
Collection<String> groups = raw.get( player );
Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
Collection<String> ret = ( groups == null ) ? new HashSet<>() : new HashSet<>( groups );
ret.add( "default" );
return ret;
}

View File

@ -1,7 +1,6 @@
package net.md_5.bungee.connection;
import com.google.gson.Gson;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.RequiredArgsConstructor;
import net.md_5.bungee.BungeeServerInfo;
import net.md_5.bungee.PlayerInfoSerializer;
@ -67,7 +66,6 @@ public class PingHandler extends PacketHandler
}
@Override
@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public void handle(StatusResponse statusResponse) throws Exception
{
ServerPing serverPing = gson.fromJson( statusResponse.getResponse(), ServerPing.class );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import java.io.DataInputStream;
@ -140,7 +139,6 @@ public abstract class EntityMap
}
}
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
protected static void rewriteVarInt(ByteBuf packet, int oldId, int newId, int offset)
{
// Need to rewrite the packet because VarInts are variable length

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_10 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_11 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_12 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_12_1 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_13 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -46,7 +45,6 @@ class EntityMap_1_14 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -46,7 +45,6 @@ class EntityMap_1_15 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -46,7 +45,6 @@ class EntityMap_1_16 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import lombok.AccessLevel;
@ -25,7 +24,6 @@ class EntityMap_1_16_2 extends EntityMap
private final int spectateId;
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
{
if ( spawnPlayerId == -1 )

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -48,7 +47,6 @@ class EntityMap_1_8 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_9 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.entitymap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.md_5.bungee.BungeeCord;
@ -47,7 +46,6 @@ class EntityMap_1_9_4 extends EntityMap
}
@Override
@SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
public void rewriteClientbound(ByteBuf packet, int oldId, int newId)
{
super.rewriteClientbound( packet, oldId, newId );

View File

@ -29,7 +29,6 @@ public class HttpClient
public static final int TIMEOUT = 5000;
private static final Cache<String, InetAddress> addressCache = CacheBuilder.newBuilder().expireAfterWrite( 1, TimeUnit.MINUTES ).build();
@SuppressWarnings("UnusedAssignment")
public static void get(String url, EventLoop eventLoop, final Callback<String> callback)
{
Preconditions.checkNotNull( url, "url" );

View File

@ -1,7 +1,6 @@
package net.md_5.bungee.module;
import com.google.common.base.Preconditions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
@ -31,12 +30,6 @@ public class ModuleManager
knownSources.put( "jenkins", new JenkinsModuleSource() );
}
// CHECKSTYLE:OFF
@SuppressFBWarnings(
{
"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"
})
// CHECKSTYLE:ON
public void load(ProxyServer proxy, File moduleDirectory) throws Exception
{
moduleDirectory.mkdir();
@ -132,7 +125,6 @@ public class ModuleManager
}
}
@SuppressFBWarnings("REC_CATCH_EXCEPTION")
private ModuleVersion getVersion(File file)
{
try ( JarFile jar = new JarFile( file ) )