JDK-8105659 : Scenario doesn't validate PULSE DURATION, throws ArithmeticException for illegal values
  • Type: Bug
  • Component: javafx
  • Sub-Component: animation
  • Affected Version: fx1.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2009-01-28
  • Updated: 2015-06-16
  • Resolved: 2009-01-30
Related Reports
Duplicate :  
Description
com.sun.scenario.Settings.set("com.sun.scenario.animation.pulse", "1001");

results in:

java.lang.ArithmeticException: / by zero
        at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.updateNextPulseTime(AbstractMasterTimer.java:288)
        at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.getDelay(AbstractMasterTimer.java:253)
...

Any value higher than 1000 causes this exception, probably because the runtime uses milissecond precision for PULSE_DURATION and any value > 1000 results is rounded to 0 somewhere.

Negative values (like -1) cause no harm, just like 0 they mean "default duration from monitor's frequency".
Comments
We will address the last part of this as part of RT-340. Note that Scenario is not part of the public API for JavaFX, but is an internal interface, so we may not fix the original problem described in this report.
30-01-2009

In a related note, detection of the standard pulse value from monitor frequency seems to be less than perfect. In my dual-monitor setup where both monitors are set to 75Hz, connected to separate ports in a single card (NVidia Quadro FX1700), I get 153fps animation by default. So I guess the video driver reports a frequency of 150Hz because the card uses that and splits the output to the two monitors.
28-01-2009