Bounds constructor validation

Richard Bair richard.bair at
Tue Oct 1 15:13:12 PDT 2013


I'm looking at, where the argument is made that the width / height of a node (specifically, a Region's prefWidth, minWidth, maxWidth, prefHeight, minHeight, maxHeight) should never be negative. While looking at this, I noticed that in Node, the prefWidth method relies on the layoutBounds.getWidth(). However, the Bounds class itself does not appear to do any validation of the parameters passed to the Bounds. There are no checks for NaN, and no checks for negative width, height, depth.

Is there any reason why we should allow NaN, or negative width / height / depth for Bounds?


More information about the openjfx-dev mailing list