Archiviert
13
0

Fixed a couple of bugs discovered by FindBugs.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-02-19 17:25:59 +01:00
Ursprung bf443be0d3
Commit 9b0fe540c2
3 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -96,6 +96,9 @@ public class PacketContainer implements Serializable {
andThen(new Function<BuilderParameters, Cloner>() { andThen(new Function<BuilderParameters, Cloner>() {
@Override @Override
public Cloner apply(@Nullable BuilderParameters param) { public Cloner apply(@Nullable BuilderParameters param) {
if (param == null)
throw new IllegalArgumentException("Cannot be NULL.");
return new FieldCloner(param.getAggregateCloner(), param.getInstanceProvider()) {{ return new FieldCloner(param.getAggregateCloner(), param.getInstanceProvider()) {{
// Use a default writer with no concept of cloning // Use a default writer with no concept of cloning
writer = new ObjectWriter(); writer = new ObjectWriter();

Datei anzeigen

@ -54,7 +54,7 @@ public class NetworkObjectInjector extends PlayerInjector {
private ClassLoader classLoader; private ClassLoader classLoader;
// Shared callback filter - avoid creating a new class every time // Shared callback filter - avoid creating a new class every time
private static CallbackFilter callbackFilter; private volatile static CallbackFilter callbackFilter;
// Temporary player factory // Temporary player factory
private static volatile TemporaryPlayerFactory tempPlayerFactory; private static volatile TemporaryPlayerFactory tempPlayerFactory;

Datei anzeigen

@ -349,7 +349,7 @@ public class SpigotPacketInjector implements SpigotPacketListener {
public Object packetQueued(Object networkManager, Object connection, Object packet) { public Object packetQueued(Object networkManager, Object connection, Object packet) {
Integer id = invoker.getPacketID(packet); Integer id = invoker.getPacketID(packet);
if (id != null & queuedFilters.contains(id)) { if (id != null && queuedFilters.contains(id)) {
// Check for ignored packets // Check for ignored packets
if (ignoredPackets.remove(packet)) { if (ignoredPackets.remove(packet)) {
return packet; return packet;