mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +01:00
Fixed a couple of minor bugs.
This commit is contained in:
parent
721d92bd4f
commit
15b33925c0
@ -41,6 +41,11 @@ public class PrioritizedListener<TListener> implements Comparable<PrioritizedLis
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the underlying listener.
|
||||
* @return Underlying listener.
|
||||
|
@ -206,11 +206,12 @@ public final class StructureCompiler {
|
||||
// Call the define method
|
||||
try {
|
||||
if (defineMethod == null) {
|
||||
defineMethod = ClassLoader.class.getDeclaredMethod("defineClass",
|
||||
Method defined = ClassLoader.class.getDeclaredMethod("defineClass",
|
||||
new Class<?>[] { String.class, byte[].class, int.class, int.class });
|
||||
|
||||
// Awesome. Now, create and return it.
|
||||
defineMethod.setAccessible(true);
|
||||
defined.setAccessible(true);
|
||||
defineMethod = defined;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
@ -172,11 +172,11 @@ public class DefaultInstances {
|
||||
}
|
||||
|
||||
Constructor<T> 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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user