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

Deprecate for removal javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 21
    • client-libs
    • None
    • source
    • minimal
    • This is just documentation / deprecation, so little risk associated at this stage, except for the effect of additional compiler warnings, about usage of this method which is actually a desired consequence (!)
    • Java API
    • SE

      Summary

      Deprecate for removal javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)

      Problem

      Synth styles may include code. But it is not easy for applications - or the JDK - to ensure that the URL used by SynthLookAndFeel.load(URL) is trusted.

      Solution

      Document in clear language that use of this method is discouraged, and further to that, deprecate the method for removal in a future release.

      Specification

      Add the following to the javadoc for

      javax.swing.plaf.synth.SynthLookAndFeel.load(URL url)
      
      +     * 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
      +     * 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}
      +     * using a resource co-located with the application or by
      +     * providing a {@code SynthStyleFactory} are preferred.
      +     * Consequently this method is deprecated and will be removed in a future release.
      ..
      ..
      +    @Deprecated(since = "21", forRemoval = true)
           public void load(URL url) throws ParseException, IOException
      

            prr Philip Race
            prr Philip Race
            Alexey Ivanov, Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: