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

Add @throws NPE javadoc to UIManager.setLookAndFeel(String) method description

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P3
    • 11
    • client-libs
    • None
    • behavioral
    • minimal
    • Only documentation update. So no risk of compatibility issues.
    • Java API
    • SE

    Description

      Summary

      Add @throws NPE to API description of UIManager.setLookAndFeel(String) as it throws NPE if null is passed.

      Problem

      The javadoc for UIManager.setLookAndFeel does not explicitly mention that if null is passed as className, it will throw a NPE.

      Solution

      Added @throws NPE tag to the API description. Webrev: http://cr.openjdk.java.net/~pbansal/8153532/webrev.00/

      Specification

      List of methods whose specification is being changed

      /**
       * Loads the {@code LookAndFeel} specified by the given class
       * name, using the current thread's context class loader, and
       * passes it to {@code setLookAndFeel(LookAndFeel)}.
       *
       * @param className  a string specifying the name of the class that implements
       *        the look and feel
       * @throws ClassNotFoundException if the <code>LookAndFeel</code>
       *           class could not be found
       * @throws InstantiationException if a new instance of the class
       *          couldn't be created
       * @throws IllegalAccessException if the class or initializer isn't accessible
       * @throws UnsupportedLookAndFeelException if
       *          <code>lnf.isSupportedLookAndFeel()</code> is false
       * @throws ClassCastException if {@code className} does not identify
       *         a class that extends {@code LookAndFeel}
       * @throws NullPointerException if {@code className} is {@code null}
       */
      @SuppressWarnings("deprecation")
      public static void setLookAndFeel(String className)

      Attachments

        1. webrev.00.zip
          1.94 MB
        2. webrev.01.zip
          1.94 MB

        Issue Links

          Activity

            People

              pbansal Pankaj Bansal (Inactive)
              alexsch Alexandr Scherbatiy
              Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: