Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8105491

Need to document legal range for stop values in RadialGradientPaint and fail more gracefully

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx2.0
    • fx1.0
    • javafx
    • None

      We have a test called GradientPaintTest, launch the test by IE7, when you select radialGradient and change the offset value, it threw exceptions.
      The test case is attached and exceptions as following:

      basic: Starting applet
      basic: Applet started
      basic: Told clients applet is started
      Exception in trigger:
      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at javafx.scene.paint.Gradients$Factory6.createRadialGradientPaint(Gradients.java:118)
      at javafx.scene.paint.Gradients.createRadialGradientPaint(Gradients.java:49)
      at javafx.scene.paint.RadialGradient.createPaint$impl(RadialGradient.fx:87)
      at javafx.scene.paint.RadialGradient.createPaint(RadialGradient.fx:68)
      at javafx.scene.paint.RadialGradient.getAWTPaint$impl(RadialGradient.fx:76)
      at javafx.scene.paint.RadialGradient.getAWTPaint(RadialGradient.fx:68)
      at javafx.scene.shape.Shape$7.onChange(Shape.fx:190)
      at javafx.scene.shape.Shape$7.onChange(Shape.fx:188)
      at com.sun.javafx.runtime.location.ObjectVariable$2.action(ObjectVariable.java:165)
      at com.sun.javafx.runtime.location.ObjectVariable$2.action(ObjectVariable.java:162)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:55)
      at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:162)
      at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(ObjectVariable.java:117)
      at com.sun.javafx.runtime.location.ObjectVariable.update(ObjectVariable.java:145)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:179)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:60)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidate(AbstractLocation.java:115)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:177)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:60)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidate(AbstractLocation.java:115)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:177)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:72)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.IntVariable.notifyListeners(IntVariable.java:172)
      at com.sun.javafx.runtime.location.IntVariable.replaceValue(IntVariable.java:98)
      at com.sun.javafx.runtime.location.IntVariable.setAsInt(IntVariable.java:117)
      at javafx.ext.swing.SwingSlider$1ChangeListener$anon17.stateChanged(SwingSlider.fx:108)
      at javax.swing.JSlider.fireStateChanged(Unknown Source)
      at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
      at javax.swing.JSlider.setValue(Unknown Source)
      at javax.swing.plaf.synth.SynthSliderUI$SynthTrackListener.mouseDragged(Unknown Source)
      at java.awt.Component.processMouseMotionEvent(Unknown Source)
      at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedConstructorAccessor10.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at javafx.scene.paint.Gradients$Factory6.createRadialGradientPaint(Gradients.java:115)
      ... 61 more
      Caused by: java.lang.IllegalArgumentException: Keyframe fractions must be increasing: 0.15
      at java.awt.MultipleGradientPaint.<init>(Unknown Source)
      at java.awt.RadialGradientPaint.<init>(Unknown Source)
      at java.awt.RadialGradientPaint.<init>(Unknown Source)
      ... 65 more
      Exception in trigger:
      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at javafx.scene.paint.Gradients$Factory6.createRadialGradientPaint(Gradients.java:118)
      at javafx.scene.paint.Gradients.createRadialGradientPaint(Gradients.java:49)
      at javafx.scene.paint.RadialGradient.createPaint$impl(RadialGradient.fx:87)
      at javafx.scene.paint.RadialGradient.createPaint(RadialGradient.fx:68)
      at javafx.scene.paint.RadialGradient.getAWTPaint$impl(RadialGradient.fx:76)
      at javafx.scene.paint.RadialGradient.getAWTPaint(RadialGradient.fx:68)
      at javafx.scene.shape.Shape$7.onChange(Shape.fx:190)
      at javafx.scene.shape.Shape$7.onChange(Shape.fx:188)
      at com.sun.javafx.runtime.location.ObjectVariable$2.action(ObjectVariable.java:165)
      at com.sun.javafx.runtime.location.ObjectVariable$2.action(ObjectVariable.java:162)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:55)
      at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:162)
      at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(ObjectVariable.java:117)
      at com.sun.javafx.runtime.location.ObjectVariable.update(ObjectVariable.java:145)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:179)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:60)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidate(AbstractLocation.java:115)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:177)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:60)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidate(AbstractLocation.java:115)
      at com.sun.javafx.runtime.location.AbstractVariable.invalidate(AbstractVariable.java:177)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:141)
      at com.sun.javafx.runtime.location.AbstractLocation$4.action(AbstractLocation.java:135)
      at com.sun.javafx.runtime.util.AbstractLinkable.iterate(AbstractLinkable.java:72)
      at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
      at com.sun.javafx.runtime.location.IntVariable.notifyListeners(IntVariable.java:172)
      at com.sun.javafx.runtime.location.IntVariable.replaceValue(IntVariable.java:98)
      at com.sun.javafx.runtime.location.IntVariable.setAsInt(IntVariable.java:117)
      at javafx.ext.swing.SwingSlider$1ChangeListener$anon17.stateChanged(SwingSlider.fx:108)
      at javax.swing.JSlider.fireStateChanged(Unknown Source)
      at javax.swing.JSlider$ModelListener.stateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
      at javax.swing.JSlider.setValue(Unknown Source)
      at javax.swing.plaf.synth.SynthSliderUI$SynthTrackListener.mouseDragged(Unknown Source)
      at java.awt.Component.processMouseMotionEvent(Unknown Source)
      at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedConstructorAccessor10.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at javafx.scene.paint.Gradients$Factory6.createRadialGradientPaint(Gradients.java:115)
      ... 61 more
      Caused by: java.lang.IllegalArgumentException: Keyframe fractions must be increasing: 0.1
      at java.awt.MultipleGradientPaint.<init>(Unknown Source)
      at java.awt.RadialGradientPaint.<init>(Unknown Source)
      at java.awt.RadialGradientPaint.<init>(Unknown Source)
      ... 65 more

            rgregor Richard Gregor
            ttzhang Tao Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 2 days
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified