I am going to pass this one back to you, I am not sure how to fix this properly.
The problem is in SubMenu.getKeyCommands() calling ArrayUtils.append(myC, c) to append the existing keycommands (c) to the submenu keycommands (myC).
ArrayUtils.append(x, y) creates a new array of the same type as x and copies the elements of x any y into it.
However, in SubMenu, x (SubMenuKeyCommand) is a subclass of y (KeyCommand), so we get an ArrayStoreExceptiontrying to stuff KeyCommands into a SubMenuKeyCommands array.
The pre-arrayUtils version of SubMenu correctly created the target array as type KeyCommand and so does not fail.
Easy fix is to just restore the old code that calls System.arraycopy directly.
A harder fix (and beyond me) is to modify ArrayUtils.append() to check the types of all the arguments for subclasses and create the array of type of the basest class.
B.
Finally reproduced this one - it is only reproducible in the 3.2 trunk,
not in the 3.1 branch.
I'm working on it now.
Strangely, the two bug reports where created using Vassal version
3.2.0-svn5061. How did an extremely recent 3.2 release get out into the
wild?
_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org
Post generated using Mail2Forum (http://www.mail2forum.com)