Anyway, finally I had the bright idea to actually compile the Java code so I could compare the results, because I generated at least twenty different codes trying various permutations of things, none of which were right.
Another thing I learned! If you return an error string from a constructor, this does essentially nothing. You still get a constructed object. So, if your library is doing this, there’s a 99% chance that no one’s going to notice without a lot of pain in suffering.
Adding to my troubles: I am involved in some heavy yak-shaving at work.