JDK-8218637 : Deprecate the Swing Motif Look and Feel and document it as unsupported on macOS
  • Type: CSR
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P2
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-02-07
  • Updated: 2019-02-22
  • Resolved: 2019-02-22
Related Reports
CSR :  
Description
Summary
-------

This is a request to deprecate the Swing Motif Look and Feel for removal, and document it as unsupported on macOS platform in jdk13.

Problem
-------

The Motif L&F has long been part of the Swing implementation shipped with the JDK, although unlike L&Fs
such as Metal and Nimbus it is not exposed in Java APIs and not part of the Java SE specification.
Because it is an internal class, not exported from the java.desktop module, applications cannot instantiate it directly
in JDK 9 and later, but is still accessible via command line option or passing the class name to the method
"UIManager.setLookAndFeel(String className)".

This look and feel was implemented as the System look and feel for the Solaris platform at time when the
CDE/Motif environment was used the principal supported desktop environment.
Since then it has been largely superseded by the GTK L&F, both on Solaris, and on Linux versions.

But it was placed in shared code and provided and supported on all platforms including Windows and later MacOS.
Applications can enumerate the installed L&Fs via standard API, and retrieve its class name and instantiate it.
It has also been documented in tutorials, guides etc.

However its use as a cross-platform L&F is very limited  applications are much more likely to use one of the true
 cross-platform look and feels which are exposed in Java API, ie 

- Ocean - reworked version of Metal L&F in jdk5 https://docs.oracle.com/javase/1.5.0/docs/guide/swing/1.5/index.html#swingMajor
- Nimbus - was added as a Public API in jdk7 https://openjdk.java.net/projects/jdk7/features/#f244

Since it is superseded as a system L&F and has limited use and additionally as a L&F is very dated visually,
we would like to discourage further use.

Solution
--------

 As of jdk13 in the release notes we would like to document this L&F as unsupported on macOS, and deprecate it for removal in the source code

   In some future release we may remove it completely, or we may remove it from the shared code to stop distributing it on Windows and macOS.
   These are mentioned here to give the most possible notice of such possible additional changes.

Specification
-------------

The are no specification changes in the Java API, because the Motif L&F does not have a public api
But for the record this change will be done in the source code:

     java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java

    + * @deprecated The Motif Look and Feel is deprecated with the intent to remove
    + *             it in some future release. It is recommended to use
    + *             {@link javax.swing.plaf.metal.MetalLookAndFeel} instead.
      */
     @SuppressWarnings("serial") // Superclass is not serializable across versions
    +@Deprecated(since="13", forRemoval=true)
     public class MotifLookAndFeel extends BasicLookAndFeel

Comments
Moving amended request to Approved.
22-02-2019

Moving to Approved.
08-02-2019