From 15b33925c09c092d1e2ecc5e7ec6a5d53f228990 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Sat, 29 Sep 2012 22:25:09 +0200 Subject: [PATCH] Fixed a couple of minor bugs. --- .../com/comphenix/protocol/injector/PrioritizedListener.java | 5 +++++ .../protocol/reflect/compiler/StructureCompiler.java | 5 +++-- .../protocol/reflect/instances/DefaultInstances.java | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ProtocolLib/src/com/comphenix/protocol/injector/PrioritizedListener.java b/ProtocolLib/src/com/comphenix/protocol/injector/PrioritizedListener.java index 017aadea..2d971206 100644 --- a/ProtocolLib/src/com/comphenix/protocol/injector/PrioritizedListener.java +++ b/ProtocolLib/src/com/comphenix/protocol/injector/PrioritizedListener.java @@ -41,6 +41,11 @@ public class PrioritizedListener implements Comparable[] { String.class, byte[].class, int.class, int.class }); // Awesome. Now, create and return it. - defineMethod.setAccessible(true); + defined.setAccessible(true); + defineMethod = defined; } @SuppressWarnings("rawtypes") diff --git a/ProtocolLib/src/com/comphenix/protocol/reflect/instances/DefaultInstances.java b/ProtocolLib/src/com/comphenix/protocol/reflect/instances/DefaultInstances.java index 0e548ff0..7b846077 100644 --- a/ProtocolLib/src/com/comphenix/protocol/reflect/instances/DefaultInstances.java +++ b/ProtocolLib/src/com/comphenix/protocol/reflect/instances/DefaultInstances.java @@ -172,11 +172,11 @@ public class DefaultInstances { } Constructor minimum = getMinimumConstructor(type); - int parameterCount = minimum.getParameterTypes().length; // Create the type with this constructor using default values. This might fail, though. try { if (minimum != null) { + int parameterCount = minimum.getParameterTypes().length; Object[] params = new Object[parameterCount]; Class[] types = minimum.getParameterTypes();