CommandHelper

CommandHelper

46.5k Downloads

stacktrace with yml_encode

LadyCailinBot opened this issue ยท 1 comments

commented

CMDHELPER-2770 - Reported by Hekta

I got this stacktrace with this script, I was testing how different types of values are encoded in a yml.

chd_write('test.yml',
yml_encode(associative_array('a': 0, 'b': 1, 'c': -1, 'd': 0.5, 'e': -2.33, 'f': 'f', 'g': 'g g', 'h': array(), 'i': array(0, 1, 2), 'j': associative_array(), 'k': associative_array('a': 0, 'b': 1, 'c': 2), 'l': cslice(0, 10), 'm': closure(return(player())), 'n': closure(@t, return(@t)), 'o': null, 'p': '', 'q': true))
)

Please report this error to the developers, and be sure to include the version numbers: Server version: 1.6.2-R0.2-SNAPSHOT; CommandHelper version: 1628-32b6dcf. Here's the stacktrace:
java.lang.ClassCastException: com.laytonsmith.core.constructs.CClosure cannot be cast to a POJO
at com.laytonsmith.core.constructs.Construct.GetPOJO(Construct.java:352)
at com.laytonsmith.core.constructs.Construct.GetPOJO(Construct.java:340)
at com.laytonsmith.core.functions.DataTransformations$yml_encode.exec(DataTransformations.java:150)
at com.laytonsmith.core.Script.eval(Script.java:301)
at com.laytonsmith.core.Script.eval(Script.java:265)
at com.laytonsmith.core.Script.eval(Script.java:265)
at com.laytonsmith.core.Script.seval(Script.java:211)
at com.laytonsmith.core.functions.Meta$eval.execs(Meta.java:407)
at com.laytonsmith.core.Script.eval(Script.java:257)
at com.laytonsmith.core.Script.eval(Script.java:265)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1489)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1454)
at com.laytonsmith.core.Script.run(Script.java:165)
at com.laytonsmith.core.AliasCore.alias(AliasCore.java:140)
at com.laytonsmith.commandhelper.CommandHelperServerListener.onServerCommand(CommandHelperServerListener.java:41)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at net.minecraft.server.v1_6_R2.DedicatedServer.ar(DedicatedServer.java:258)
at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:227)
at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)

commented

Comment by LadyCailin

Closures can't be serialized, as you see, but the stacktrace is still a bug. I have updated the docs and fixed the stacktrace, however.