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

java/awt/font/GlyphVector/TestLayoutFlags.java is missing null check

XMLWordPrintable

    • 2d
    • b14

        java/awt/font/GlyphVector/TestLayoutFlags.java now looks for a font
        that supports the code points and makeGlyphVector returns null if
        none is found. But there is no code in test(..) to skip + return in that case.
        So if this happens to be run on a system without such fonts we can get
        an NPE like this:
        Using Bitstream Charter for script latin
        No font found for script hebrew
        No font found for script arabic
        No font found for script devanagari
        No font found for script tamil

        *** latin ***
         test flags
        computed flags: pos
          actual flags: pos
        allowed layout flags: none
        ----------System.err:(17/986)----------
        java.lang.NullPointerException
        at TestLayoutFlags.validateCharIndexMethods(TestLayoutFlags.java:225)
        at TestLayoutFlags.computeFlags(TestLayoutFlags.java:204)
        at TestLayoutFlags.test(TestLayoutFlags.java:146)
        at TestLayoutFlags.runTest(TestLayoutFlags.java:88)
        at TestLayoutFlags.main(TestLayoutFlags.java:42)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
        at java.base/java.lang.Thread.run(Thread.java:832)

        JavaTest Message: Test threw exception: java.lang.NullPointerException
        JavaTest Message: shutting down test
        ====

        The fix is just to add that check.

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

                Created:
                Updated:
                Resolved: