VM crash in Joint.setParam(...)

Hey folks,
don’t know wether this is a bug, but I get a VM crash when I cast my JointHinge to Joint and call setParam(x,y) on this. No crash is happening when I use the JointHinge reference in the same code.
Is it not possible to set the parameters from a Joint reference ?

Greetings,
Marcus

Heah ?? I think if you cast something it shouldn’t affect anything, because even when casted down the overwritten function gets executed - isn’t that the power of object oriented programming ? So what I’m saying with that your error is probably somewhere else.

public void configure(Joint joint) {
((JointHinge)joint).setParam(cc.option,cc.value);
}

Hmm… it sounds like the Joint is not actually a JointHinge, but I would think that would result in a ClassCastException. You can verify the Class of the Joint using joing.getClass().getName(). Alternatively, the option may not be valid for a JointHinge.

Oh, now it suddenly works again. Thats strange, I have repeated the test two times bevor I wrote here - it was reliably crashing without hte casting??? Now it works - again. Doesn’t make any sense to me… I think there must evetually be passed somthing illegal (or maby null) into the method? Now it’s gone, but I will now include a != null check, just to be on the save side.
Thanks guys!

Are you using the latest CVS? There have been some native crash problems solved since the last release.

No actually not. I tried several times to build from cvs, but never succeeded. Maye I should give it a try again? I think my version is 0.2.4, and I’m strugglingquite hard with several VM crashes…