[OpenJDK 2D-Dev] More incompatibilities

Roman Kennke roman.kennke at aicas.com
Tue Mar 3 15:38:59 UTC 2009

Hi again,

> 3. NotANumberTest: Double.NaN isn't handled gracefully.

The problem here is that the renderer in OpenJDK is originally written
for ME and uses fixed point arithmetic. I can't think of a quick fix,
because shapes are processed by iterating over them, this means, by the
time we hit the NaN, we might already have processed (==rendered) some
of the shape, but your test seems to suggest that you expect nothing to
be rendered in this case. The specification doesn't say anything about
this particular problem (at least I can't find anything). One solution
would be to pre-check all the incoming shapes for NaN or other invalid
values (infinity, etc) and not go into the iteration at all. But this
seems like quite a big overhead to me. We could also make the
floating->fixed conversion to throw an exception, that we would have to
catch higher up in the call tree and rollback what has already been
rendered (which doesn't seem easy either, because in the case of
strokeTo() this lies outside of the pisces renderer).

Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt

More information about the 2d-dev mailing list