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

Remove terminally deprecated methods Runtime.getLocalized{Input,Output}Stream

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, binary
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      It's possible, but unlikely, that an application could call these methods. Their removal would thus be source and binary incompatible. Since the methods simply return their arguments, an application cannot be depending on any semantics provided by these methods, so mitigating the incompatibility should be straightforward.
      Show
      It's possible, but unlikely, that an application could call these methods. Their removal would thus be source and binary incompatible. Since the methods simply return their arguments, an application cannot be depending on any semantics provided by these methods, so mitigating the incompatibility should be straightforward.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Remove two terminally deprecated methods from java.lang.Runtime: getLocalizedInputStrem and getLocalizedOutputStream.

      Problem

      These methods are part of an obsolete mechanism for internationalization. They have been deprecated since JDK 1.1, and they were deprecated for removal since JDK 9. Their implementations essentially do nothing.

      Solution

      Remove these methods. Nothing in the JDK depends on them, and there are no uses of these methods by the general public as far as I can see.

      Specification

      Diffs below:

      --- a/src/java.base/share/classes/java/lang/Runtime.java    Wed Dec 06 17:44:31 2017 -0800
      +++ b/src/java.base/share/classes/java/lang/Runtime.java    Wed Dec 06 17:56:23 2017 -0800
      @@ -877,62 +877,6 @@
           }
      
           /**
      -     * Creates a localized version of an input stream. This method takes
      -     * an {@code InputStream} and returns an {@code InputStream}
      -     * equivalent to the argument in all respects except that it is
      -     * localized: as characters in the local character set are read from
      -     * the stream, they are automatically converted from the local
      -     * character set to Unicode.
      -     * <p>
      -     * If the argument is already a localized stream, it may be returned
      -     * as the result.
      -     *
      -     * @param      in InputStream to localize
      -     * @return     a localized input stream
      -     * @see        java.io.InputStream
      -     * @see        java.io.BufferedReader#BufferedReader(java.io.Reader)
      -     * @see        java.io.InputStreamReader#InputStreamReader(java.io.InputStream)
      -     * @deprecated As of JDK 1.1, the preferred way to translate a byte
      -     * stream in the local encoding into a character stream in Unicode is via
      -     * the {@code InputStreamReader} and {@code BufferedReader}
      -     * classes.
      -     * This method is subject to removal in a future version of Java SE.
      -     */
      -    @Deprecated(since="1.1", forRemoval=true)
      -    public InputStream getLocalizedInputStream(InputStream in) {
      -        return in;
      -    }
      -
      -    /**
      -     * Creates a localized version of an output stream. This method
      -     * takes an {@code OutputStream} and returns an
      -     * {@code OutputStream} equivalent to the argument in all respects
      -     * except that it is localized: as Unicode characters are written to
      -     * the stream, they are automatically converted to the local
      -     * character set.
      -     * <p>
      -     * If the argument is already a localized stream, it may be returned
      -     * as the result.
      -     *
      -     * @deprecated As of JDK 1.1, the preferred way to translate a
      -     * Unicode character stream into a byte stream in the local encoding is via
      -     * the {@code OutputStreamWriter}, {@code BufferedWriter}, and
      -     * {@code PrintWriter} classes.
      -     * This method is subject to removal in a future version of Java SE.
      -     *
      -     * @param      out OutputStream to localize
      -     * @return     a localized output stream
      -     * @see        java.io.OutputStream
      -     * @see        java.io.BufferedWriter#BufferedWriter(java.io.Writer)
      -     * @see        java.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream)
      -     * @see        java.io.PrintWriter#PrintWriter(java.io.OutputStream)
      -     */
      -    @Deprecated(since="1.1", forRemoval=true)
      -    public OutputStream getLocalizedOutputStream(OutputStream out) {
      -        return out;
      -    }
      -
      -    /**
            * Returns the version of the Java Runtime Environment as a {@link Version}.
            *
            * @return  the {@link Version} of the Java Runtime Environment
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smarks Stuart Marks
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Alan Bateman, Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: