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

Overriding public variable of SwingComboBox and TextBox brings NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • fx1.2
    • None
    • javafx
    • Windows. Latest SDK (b39)

      I am trying to set an "on replace" trigger on the selectedItem public variable in the following way :
      SwingComboBox {
      ...
      override var selectedItem on replace {
      ...
      }
      It allows to be notified of selection change.
      When the Stage that contains this ComoboBox is displayed, the pasted Exceptions occurs and the Stage is NOT displayed.
      Overriding this public field seems valid.
      I tried with TextBox, and the same problem occured...
      I attached a simple, self-contained testcase that shows it all.


      Exception in trigger:
      java.lang.NullPointerException
              at com.sun.scenario.scenegraph.SGText.getEols(SGText.java:579)
              at com.sun.scenario.scenegraph.SGText.setText(SGText.java:363)
              at javafx.scene.text.Text$1.onChange(Text.fx:69)
              at javafx.scene.text.Text$1.onChange(Text.fx:68)
              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.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:60)

              at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
              at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:160)
              at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(ObjectVariable.java:117)
              at com.sun.javafx.runtime.location.ObjectVariable.set(ObjectVariable.java:128)
              at javafx.scene.control.Control$18.onChange(Control.fx:72)
              at javafx.scene.control.Control$18.onChange(Control.fx:70)
              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.set(ObjectVariable.java:128)
              at javafx.scene.control.TextBox.applyDefaults$skin(TextBox.fx:85)
              at javafxapplication3.Main$1TextBox$anon1.applyDefaults$skin(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.applyDefaults$skin(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:102)
              at java.awt.event.InvocationEvent.dispatch(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)
      Exception in trigger:
      java.lang.NullPointerException
              at com.sun.scenario.scenegraph.SGText.getEols(SGText.java:579)
              at com.sun.scenario.scenegraph.SGText.setText(SGText.java:363)
              at javafx.scene.text.Text$1.onChange(Text.fx:69)
              at javafx.scene.text.Text$1.onChange(Text.fx:68)
              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:72)
              at com.sun.javafx.runtime.location.AbstractLocation.invalidateDependencies(AbstractLocation.java:162)
              at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(ObjectVariable.java:160)
              at com.sun.javafx.runtime.location.ObjectVariable.setDefault(ObjectVariable.java:135)
              at javafx.scene.control.TextBox.applyDefaults$text(TextBox.fx:37)
              at javafxapplication3.Main$1TextBox$anon1.applyDefaults$text(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.applyDefaults$text(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:102)
              at java.awt.event.InvocationEvent.dispatch(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)
      HELLO 2
      Failed to parse style border-fill:null; background-fill:#00000000; focus-fill:null on node TextBox$anon1 [boundsInLocal=Rectangle2D [minX = 0.0, minY=0.0, maxX=0.0, maxY=0.0, width=0.0, height=0.0], boundsInParent=Rectangle2D [minX = 0.0, minY=0.0, maxX=0.0, maxY=0.0, width=0.0, height=0.0]
      com.sun.stylesheet.StylesheetException: java.lang.reflect.InvocationTargetException
              at com.sun.stylesheet.types.TypeManager.getStyleable(TypeManager.java:302)
              at com.sun.stylesheet.Stylesheet.applyTo(Stylesheet.java:253)
              at javafx.scene.Node.updateCSS$impl(Node.fx:473)
              at javafxapplication3.Main$1TextBox$anon1.updateCSS(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.updateCSS(Main.fx:39)
              at javafx.scene.Node.postInit$(Node.fx:590)
              at javafx.scene.CustomNode.postInit$(CustomNode.fx:56)
              at javafx.scene.control.Control.postInit$(Control.fx:55)
              at javafx.scene.control.TextBox.postInit$(TextBox.fx:29)
              at javafxapplication3.Main$1TextBox$anon1.postInit$(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.postInit$(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main$1TextBox$anon1.initialize$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at javafxapplication3.Main.javafx$run$(Main.fx:39)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:102)
              at java.awt.event.InvocationEvent.dispatch(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.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at com.sun.stylesheet.types.TypeManager.getStyleable(TypeManager.java:287)
              ... 23 more
      Caused by: com.sun.stylesheet.StylesheetException: java.lang.reflect.InvocationTargetException
              at com.sun.stylesheet.types.TypeManager.getStyleSupport(TypeManager.java:348)
              at com.sun.stylesheet.styleable.DefaultStyleable.getStyleSupport(DefaultStyleable.java:124)
              at com.sun.stylesheet.styleable.DefaultStyleable.<init>(DefaultStyleable.java:73)
              ... 28 more
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at com.sun.stylesheet.types.TypeManager.getStyleSupport(TypeManager.java:333)
              ... 30 more
      Caused by: java.lang.NullPointerException
              at javafx.reflect.FXLocal$SortedClassArray.insert(FXLocal.java:552)
              at javafx.reflect.FXLocal$ClassType.getSuperClasses(FXLocal.java:316)
              at javafx.reflect.FXLocal$ClassType.getSuperClasses(FXLocal.java:334)
              at com.sun.stylesheet.javafx.FXObjectStyleSupport.<init>(FXObjectStyleSupport.java:162)
              ... 35 more
      HELLO
      com.sun.stylesheet.StylesheetException: java.lang.reflect.InvocationTargetException
              at com.sun.stylesheet.types.TypeManager.getStyleable(TypeManager.java:302)
              at com.sun.stylesheet.javafx.FXObjectStyleSupport.getStyleableChildren(FXObjectStyleSupport.java:243)
              at com.sun.stylesheet.styleable.DefaultStyleable.getStyleableChildren(DefaultStyleable.java:171)
              at com.sun.stylesheet.Stylesheet.applyTo(Stylesheet.java:279)
              at com.sun.stylesheet.Stylesheet.applyTo(Stylesheet.java:257)
              at javafx.scene.Scene.userInit$(Scene.fx:212)
              at javafx.scene.Scene.initialize$(Scene.fx:40)
              at javafxapplication3.Main.javafx$run$(Main.fx:37)
              at javafxapplication3.Main.javafx$run$(Main.fx:37)
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at com.sun.stylesheet.types.TypeManager.getStyleable(TypeManager.java:287)
              at com.sun.stylesheet.javafx.FXObjectStyleSupport.getStyleableChildren(FXObjectStyleSupport.java:243)
              at com.sun.stylesheet.styleable.DefaultStyleable.getStyleableChildren(DefaultStyleable.java:171)
              at com.sun.stylesheet.Stylesheet.applyTo(Stylesheet.java:279)
              at com.sun.stylesheet.Stylesheet.applyTo(Stylesheet.java:257)
              at javafx.scene.Scene.userInit$(Scene.fx:212)
              at javafx.scene.Scene.initialize$(Scene.fx:40)
              at javafxapplication3.Main.javafx$run$(Main.fx:37)
              at javafxapplication3.Main.javafx$run$(Main.fx:37)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:102)
              at java.awt.event.InvocationEvent.dispatch(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: com.sun.stylesheet.StylesheetException: java.lang.reflect.InvocationTargetException
              at com.sun.stylesheet.types.TypeManager.getStyleSupport(TypeManager.java:348)
              at com.sun.stylesheet.styleable.DefaultStyleable.getStyleSupport(DefaultStyleable.java:124)
              at com.sun.stylesheet.styleable.DefaultStyleable.<init>(DefaultStyleable.java:73)
              ... 25 more
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at com.sun.stylesheet.types.TypeManager.getStyleSupport(TypeManager.java:333)
              ... 27 more
      Caused by: java.lang.NullPointerException
              at javafx.reflect.FXLocal$SortedClassArray.insert(FXLocal.java:552)
              at javafx.reflect.FXLocal$ClassType.getSuperClasses(FXLocal.java:316)
              at javafx.reflect.FXLocal$ClassType.getSuperClasses(FXLocal.java:334)
              at com.sun.stylesheet.javafx.FXObjectStyleSupport.<init>(FXObjectStyleSupport.java:162)
              ... 32 more
      browser-run:

        1. anon-cl.patch
          0.7 kB
        2. Main.fx
          2 kB

            pbothner Per Bothner (Inactive)
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: