Nothing wrong with asserts - they are good in the fact that production code doesn't have to enable them - hence reducing some checks. They are binary backward compatable to other JVM's as well so no problem.
I agree that they shouldn't alter variables - we can fix the one assert which does.
However - in the case in question it is harmless as that variable is literally used for nothing else but the assert in question.
1 2 3 4 5
| public World() { assert worldCount++ == 0: "Create World class only once. Multiple Worlds are not yet supported."; worldId = Ode.dWorldCreate(); Ode.setWorldID(worldId); } |
the worldCount has no other use than for asserts. I am happy to patch it for you just as a matter of principal if you like.
Cheers,
Will.