-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8203573 | 11.0.1 | Philip Race | P4 | Resolved | Fixed | team |
JDK-8338758 | 8u441 | Alexey Ivanov | P4 | Resolved | Fixed | b01 |
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.
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.
- backported by
-
JDK-8203573 java/awt/font/GlyphVector/TestLayoutFlags.java is missing null check
-
- Resolved
-
-
JDK-8338758 java/awt/font/GlyphVector/TestLayoutFlags.java is missing null check
-
- Resolved
-
- duplicates
-
JDK-8338755 Test java/awt/font/GlyphVector/TestLayoutFlags.java always fails on Linux
-
- Closed
-