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

Remove javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)

XMLWordPrintable

    • low
    • I cannot find any code external to the JDK that relies on this.
    • Java API
    • SE

      Summary

      Remove the terminally deprecated API javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)

      Problem

      SynthLookAndFeel.load(URL) is a fragile and dangerous API. It was deprecated for removal in https://bugs.openjdk.org/browse/JDK-8300891

      Solution

      In JDK 21 the API was deprecated for removal. It is now appropriate to remove it.

      Specification

      Remove as below javax.swing.plaf.SynthLookAndFeel.load(URL url)

      <     /**
      <      * Loads the set of <code>SynthStyle</code>s that will be used by
      <      * this <code>SynthLookAndFeel</code>. Path based resources are resolved
      <      * relatively to the specified <code>URL</code> of the style. For example
      <      * an <code>Image</code> would be resolved by
      <      * <code>new URL(synthFile, path)</code>. Refer to
      <      * <a href="doc-files/synthFileFormat.html">Synth File Format</a> for more
      <      * information.
      <      * <p>
      <      * Whilst this API may be safe for loading local resources that are
      <      * delivered with a {@code LookAndFeel} or application, and so have an
      <      * equal level of trust with application code, using it to load from
      <      * remote resources, particularly any which may have a lower level of
      <      * trust, is strongly discouraged.
      <      * The alternative mechanisms to load styles from an {@code InputStream}
      <      * {@linkplain #load(InputStream, Class)}
      <      * using resources co-located with the application or by providing a
      <      * {@code SynthStyleFactory} to
      <      * {@linkplain #setStyleFactory setStyleFactory(SynthStyleFactory)}
      <      * are preferred.
      <      * Consequently this method is deprecated and will be removed in a future
      <      * release.
      <      *
      <      * @param url the <code>URL</code> to load the set of
      <      *     <code>SynthStyle</code> from
      <      * @throws ParseException if there is an error in parsing
      <      * @throws IllegalArgumentException if synthSet is <code>null</code>
      <      * @throws IOException if synthSet cannot be opened as an <code>InputStream</code>
      <      * @since 1.6
      <      * @deprecated Use {@link #load(InputStream, Class)} or
      <      * {@link #setStyleFactory setStyleFactory(SynthStyleFactory)} instead
      <      */
      <     @Deprecated(since = "21", forRemoval = true)
      <     public void load(URL url) throws ParseException, IOException
      

            prr Philip Race
            prr Philip Race
            Alexander Zvegintsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: