JDK-8241747 : Remove the preview status for methods introduced for Text Blocks
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Submitted: 2020-03-27
  • Updated: 2020-04-20
  • Resolved: 2020-03-27
Related Reports
CSR :  
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();
     }
```


Comments
Moving to Approved.
27-03-2020