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

Remove the preview status for methods introduced for Text Blocks

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      No behavior changes in the operation of the methods. Provides unrestricted access to new methods.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Remove the preview status for the methods String::stripIndent, String::translateEscapes and String::formatted. These methods are required support for the Text Blocks language feature which is being moved from preview status to standard language feature status.

      Problem

      The preview status of these methods prevents usage in standard Java.

      Solution

      Remove the preview status requirement from these methods.

      Specification

      diff -r 8654e0b4763a src/java.base/share/classes/java/lang/String.java
      --- a/src/java.base/share/classes/java/lang/String.java Tue Jan 14 11:45:29 2020 +0000
      +++ b/src/java.base/share/classes/java/lang/String.java Tue Jan 14 12:22:45 2020 -0400
      @@ -2973,8 +2973,6 @@
            * @since 15
            *
            */
      -    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.TEXT_BLOCKS,
      -                                 essentialAPI=true)
           public String stripIndent() {
               int length = length();
               if (length == 0) {
      @@ -3107,8 +3105,6 @@
            *
            * @since 15
            */
      -    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.TEXT_BLOCKS,
      -                                 essentialAPI=true)
           public String translateEscapes() {
               if (isEmpty()) {
                   return "";
      @@ -3369,8 +3365,6 @@
            * @since 15
            *
            */
      -    @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.TEXT_BLOCKS,
      -                                 essentialAPI=true)
           public String formatted(Object... args) {
               return new Formatter().format(this, args).toString();
           }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlaskey Jim Laskey
              Reporter:
              jlaskey Jim Laskey
              Reviewed By:
              Joe Darcy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: