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

sun.font.FontManager.getDefaultPlatformFont throws NPE in OpenJDK on Solaris 10 10/08

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • client-libs
    • 2d
    • b33
    • 7
    • b74
    • generic, sparc
    • generic, solaris

      JDK7 uses /usr/lib/libfontconfig.so to help find fonts on Solaris & Linux.
      In a couple of scenarios, we try to find just the first physical font that
      would be used by one of fontconfig's "logical" fonts (sans, serif, monospace).

      We are looking for an outline font, and it appears that on Solaris 10 x86 10/08,
      the configuration results in a PCF bitmap font being the first font :

      /usr/openwin/lib/X11/fonts/misc/Serif12.pcf.Z


      This results in a field being left at null and we get an NPE :

      java.lang.NullPointerException
              at sun.font.FontManager.getDefaultPlatformFont(FontManager.java:3427)
              at sun.java2d.SunGraphicsEnvironment$2.run(SunGraphicsEnvironment.java:263)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:164)
              at sun.awt.X11GraphicsEnvironment.<init>(X11GraphicsEnvironment.java:220)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
              at java.lang.Class.newInstance0(Class.java:372)
              at java.lang.Class.newInstance(Class.java:325)
              at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:84)
              at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:125)

      =============

      The particular call to sun.font.FontManager.getDefaultPlatformFont() is
      made only on OpenJDK builds, since the closed ones use Lucida Sans Regular as
      the default font, so don't hit this code.

          Loading...
          Uploaded image for project: 'JDK'
          1. JDK
          2. JDK-6867603

          sun.font.FontManager.getDefaultPlatformFont throws NPE in OpenJDK on Solaris 10 10/08

            • Icon: Bug Bug
            • Resolution: Fixed
            • Icon: P3 P3
            • 7
            • 7
            • client-libs
            • 2d
            • b33
            • 7
            • b74
            • generic, sparc
            • generic, solaris

              JDK7 uses /usr/lib/libfontconfig.so to help find fonts on Solaris & Linux.
              In a couple of scenarios, we try to find just the first physical font that
              would be used by one of fontconfig's "logical" fonts (sans, serif, monospace).

              We are looking for an outline font, and it appears that on Solaris 10 x86 10/08,
              the configuration results in a PCF bitmap font being the first font :

              /usr/openwin/lib/X11/fonts/misc/Serif12.pcf.Z


              This results in a field being left at null and we get an NPE :

              java.lang.NullPointerException
                      at sun.font.FontManager.getDefaultPlatformFont(FontManager.java:3427)
                      at sun.java2d.SunGraphicsEnvironment$2.run(SunGraphicsEnvironment.java:263)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:164)
                      at sun.awt.X11GraphicsEnvironment.<init>(X11GraphicsEnvironment.java:220)
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                      at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
                      at java.lang.Class.newInstance0(Class.java:372)
                      at java.lang.Class.newInstance(Class.java:325)
                      at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:84)
                      at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:125)

              =============

              The particular call to sun.font.FontManager.getDefaultPlatformFont() is
              made only on OpenJDK builds, since the closed ones use Lucida Sans Regular as
              the default font, so don't hit this code.

                    prr Philip Race
                    prr Philip Race
                    Votes:
                    0 Vote for this issue
                    Watchers:
                    0 Start watching this issue

                      Created:
                      Updated:
                      Resolved:
                      Imported:
                      Indexed:

                        prr Philip Race
                        prr Philip Race
                        Votes:
                        0 Vote for this issue
                        Watchers:
                        0 Start watching this issue

                          Created:
                          Updated:
                          Resolved:
                          Imported:
                          Indexed: