JDK-8127171 : WindowStage.setBounds ignores valid values in some cases
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-02-23
  • Updated: 2015-06-17
  • Resolved: 2012-08-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Description
The following movements with a single valid value are completely ignored by WindowStage.setBounds:

setBounds(Float.NaN, 100, false, true, -1, -1, -1, -1)
setBounds(100, Float.NaN, true, false, -1, -1, -1, -1)

(void setBounds(float x, float y, boolean xSet, boolean ySet, float w, float h, float cw, float ch))

Comments
Fixed in 3.0-graphics b78 with this change set changeset: 16470:f0249cb00052 tag: tip user: Morris Meyer <morris.meyer@oracle.com> date: Wed Aug 01 20:27:34 2012 -0400 summary: RT-19856 - fix WindowStage ignoring valid values
02-08-2012

I don't think that we need an additional way (Float.NaN) how to specify that either x or y is not set. We have xSet and ySet parameters for that. Fix version 2.2 is OK.
27-02-2012

Set target to 2.2 since the dependent bug has a target of Presidio Updates. If this is inaccurate, please let us know right away.
24-02-2012

Are you sure that there are no cases where we want to set one or the other of xSet or ySet to false? Wouldn't the following be safer? if (isAppletStage) { xSet = ySet = false; } else { if (Float.isNaN(x)) { xSet = false; } if (Float.isNaN(y)) { ySet = false; } }
24-02-2012

Because of RT-19320, we can no longer use: setBounds(getX(), newY, true, true, -1, -1, -1, -1) setBounds(newX, getY(), true, true, -1, -1, -1, -1) so we need the possibility to set only x or only y. Because of this bug in quantum, I need to add additional checks (workaround) to scenegraph to avoid passing Float.NaN to WindowStage.setBounds. The problem in Quantum is only in the following block: ... if (isAppletStage || Float.isNaN(x) || Float.isNaN(y)) { xSet = ySet = false; } ... It is enough to remove ..."Float.isNaN(x) || Float.isNaN(y)"... part to fix this issue.
23-02-2012

Is there a use case that requires dealing with partially valid data? Or is this just something you discovered when trying to test the behavior of Float.NaN?
23-02-2012