changeset 49692:f2ec59847c27 raw-string-literal

0000000: Rename trimIndent, trimMarkers to stripIndent, stripMarkers
author jlaskey
date Wed, 21 Mar 2018 10:35:21 -0300
parents bc38df004048
children c66cba389571
files src/java.base/share/classes/java/lang/String.java test/jdk/java/lang/String/RawStringLiteralLib.java
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/String.java	Tue Mar 20 14:45:21 2018 -0300
+++ b/src/java.base/share/classes/java/lang/String.java	Wed Mar 21 10:35:21 2018 -0300
@@ -2804,7 +2804,7 @@
      * @return String with indent removed.
      * @since 11
      */
-    public String trimIndent() {
+    public String stripIndent() {
         if (isEmpty()) {
             return this;
         }
@@ -2862,7 +2862,7 @@
      * @return  string with margins removed
      * @since 11
      */
-    public String trimMarkers(String leftMarker, String rightMarker) {
+    public String stripMarkers(String leftMarker, String rightMarker) {
         Objects.requireNonNull(leftMarker);
         Objects.requireNonNull(rightMarker);
         if (isEmpty()) {
--- a/test/jdk/java/lang/String/RawStringLiteralLib.java	Tue Mar 20 14:45:21 2018 -0300
+++ b/test/jdk/java/lang/String/RawStringLiteralLib.java	Wed Mar 21 10:35:21 2018 -0300
@@ -60,7 +60,7 @@
         equal("\b".stripLeading(), "\b");
         equal("\b".stripTrailing(), "\b");
 
-        // trimIndent
+        // stripIndent
         for (String prefix : List.of("", "\n", "   \n"))
         for (String suffix : List.of("", "\n", "   \n"))
         for (String middle : List.of("",
@@ -75,7 +75,7 @@
                                      "   // comment"))
         {
             String input = prefix + "   abc   \n" + middle + "\n   def   \n" + suffix;
-            String output = input.trimIndent();
+            String output = input.stripIndent();
 
             Iterator<String> inputIterator = input.lines().iterator();
             Iterator<String> outputIterator = output.lines().iterator();
@@ -117,7 +117,7 @@
             }
         }
 
-        // trimMarkers
+        // stripMarkers
         for (String prefix : List.of("", "\n", "   \n"))
         for (String suffix : List.of("", "\n", "   \n"))
         for (String middle : List.of("",
@@ -138,7 +138,7 @@
                            leftMargin + middle + rightMargin + "\n" +
                            leftMargin + "   def   " + rightMargin + "\n" +
                            suffix;
-            String output = input.trimMarkers(leftMargin, rightMargin);
+            String output = input.stripMarkers(leftMargin, rightMargin);
 
             Iterator<String> inputIterator = input.lines().iterator();
             Iterator<String> outputIterator = output.lines().iterator();