Menu

#2 Fixed NullPointer in constructor of net.sourceforge.napkinlaf.NapkinLookAndFeel()

Unstable (example)
open
nobody
None
5
2020-03-02
2020-03-02
Gerd Wagner
No

Fixed NullPointer in constructor of net.sourceforge.napkinlaf.NapkinLookAndFeel() when run with newer OpenJdk versions:

    public NapkinLookAndFeel() {
        /*

         * Default values are not initialised properly before the first
         * JComponent is created in the application environment -- so if Napkin
         * is employed by UIManager before that its overrideComponentDefaults()
         * will not work as expected.
         *
         * Solution: create a JComponent to buy us security ;-)
         */
        // Use getPackage() instead of property because property can fail on security check
        Package sysPackage = Runtime.getRuntime().getClass().getPackage();
        String sysVer = sysPackage.getSpecificationVersion();
        if (null != sysVer && sysVer.startsWith("1.5")) {
            new JLabel();
        }
    }

Discussion


Log in to post a comment.

MongoDB Logo MongoDB