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

NPE on setStyle with leading space

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • fx2.0
    • fx2.0
    • javafx
    • Product: javafx-2.0beta
      Platform: windows-i586
      Build-Number: 2463
      Build-ID: 2011-07-20_08-14-55

      The following line of code:

              region.setStyle(" -fx-background-color: black;");

      causes an NPE:

      WARNING: com.sun.javafx.css.parser.CSSParser declaration Expected IDENT at file:/D:/JavaFX/repos/jfx/apps/internal/BugsFiling/build/classes/[1,2]
      Exception in Application start method
      Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:203)
      at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:18)
      at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:56)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
      at com.sun.javafx.css.StyleManager$Cache.getStyles(StyleManager.java:867)
      at com.sun.javafx.css.StyleManager$Cache.lookup(StyleManager.java:824)
      at com.sun.javafx.css.StyleManager$Cache.access$1700(StyleManager.java:766)
      at com.sun.javafx.css.StyleManager$StylesheetContainer.getStyleHelper(StyleManager.java:661)
      at com.sun.javafx.css.StyleManager$StylesheetContainer.access$1200(StyleManager.java:523)
      at com.sun.javafx.css.StyleManager.getStyleHelper(StyleManager.java:450)
      at javafx.scene.Node.impl_createStyleHelper(Node.java:5466)
      at javafx.scene.Node.impl_processCSS(Node.java:5454)
      at javafx.scene.Parent.impl_processCSS(Parent.java:847)
      at javafx.stage.Window.impl_visibleChanging(Window.java:581)
      at javafx.stage.Stage.impl_visibleChanging(Stage.java:502)
      at javafx.stage.Window$13.invalidated(Window.java:489)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:76)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:110)
      at javafx.stage.Window.setVisible(Window.java:561)
      at javafx.stage.Stage.setVisible(Stage.java:109)
      at SpaceInStyleBug.start(SpaceInStyleBug.java:28)
      at com.sun.javafx.application.LauncherImpl$4.run(LauncherImpl.java:164)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:126)
      at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:102)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$1$1.run(WinApplication.java:49)
      ... 1 more

            dgrieve David Grieve
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: