You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pa...@apache.org on 2017/05/04 11:01:44 UTC

[1/3] [text] use System.lineSeparator() instead of System.getProperty("line.separator")

Repository: commons-text
Updated Branches:
  refs/heads/master 4d84a33e4 -> d4890a893


use System.lineSeparator() instead of System.getProperty("line.separator")


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/1dd427b4
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/1dd427b4
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/1dd427b4

Branch: refs/heads/master
Commit: 1dd427b46a6f13fdf92eab328aa79b77a0dbc0cb
Parents: 4d84a33
Author: Pascal Schumacher <pa...@gmx.net>
Authored: Thu May 4 12:43:02 2017 +0200
Committer: Pascal Schumacher <pa...@gmx.net>
Committed: Thu May 4 12:43:02 2017 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/text/AlphabetConverter.java | 7 +------
 src/main/java/org/apache/commons/text/StrBuilder.java        | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/1dd427b4/src/main/java/org/apache/commons/text/AlphabetConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/AlphabetConverter.java b/src/main/java/org/apache/commons/text/AlphabetConverter.java
index a216305..dcc2eee 100644
--- a/src/main/java/org/apache/commons/text/AlphabetConverter.java
+++ b/src/main/java/org/apache/commons/text/AlphabetConverter.java
@@ -88,11 +88,6 @@ public final class AlphabetConverter {
      * Arrow constant, used for converting the object into a string.
      */
     private static final String ARROW = " -> ";
-    /**
-     * Line separator, used for converting the object into a string.
-     */
-    private static final String LINE_SEPARATOR =
-            System.getProperty("line.separator");
 
     /**
      * Hidden constructor for alphabet converter. Used by static helper methods.
@@ -284,7 +279,7 @@ public final class AlphabetConverter {
                 : originalToEncoded.entrySet()) {
             sb.append(codePointToString(entry.getKey()))
                     .append(ARROW)
-                    .append(entry.getValue()).append(LINE_SEPARATOR);
+                    .append(entry.getValue()).append(System.lineSeparator());
         }
 
         return sb.toString();

http://git-wip-us.apache.org/repos/asf/commons-text/blob/1dd427b4/src/main/java/org/apache/commons/text/StrBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/StrBuilder.java b/src/main/java/org/apache/commons/text/StrBuilder.java
index a3bc429..bb6e55e 100644
--- a/src/main/java/org/apache/commons/text/StrBuilder.java
+++ b/src/main/java/org/apache/commons/text/StrBuilder.java
@@ -472,7 +472,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
      */
     public StrBuilder appendNewLine() {
         if (newLine == null)  {
-            append(System.getProperty("line.separator"));
+            append(System.lineSeparator());
             return this;
         }
         return append(newLine);


[3/3] [text] StrBuilder: remove commented-out code

Posted by pa...@apache.org.
StrBuilder: remove commented-out code


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/d4890a89
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/d4890a89
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/d4890a89

Branch: refs/heads/master
Commit: d4890a893e53c9bae1a20c19462ffbfeb78b79b9
Parents: aa2a77e
Author: Pascal Schumacher <pa...@gmx.net>
Authored: Thu May 4 13:01:00 2017 +0200
Committer: Pascal Schumacher <pa...@gmx.net>
Committed: Thu May 4 13:01:00 2017 +0200

----------------------------------------------------------------------
 .../org/apache/commons/text/StrBuilder.java     | 31 --------------------
 1 file changed, 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/d4890a89/src/main/java/org/apache/commons/text/StrBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/StrBuilder.java b/src/main/java/org/apache/commons/text/StrBuilder.java
index 676a929..1eafba6 100644
--- a/src/main/java/org/apache/commons/text/StrBuilder.java
+++ b/src/main/java/org/apache/commons/text/StrBuilder.java
@@ -2716,37 +2716,6 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
         }
     }
 
-    //-----------------------------------------------------------------------
-//    /**
-//     * Gets a String version of the string builder by calling the internal
-//     * constructor of String by reflection.
-//     * <p>
-//     * WARNING: You must not use the StrBuilder after calling this method
-//     * as the buffer is now shared with the String object. To ensure this,
-//     * the internal character array is set to null, so you will get
-//     * NullPointerExceptions on all method calls.
-//     *
-//     * @return the builder as a String
-//     */
-//    public String toSharedString() {
-//        try {
-//            Constructor con = String.class.getDeclaredConstructor(
-//                new Class[] {int.class, int.class, char[].class});
-//            con.setAccessible(true);
-//            char[] buffer = buf;
-//            buf = null;
-//            size = -1;
-//            nullText = null;
-//            return (String) con.newInstance(
-//                new Object[] {Integer.valueOf(0), Integer.valueOf(size), buffer});
-//
-//        } catch (Exception ex) {
-//            ex.printStackTrace();
-//            throw new UnsupportedOperationException("StrBuilder.toSharedString is unsupported: " + ex.getMessage());
-//        }
-//    }
-
-    //-----------------------------------------------------------------------
     /**
      * Checks the contents of this builder against another to see if they
      * contain the same character content ignoring case.


[2/3] [text] fix some javadoc typos

Posted by pa...@apache.org.
fix some javadoc typos


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/aa2a77ef
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/aa2a77ef
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/aa2a77ef

Branch: refs/heads/master
Commit: aa2a77effd4ddd21c382f98744ab899fb569f932
Parents: 1dd427b
Author: Pascal Schumacher <pa...@gmx.net>
Authored: Thu May 4 12:46:46 2017 +0200
Committer: Pascal Schumacher <pa...@gmx.net>
Committed: Thu May 4 12:49:00 2017 +0200

----------------------------------------------------------------------
 .../org/apache/commons/text/StrBuilder.java     |  2 +-
 .../org/apache/commons/text/StrSubstitutor.java | 22 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/aa2a77ef/src/main/java/org/apache/commons/text/StrBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/StrBuilder.java b/src/main/java/org/apache/commons/text/StrBuilder.java
index bb6e55e..676a929 100644
--- a/src/main/java/org/apache/commons/text/StrBuilder.java
+++ b/src/main/java/org/apache/commons/text/StrBuilder.java
@@ -2615,7 +2615,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
      * changed on the tokenizer class, before retrieving the tokens.
      * <p>
      * The returned tokenizer is linked to this builder. You may intermix
-     * calls to the buider and tokenizer within certain limits, however
+     * calls to the builder and tokenizer within certain limits, however
      * there is no synchronization. Once the tokenizer has been used once,
      * it must be {@link StrTokenizer#reset() reset} to pickup the latest
      * changes in the builder. For example:

http://git-wip-us.apache.org/repos/asf/commons-text/blob/aa2a77ef/src/main/java/org/apache/commons/text/StrSubstitutor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/StrSubstitutor.java b/src/main/java/org/apache/commons/text/StrSubstitutor.java
index 82a4e22..3cb4b9b 100644
--- a/src/main/java/org/apache/commons/text/StrSubstitutor.java
+++ b/src/main/java/org/apache/commons/text/StrSubstitutor.java
@@ -184,7 +184,7 @@ public class StrSubstitutor {
 
     /**
      * Replaces all the occurrences of variables in the given source object with
-     * their matching values from the map. This method allows to specifiy a
+     * their matching values from the map. This method allows to specify a
      * custom variable prefix and suffix
      *
      * @param <V> the type of the values in the map
@@ -960,7 +960,7 @@ public class StrSubstitutor {
     /**
      * Gets the variable prefix matcher currently in use.
      * <p>
-     * The variable prefix is the characer or characters that identify the
+     * The variable prefix is the character or characters that identify the
      * start of a variable. This prefix is expressed in terms of a matcher
      * allowing advanced prefix matches.
      *
@@ -973,7 +973,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable prefix matcher currently in use.
      * <p>
-     * The variable prefix is the characer or characters that identify the
+     * The variable prefix is the character or characters that identify the
      * start of a variable. This prefix is expressed in terms of a matcher
      * allowing advanced prefix matches.
      *
@@ -1006,7 +1006,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable prefix to use.
      * <p>
-     * The variable prefix is the characer or characters that identify the
+     * The variable prefix is the character or characters that identify the
      * start of a variable. This method allows a string prefix to be easily set.
      *
      * @param prefix  the prefix for variables, not null
@@ -1025,7 +1025,7 @@ public class StrSubstitutor {
     /**
      * Gets the variable suffix matcher currently in use.
      * <p>
-     * The variable suffix is the characer or characters that identify the
+     * The variable suffix is the character or characters that identify the
      * end of a variable. This suffix is expressed in terms of a matcher
      * allowing advanced suffix matches.
      *
@@ -1038,7 +1038,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable suffix matcher currently in use.
      * <p>
-     * The variable suffix is the characer or characters that identify the
+     * The variable suffix is the character or characters that identify the
      * end of a variable. This suffix is expressed in terms of a matcher
      * allowing advanced suffix matches.
      *
@@ -1057,7 +1057,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable suffix to use.
      * <p>
-     * The variable suffix is the characer or characters that identify the
+     * The variable suffix is the character or characters that identify the
      * end of a variable. This method allows a single character suffix to
      * be easily set.
      *
@@ -1090,7 +1090,7 @@ public class StrSubstitutor {
     /**
      * Gets the variable default value delimiter matcher currently in use.
      * <p>
-     * The variable default value delimiter is the characer or characters that delimite the
+     * The variable default value delimiter is the character or characters that delimite the
      * variable name and the variable default value. This delimiter is expressed in terms of a matcher
      * allowing advanced variable default value delimiter matches.
      * <p>
@@ -1105,7 +1105,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter matcher to use.
      * <p>
-     * The variable default value delimiter is the characer or characters that delimite the
+     * The variable default value delimiter is the character or characters that delimite the
      * variable name and the variable default value. This delimiter is expressed in terms of a matcher
      * allowing advanced variable default value delimiter matches.
      * <p>
@@ -1123,7 +1123,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the characer or characters that delimite the
+     * The variable default value delimiter is the character or characters that delimite the
      * variable name and the variable default value. This method allows a single character
      * variable default value delimiter to be easily set.
      *
@@ -1137,7 +1137,7 @@ public class StrSubstitutor {
     /**
      * Sets the variable default value delimiter to use.
      * <p>
-     * The variable default value delimiter is the characer or characters that delimite the
+     * The variable default value delimiter is the character or characters that delimite the
      * variable name and the variable default value. This method allows a string
      * variable default value delimiter to be easily set.
      * <p>