From a7ba34065b778019cf8eeeddacd523a7d82f234b Mon Sep 17 00:00:00 2001 From: FrozenCow Date: Thu, 19 May 2011 03:18:20 +0200 Subject: [PATCH] Fixed arguments for createInstance. --- src/main/java/org/dynmap/ConfigurationNode.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/dynmap/ConfigurationNode.java b/src/main/java/org/dynmap/ConfigurationNode.java index 139924f7..a1f094d4 100644 --- a/src/main/java/org/dynmap/ConfigurationNode.java +++ b/src/main/java/org/dynmap/ConfigurationNode.java @@ -157,9 +157,11 @@ public class ConfigurationNode implements Map { Class mapTypeClass = Class.forName(typeName); Class[] constructorParameterWithConfiguration = new Class[constructorParameters.length+1]; + for(int i = 0; i < constructorParameters.length; i++) { constructorParameterWithConfiguration[i] = constructorParameters[i]; } constructorParameterWithConfiguration[constructorParameterWithConfiguration.length-1] = ConfigurationNode.class; Object[] constructorArgumentsWithConfiguration = new Object[constructorArguments.length+1]; + for(int i = 0; i < constructorArguments.length; i++) { constructorArgumentsWithConfiguration[i] = constructorArguments[i]; } constructorArgumentsWithConfiguration[constructorArgumentsWithConfiguration.length-1] = this; Constructor constructor = mapTypeClass.getConstructor(constructorParameterWithConfiguration); @SuppressWarnings("unchecked")