You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2017/03/27 18:17:15 UTC
[1/2] [lang] Correct @since annotation
Repository: commons-lang
Updated Branches:
refs/heads/master 1674c953f -> b06f13ff0
Correct @since annotation
Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/54c3daaf
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/54c3daaf
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/54c3daaf
Branch: refs/heads/master
Commit: 54c3daaf17f90b273cfd3dc17dac91c9e65d7b17
Parents: 1674c95
Author: Benedikt Ritter <be...@gmail.com>
Authored: Mon Mar 27 20:09:14 2017 +0200
Committer: Benedikt Ritter <be...@gmail.com>
Committed: Mon Mar 27 20:09:14 2017 +0200
----------------------------------------------------------------------
src/main/java/org/apache/commons/lang3/StringUtils.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/54c3daaf/src/main/java/org/apache/commons/lang3/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 98a2d0c..6181835 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -7560,7 +7560,7 @@ public class StringUtils {
* @param maxWidth maximum length of result String, must be at least {@code abbrevMarker.length + 1}
* @return abbreviated String, {@code null} if null String input
* @throws IllegalArgumentException if the width is too small
- * @since 3.5
+ * @since 3.6
*/
public static String abbreviate(final String str, final String abbrevMarker, final int maxWidth) {
return abbreviate(str, abbrevMarker, 0, maxWidth);
@@ -7601,7 +7601,7 @@ public class StringUtils {
* @param maxWidth maximum length of result String, must be at least 4
* @return abbreviated String, {@code null} if null String input
* @throws IllegalArgumentException if the width is too small
- * @since 3.5
+ * @since 3.6
*/
public static String abbreviate(final String str, final String abbrevMarker, int offset, final int maxWidth) {
if (isEmpty(str) || isEmpty(abbrevMarker)) {
[2/2] [lang] Remove trailing white spaces
Posted by br...@apache.org.
Remove trailing white spaces
Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/b06f13ff
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/b06f13ff
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/b06f13ff
Branch: refs/heads/master
Commit: b06f13ff0ef8655de1a4f9976f7a9ccf2ca76724
Parents: 54c3daa
Author: Benedikt Ritter <be...@gmail.com>
Authored: Mon Mar 27 20:15:36 2017 +0200
Committer: Benedikt Ritter <be...@gmail.com>
Committed: Mon Mar 27 20:15:36 2017 +0200
----------------------------------------------------------------------
.../org/apache/commons/lang3/ArrayUtils.java | 144 +++++++++----------
.../org/apache/commons/lang3/StringUtils.java | 9 +-
2 files changed, 73 insertions(+), 80 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/b06f13ff/src/main/java/org/apache/commons/lang3/ArrayUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
index 4ced70c..afcb27f 100644
--- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
@@ -8055,18 +8055,18 @@ public class ArrayUtils {
return result;
}
-
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8075,7 +8075,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static boolean[] insert(final int index, final boolean[] array, final boolean... values) {
+ public static boolean[] insert(final int index, final boolean[] array, final boolean... values) {
if (array == null) {
return null;
}
@@ -8085,9 +8085,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
boolean[] result = new boolean[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8097,19 +8097,18 @@ public class ArrayUtils {
}
return result;
}
-
-
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8118,7 +8117,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static byte[] insert(final int index, final byte[] array, final byte... values) {
+ public static byte[] insert(final int index, final byte[] array, final byte... values) {
if (array == null) {
return null;
}
@@ -8128,9 +8127,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
byte[] result = new byte[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8140,19 +8139,18 @@ public class ArrayUtils {
}
return result;
}
-
-
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8161,7 +8159,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static char[] insert(final int index, final char[] array, final char... values) {
+ public static char[] insert(final int index, final char[] array, final char... values) {
if (array == null) {
return null;
}
@@ -8171,9 +8169,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
char[] result = new char[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8182,20 +8180,19 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8204,7 +8201,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static double[] insert(final int index, final double[] array, final double... values) {
+ public static double[] insert(final int index, final double[] array, final double... values) {
if (array == null) {
return null;
}
@@ -8214,9 +8211,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
double[] result = new double[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8225,20 +8222,19 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8247,7 +8243,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static float[] insert(final int index, final float[] array, final float... values) {
+ public static float[] insert(final int index, final float[] array, final float... values) {
if (array == null) {
return null;
}
@@ -8257,9 +8253,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
float[] result = new float[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8268,19 +8264,19 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8289,7 +8285,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static int[] insert(final int index, final int[] array, final int... values) {
+ public static int[] insert(final int index, final int[] array, final int... values) {
if (array == null) {
return null;
}
@@ -8299,9 +8295,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
int[] result = new int[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8310,19 +8306,19 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8331,7 +8327,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static long[] insert(final int index, final long[] array, final long... values) {
+ public static long[] insert(final int index, final long[] array, final long... values) {
if (array == null) {
return null;
}
@@ -8341,9 +8337,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
long[] result = new long[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8352,20 +8348,19 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
* ArrayUtils.insert(index, null, values) = null
* </pre>
- *
+ *
* @param index the position within {@code array} to insert the new values
* @param array the array to insert the values into, may be {@code null}
* @param values the new values to insert, may be {@code null}
@@ -8374,7 +8369,7 @@ public class ArrayUtils {
* and either {@code index < 0} or {@code index > array.length}
* @since 3.6
*/
- public static short[] insert(final int index, final short[] array, final short... values) {
+ public static short[] insert(final int index, final short[] array, final short... values) {
if (array == null) {
return null;
}
@@ -8384,9 +8379,9 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
short[] result = new short[array.length + values.length];
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8395,14 +8390,13 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
-
-
+ }
+
/**
* <p>Inserts elements into an array at the given index (starting from zero).</p>
- *
+ *
* <p>When an array is returned, it is always a new array.</p>
- *
+ *
* <pre>
* ArrayUtils.insert(index, null, null) = null
* ArrayUtils.insert(index, array, null) = cloned copy of 'array'
@@ -8427,7 +8421,7 @@ public class ArrayUtils {
* array to the caller. We also avoid relying on the type of the vararg
* array, by inspecting the component type of 'array'.
*/
-
+
if (array == null) {
return null;
}
@@ -8437,11 +8431,11 @@ public class ArrayUtils {
if (index < 0 || index > array.length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + array.length);
}
-
+
final Class<?> type = array.getClass().getComponentType();
@SuppressWarnings("unchecked") // OK, because array and values are of type T
T[] result = (T[]) Array.newInstance(type, array.length + values.length);
-
+
System.arraycopy(values, 0, result, index, values.length);
if (index > 0) {
System.arraycopy(array, 0, result, 0, index);
@@ -8450,5 +8444,5 @@ public class ArrayUtils {
System.arraycopy(array, index, result, index + values.length, array.length - index);
}
return result;
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/commons-lang/blob/b06f13ff/src/main/java/org/apache/commons/lang3/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 6181835..bd660bc 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -9137,8 +9137,7 @@ public class StringUtils {
return str;
}
-
-
+
/**
* <p>Converts a {@code CharSequence} into an array of code points.</p>
*
@@ -9162,14 +9161,14 @@ public class StringUtils {
if (str.length() == 0) {
return ArrayUtils.EMPTY_INT_ARRAY;
}
-
+
String s = str.toString();
int[] result = new int[s.codePointCount(0, s.length())];
int index = 0;
for (int i = 0; i < result.length; i++) {
result[i] = s.codePointAt(index);
index += Character.charCount(result[i]);
- }
+ }
return result;
- }
+ }
}