Simsilica / SiO2

Base pack of useful reusable game code that can help bootstrap any JME game project.
BSD 3-Clause "New" or "Revised" License
25 stars 7 forks source link

EntityContainer doesn't support nested parametrized types #1

Closed MeFisto94 closed 5 years ago

MeFisto94 commented 7 years ago

Using

public class RigidBodyContainer extends EntityContainer<Tuple<Spatial, RigidBodyControl>>

leads to the following Exception:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
        at com.simsilica.es.EntityContainer.<init>(EntityContainer.java:96)
        at com.simsilica.es.EntityContainer.<init>(EntityContainer.java:83)
        at de.darkigames.TheSlaughter.EntitySystem.Util.RigidBodyContainer.<init>(RigidBodyContainer.java:26)
Ali-RS commented 7 years ago

Hi, Yet any plan to add support for this ? Thought to remind it :)

assofohdz commented 7 years ago

Just linking to a hub post here https://hub.jmonkeyengine.org/t/sio2-entitycontainer-and-parameterizedtype-exception/39182

MeFisto94 commented 7 years ago

Looks like the workaround to this problem was only posted on the hub. A simple dummy class class A extends Tuple<Spatial, RigidBodyControl> should do the trick, iirc.

Ali-RS commented 5 years ago

Should be fixed now in this commit : 75decab8fe25fe49cf42ff4a264f0ce6b7c57ab1 I think we can close this now @MeFisto94