I've being try to get the list of weapons in Cargo, the problem is that Janino doesn't play well with generics for some odd reason, and I can't define a proper return value for the list
List<CargoItemQuantity<String>> container = cargo.getWeapons();
I have to define it like this
List container = cargo.getWeapons();
The problem with that is now I've got a list of objects.
I can't cast like this
(CargoItemQuantity<String>) container
presumably for the same reason above. Which is OK I guess cause I can do this....
CargoItemQuantity ciq = (CargoItemQuantity) container.get(x);
but... and I don't know why. When I get to this long annoying rabbit hole and have to cast the String. I get this
Caused by: org.codehaus.commons.compiler.CompileException: Array initializer not allowed for non-array type "java.lang.String"
grrrrr.... Does anyone have any working examples using this method?