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

Remove the preview status for methods introduced for Text Blocks

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • None
    • core-libs
    • None
    • minimal
    • No behavior changes in the operation of the methods. Provides unrestricted access to new methods.
    • Java API
    • SE

      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();
           }

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

              Created:
              Updated:
              Resolved: