You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/06/27 14:22:18 UTC
svn commit: r1606051 [1/2] - in /commons/proper/lang/trunk/src:
main/java/org/apache/commons/lang3/
main/java/org/apache/commons/lang3/builder/
main/java/org/apache/commons/lang3/reflect/
main/java/org/apache/commons/lang3/text/ main/java/org/apache/co...
Author: ggregory
Date: Fri Jun 27 12:22:17 2014
New Revision: 1606051
URL: http://svn.apache.org/r1606051
Log:
Use final consistently.
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassPathUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/EnumUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/LocaleUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/RandomUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/Diff.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffResult.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/OctalUnescaper.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassPathUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/NotImplementedExceptionTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/SerializationUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/DiffResultTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/DiffTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/GenericParent.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/StringParameterizedChild.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrBuilderTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsFragmentTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java Fri Jun 27 12:22:17 2014
@@ -1570,7 +1570,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final boolean[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final boolean[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1605,7 +1605,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final byte[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final byte[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1640,7 +1640,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final char[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final char[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1675,7 +1675,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final double[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final double[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1710,7 +1710,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final float[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final float[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1745,7 +1745,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final int[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final int[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1780,7 +1780,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final long[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final long[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1815,7 +1815,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final Object[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final Object[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
@@ -1850,7 +1850,7 @@ public class ArrayUtils {
* change. Overvalue (>array.length) is demoted to array length.
* @since 3.2
*/
- public static void reverse(final short[] array, int startIndexInclusive, int endIndexExclusive) {
+ public static void reverse(final short[] array, final int startIndexInclusive, final int endIndexExclusive) {
if (array == null) {
return;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java Fri Jun 27 12:22:17 2014
@@ -193,8 +193,8 @@ public class CharSequenceUtils {
int tmpLen = length;
while (tmpLen-- > 0) {
- char c1 = cs.charAt(index1++);
- char c2 = substring.charAt(index2++);
+ final char c1 = cs.charAt(index1++);
+ final char c2 = substring.charAt(index2++);
if (c1 == c2) {
continue;
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassPathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassPathUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassPathUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassPathUtils.java Fri Jun 27 12:22:17 2014
@@ -80,7 +80,7 @@ public class ClassPathUtils {
public static String toFullyQualifiedName(final Package context, final String resourceName) {
Validate.notNull(context, "Parameter '%s' must not be null!", "context" );
Validate.notNull(resourceName, "Parameter '%s' must not be null!", "resourceName");
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(context.getName());
sb.append(".");
sb.append(resourceName);
@@ -129,7 +129,7 @@ public class ClassPathUtils {
public static String toFullyQualifiedPath(final Package context, final String resourceName) {
Validate.notNull(context, "Parameter '%s' must not be null!", "context" );
Validate.notNull(resourceName, "Parameter '%s' must not be null!", "resourceName");
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(context.getName().replace('.', '/'));
sb.append("/");
sb.append(resourceName);
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java Fri Jun 27 12:22:17 2014
@@ -127,7 +127,7 @@ public class ClassUtils {
m.put("char", "C");
m.put("void", "V");
final Map<String, String> r = new HashMap<String, String>();
- for (Map.Entry<String, String> e : m.entrySet()) {
+ for (final Map.Entry<String, String> e : m.entrySet()) {
r.put(e.getValue(), e.getKey());
}
abbreviationMap = Collections.unmodifiableMap(m);
@@ -1158,7 +1158,7 @@ public class ClassUtils {
* @return Iterable an Iterable over the class hierarchy of the given class
* @since 3.2
*/
- public static Iterable<Class<?>> hierarchy(final Class<?> type, Interfaces interfacesBehavior) {
+ public static Iterable<Class<?>> hierarchy(final Class<?> type, final Interfaces interfacesBehavior) {
final Iterable<Class<?>> classes = new Iterable<Class<?>>() {
@Override
@@ -1219,8 +1219,8 @@ public class ClassUtils {
return nextSuperclass;
}
- private void walkInterfaces(Set<Class<?>> addTo, Class<?> c) {
- for (Class<?> iface : c.getInterfaces()) {
+ private void walkInterfaces(final Set<Class<?>> addTo, final Class<?> c) {
+ for (final Class<?> iface : c.getInterfaces()) {
if (!seenInterfaces.contains(iface)) {
addTo.add(iface);
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/EnumUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/EnumUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/EnumUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/EnumUtils.java Fri Jun 27 12:22:17 2014
@@ -266,7 +266,7 @@ public class EnumUtils {
*/
public static <E extends Enum<E>> EnumSet<E> processBitVectors(final Class<E> enumClass, final long... values) {
final EnumSet<E> results = EnumSet.noneOf(asEnum(enumClass));
- long[] lvalues = ArrayUtils.clone(Validate.notNull(values));
+ final long[] lvalues = ArrayUtils.clone(Validate.notNull(values));
ArrayUtils.reverse(lvalues);
for (final E constant : enumClass.getEnumConstants()) {
final int block = constant.ordinal() / Long.SIZE;
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/LocaleUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/LocaleUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/LocaleUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/LocaleUtils.java Fri Jun 27 12:22:17 2014
@@ -123,8 +123,8 @@ public class LocaleUtils {
return new Locale("", str.substring(1, 3), str.substring(4));
}
- String[] split = str.split("_", -1);
- int occurrences = split.length -1;
+ final String[] split = str.split("_", -1);
+ final int occurrences = split.length -1;
switch (occurrences) {
case 0:
if (StringUtils.isAllLowerCase(str) && (len == 2 || len == 3)) {
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java Fri Jun 27 12:22:17 2014
@@ -239,7 +239,7 @@ public class ObjectUtils {
int hash = 1;
if (objects != null) {
for (final Object object : objects) {
- int tmpHash = ObjectUtils.hashCode(object);
+ final int tmpHash = ObjectUtils.hashCode(object);
hash = hash * 31 + tmpHash;
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/RandomUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/RandomUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/RandomUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/RandomUtils.java Fri Jun 27 12:22:17 2014
@@ -59,10 +59,10 @@ public class RandomUtils {
* @return the random byte array
* @throws IllegalArgumentException if {@code count} is negative
*/
- public static byte[] nextBytes(int count) {
+ public static byte[] nextBytes(final int count) {
Validate.isTrue(count >= 0, "Count cannot be negative.");
- byte[] result = new byte[count];
+ final byte[] result = new byte[count];
RANDOM.nextBytes(result);
return result;
}
@@ -81,7 +81,7 @@ public class RandomUtils {
* {@code startInclusive} is negative
* @return the random integer
*/
- public static int nextInt(int startInclusive, int endExclusive) {
+ public static int nextInt(final int startInclusive, final int endExclusive) {
Validate.isTrue(endExclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
@@ -107,7 +107,7 @@ public class RandomUtils {
* {@code startInclusive} is negative
* @return the random long
*/
- public static long nextLong(long startInclusive, long endExclusive) {
+ public static long nextLong(final long startInclusive, final long endExclusive) {
Validate.isTrue(endExclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
@@ -134,7 +134,7 @@ public class RandomUtils {
* {@code startInclusive} is negative
* @return the random double
*/
- public static double nextDouble(double startInclusive, double endInclusive) {
+ public static double nextDouble(final double startInclusive, final double endInclusive) {
Validate.isTrue(endInclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
@@ -160,7 +160,7 @@ public class RandomUtils {
* {@code startInclusive} is negative
* @return the random float
*/
- public static float nextFloat(float startInclusive, float endInclusive) {
+ public static float nextFloat(final float startInclusive, final float endInclusive) {
Validate.isTrue(endInclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Fri Jun 27 12:22:17 2014
@@ -255,11 +255,11 @@ public class StringUtils {
* @return {@code true} if any of the CharSequences are empty or null
* @since 3.2
*/
- public static boolean isAnyEmpty(CharSequence... css) {
+ public static boolean isAnyEmpty(final CharSequence... css) {
if (ArrayUtils.isEmpty(css)) {
return true;
}
- for (CharSequence cs : css){
+ for (final CharSequence cs : css){
if (isEmpty(cs)) {
return true;
}
@@ -284,7 +284,7 @@ public class StringUtils {
* @return {@code true} if none of the CharSequences are empty or null
* @since 3.2
*/
- public static boolean isNoneEmpty(CharSequence... css) {
+ public static boolean isNoneEmpty(final CharSequence... css) {
return !isAnyEmpty(css);
}
/**
@@ -355,11 +355,11 @@ public class StringUtils {
* @return {@code true} if any of the CharSequences are blank or null or whitespace only
* @since 3.2
*/
- public static boolean isAnyBlank(CharSequence... css) {
+ public static boolean isAnyBlank(final CharSequence... css) {
if (ArrayUtils.isEmpty(css)) {
return true;
}
- for (CharSequence cs : css){
+ for (final CharSequence cs : css){
if (isBlank(cs)) {
return true;
}
@@ -385,7 +385,7 @@ public class StringUtils {
* @return {@code true} if none of the CharSequences are blank or null or whitespace only
* @since 3.2
*/
- public static boolean isNoneBlank(CharSequence... css) {
+ public static boolean isNoneBlank(final CharSequence... css) {
return !isAnyBlank(css);
}
@@ -4041,6 +4041,7 @@ public class StringUtils {
final Object first = iterator.next();
if (!iterator.hasNext()) {
@SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated in 3.2
+ final
String result = ObjectUtils.toString(first);
return result;
}
@@ -5689,7 +5690,7 @@ public class StringUtils {
return str;
}
- char firstChar = str.charAt(0);
+ final char firstChar = str.charAt(0);
if (Character.isTitleCase(firstChar)) {
// already capitalized
return str;
@@ -5727,7 +5728,7 @@ public class StringUtils {
return str;
}
- char firstChar = str.charAt(0);
+ final char firstChar = str.charAt(0);
if (Character.isLowerCase(firstChar)) {
// already uncapitalized
return str;
@@ -7126,11 +7127,11 @@ public class StringUtils {
int previousMatchingCharacterIndex = Integer.MIN_VALUE;
for (int queryIndex = 0; queryIndex < queryLowerCase.length(); queryIndex++) {
- char queryChar = queryLowerCase.charAt(queryIndex);
+ final char queryChar = queryLowerCase.charAt(queryIndex);
boolean termCharacterMatchFound = false;
for (; termIndex < termLowerCase.length() && !termCharacterMatchFound; termIndex++) {
- char termChar = termLowerCase.charAt(termIndex);
+ final char termChar = termLowerCase.charAt(termIndex);
if (queryChar == termChar) {
// simple character matches result in one point
@@ -7191,7 +7192,7 @@ public class StringUtils {
* @param second The second string.
* @return The number of transposition between the two strings.
*/
- private static int transpositions(CharSequence first, CharSequence second) {
+ private static int transpositions(final CharSequence first, final CharSequence second) {
int transpositions = 0;
for (int i = 0; i < first.length(); i++) {
if (first.charAt(i) != second.charAt(i)) {
@@ -7208,7 +7209,7 @@ public class StringUtils {
* @param second The second string.
* @return A number between 0 and 4.
*/
- private static int commonPrefixLength(CharSequence first, CharSequence second) {
+ private static int commonPrefixLength(final CharSequence first, final CharSequence second) {
final int result = getCommonPrefix(first.toString(), second.toString()).length();
// Limit the result to 4.
@@ -7714,7 +7715,7 @@ public class StringUtils {
* @since 3.2
* @since 3.3 No longer throws {@link UnsupportedEncodingException}.
*/
- public static String toEncodedString(byte[] bytes, Charset charset) {
+ public static String toEncodedString(final byte[] bytes, final Charset charset) {
return new String(bytes, charset != null ? charset : Charset.defaultCharset());
}
@@ -7739,7 +7740,7 @@ public class StringUtils {
* @return the wrapped string, or {@code null} if {@code str==null}
* @since 3.4
*/
- public static String wrap(String str, char wrapWith) {
+ public static String wrap(final String str, final char wrapWith) {
if (isEmpty(str) || wrapWith == '\0') {
return str;
@@ -7777,7 +7778,7 @@ public class StringUtils {
* @return wrapped String, {@code null} if null String input
* @since 3.4
*/
- public static String wrap(String str, String wrapWith) {
+ public static String wrap(final String str, final String wrapWith) {
if (isEmpty(str) || isEmpty(wrapWith)) {
return str;
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java Fri Jun 27 12:22:17 2014
@@ -940,7 +940,7 @@ public class Validate {
* @since 3.3
*/
@SuppressWarnings("boxing")
- public static void inclusiveBetween(long start, long end, long value) {
+ public static void inclusiveBetween(final long start, final long end, final long value) {
// TODO when breaking BC, consider returning value
if (value < start || value > end) {
throw new IllegalArgumentException(String.format(DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
@@ -963,7 +963,7 @@ public class Validate {
*
* @since 3.3
*/
- public static void inclusiveBetween(long start, long end, long value, String message) {
+ public static void inclusiveBetween(final long start, final long end, final long value, final String message) {
// TODO when breaking BC, consider returning value
if (value < start || value > end) {
throw new IllegalArgumentException(String.format(message));
@@ -984,7 +984,7 @@ public class Validate {
* @since 3.3
*/
@SuppressWarnings("boxing")
- public static void inclusiveBetween(double start, double end, double value) {
+ public static void inclusiveBetween(final double start, final double end, final double value) {
// TODO when breaking BC, consider returning value
if (value < start || value > end) {
throw new IllegalArgumentException(String.format(DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
@@ -1007,7 +1007,7 @@ public class Validate {
*
* @since 3.3
*/
- public static void inclusiveBetween(double start, double end, double value, String message) {
+ public static void inclusiveBetween(final double start, final double end, final double value, final String message) {
// TODO when breaking BC, consider returning value
if (value < start || value > end) {
throw new IllegalArgumentException(String.format(message));
@@ -1078,7 +1078,7 @@ public class Validate {
* @since 3.3
*/
@SuppressWarnings("boxing")
- public static void exclusiveBetween(long start, long end, long value) {
+ public static void exclusiveBetween(final long start, final long end, final long value) {
// TODO when breaking BC, consider returning value
if (value <= start || value >= end) {
throw new IllegalArgumentException(String.format(DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
@@ -1101,7 +1101,7 @@ public class Validate {
*
* @since 3.3
*/
- public static void exclusiveBetween(long start, long end, long value, String message) {
+ public static void exclusiveBetween(final long start, final long end, final long value, final String message) {
// TODO when breaking BC, consider returning value
if (value <= start || value >= end) {
throw new IllegalArgumentException(String.format(message));
@@ -1122,7 +1122,7 @@ public class Validate {
* @since 3.3
*/
@SuppressWarnings("boxing")
- public static void exclusiveBetween(double start, double end, double value) {
+ public static void exclusiveBetween(final double start, final double end, final double value) {
// TODO when breaking BC, consider returning value
if (value <= start || value >= end) {
throw new IllegalArgumentException(String.format(DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
@@ -1145,7 +1145,7 @@ public class Validate {
*
* @since 3.3
*/
- public static void exclusiveBetween(double start, double end, double value, String message) {
+ public static void exclusiveBetween(final double start, final double end, final double value, final String message) {
// TODO when breaking BC, consider returning value
if (value <= start || value >= end) {
throw new IllegalArgumentException(String.format(message));
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/Diff.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/Diff.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/Diff.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/Diff.java Fri Jun 27 12:22:17 2014
@@ -56,7 +56,7 @@ public abstract class Diff<T> extends Pa
* @param fieldName
* the name of the field
*/
- protected Diff(String fieldName) {
+ protected Diff(final String fieldName) {
this.type = ObjectUtils.defaultIfNull(
TypeUtils.getTypeArguments(getClass(), Diff.class).get(
Diff.class.getTypeParameters()[0]), Object.class);
@@ -112,7 +112,7 @@ public abstract class Diff<T> extends Pa
* @return nothing
*/
@Override
- public final T setValue(T value) {
+ public final T setValue(final T value) {
throw new UnsupportedOperationException("Cannot alter Diff object.");
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffResult.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffResult.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffResult.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffResult.java Fri Jun 27 12:22:17 2014
@@ -177,15 +177,15 @@ public class DiffResult implements Itera
*
* @return a {@code String} description of the differences.
*/
- public String toString(ToStringStyle style) {
+ public String toString(final ToStringStyle style) {
if (diffs.size() == 0) {
return OBJECTS_SAME_STRING;
}
- ToStringBuilder lhsBuilder = new ToStringBuilder(lhs, style);
- ToStringBuilder rhsBuilder = new ToStringBuilder(rhs, style);
+ final ToStringBuilder lhsBuilder = new ToStringBuilder(lhs, style);
+ final ToStringBuilder rhsBuilder = new ToStringBuilder(rhs, style);
- for (Diff<?> diff : diffs) {
+ for (final Diff<?> diff : diffs) {
lhsBuilder.append(diff.getFieldName(), diff.getLeft());
rhsBuilder.append(diff.getFieldName(), diff.getRight());
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/RecursiveToStringStyle.java Fri Jun 27 12:22:17 2014
@@ -68,7 +68,7 @@ public class RecursiveToStringStyle exte
}
@Override
- public void appendDetail(StringBuffer buffer, String fieldName, Object value) {
+ public void appendDetail(final StringBuffer buffer, final String fieldName, final Object value) {
if (!ClassUtils.isPrimitiveWrapper(value.getClass()) &&
!String.class.equals(value.getClass()) &&
accept(value.getClass())) {
@@ -79,7 +79,7 @@ public class RecursiveToStringStyle exte
}
@Override
- protected void appendDetail(StringBuffer buffer, String fieldName, Collection<?> coll) {
+ protected void appendDetail(final StringBuffer buffer, final String fieldName, final Collection<?> coll) {
appendClassName(buffer, coll);
appendIdentityHashCode(buffer, coll);
appendDetail(buffer, fieldName, coll.toArray());
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Fri Jun 27 12:22:17 2014
@@ -193,7 +193,7 @@ public class FieldUtils {
* if the class is {@code null}
* @since 3.2
*/
- public static Field[] getAllFields(Class<?> cls) {
+ public static Field[] getAllFields(final Class<?> cls) {
final List<Field> allFieldsList = getAllFieldsList(cls);
return allFieldsList.toArray(new Field[allFieldsList.size()]);
}
@@ -208,13 +208,13 @@ public class FieldUtils {
* if the class is {@code null}
* @since 3.2
*/
- public static List<Field> getAllFieldsList(Class<?> cls) {
+ public static List<Field> getAllFieldsList(final Class<?> cls) {
Validate.isTrue(cls != null, "The class must not be null");
final List<Field> allFields = new ArrayList<Field>();
Class<?> currentClass = cls;
while (currentClass != null) {
final Field[] declaredFields = currentClass.getDeclaredFields();
- for (Field field : declaredFields) {
+ for (final Field field : declaredFields) {
allFields.add(field);
}
currentClass = currentClass.getSuperclass();
@@ -658,7 +658,7 @@ public class FieldUtils {
* if the field is {@code null}
* @since 3.2
*/
- public static void removeFinalModifier(Field field) {
+ public static void removeFinalModifier(final Field field) {
removeFinalModifier(field, true);
}
@@ -675,13 +675,13 @@ public class FieldUtils {
* if the field is {@code null}
* @since 3.3
*/
- public static void removeFinalModifier(Field field, boolean forceAccess) {
+ public static void removeFinalModifier(final Field field, final boolean forceAccess) {
Validate.isTrue(field != null, "The field must not be null");
try {
if (Modifier.isFinal(field.getModifiers())) {
// Do all JREs implement Field with a private ivar called "modifiers"?
- Field modifiersField = Field.class.getDeclaredField("modifiers");
+ final Field modifiersField = Field.class.getDeclaredField("modifiers");
final boolean doForceAccess = forceAccess && !modifiersField.isAccessible();
if (doForceAccess) {
modifiersField.setAccessible(true);
@@ -694,9 +694,9 @@ public class FieldUtils {
}
}
}
- } catch (NoSuchFieldException ignored) {
+ } catch (final NoSuchFieldException ignored) {
// The field class contains always a modifiers field
- } catch (IllegalAccessException ignored) {
+ } catch (final IllegalAccessException ignored) {
// The modifiers field is made accessible
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java Fri Jun 27 12:22:17 2014
@@ -439,7 +439,7 @@ public class MethodUtils {
*/
}
// Recursively check our parent interfaces
- Method method = getAccessibleMethodFromInterfaceNest(interfaces[i],
+ final Method method = getAccessibleMethodFromInterfaceNest(interfaces[i],
methodName, parameterTypes);
if (method != null) {
return method;
@@ -509,7 +509,7 @@ public class MethodUtils {
* @throws NullPointerException if the specified method is {@code null}
* @since 3.2
*/
- public static Set<Method> getOverrideHierarchy(final Method method, Interfaces interfacesBehavior) {
+ public static Set<Method> getOverrideHierarchy(final Method method, final Interfaces interfacesBehavior) {
Validate.notNull(method);
final Set<Method> result = new LinkedHashSet<Method>();
result.add(method);
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java Fri Jun 27 12:22:17 2014
@@ -96,7 +96,7 @@ public abstract class TypeLiteral<T> imp
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (obj == this) {
return true;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java Fri Jun 27 12:22:17 2014
@@ -65,7 +65,7 @@ public class TypeUtils {
* @param bounds to set
* @return {@code this}
*/
- public WildcardTypeBuilder withUpperBounds(Type... bounds) {
+ public WildcardTypeBuilder withUpperBounds(final Type... bounds) {
this.upperBounds = bounds;
return this;
}
@@ -75,7 +75,7 @@ public class TypeUtils {
* @param bounds to set
* @return {@code this}
*/
- public WildcardTypeBuilder withLowerBounds(Type... bounds) {
+ public WildcardTypeBuilder withLowerBounds(final Type... bounds) {
this.lowerBounds = bounds;
return this;
}
@@ -100,7 +100,7 @@ public class TypeUtils {
* Constructor
* @param componentType of this array type
*/
- private GenericArrayTypeImpl(Type componentType) {
+ private GenericArrayTypeImpl(final Type componentType) {
this.componentType = componentType;
}
@@ -124,7 +124,7 @@ public class TypeUtils {
* {@inheritDoc}
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
return obj == this || obj instanceof GenericArrayType && TypeUtils.equals(this, (GenericArrayType) obj);
}
@@ -154,7 +154,7 @@ public class TypeUtils {
* @param useOwner owner type to use, if any
* @param typeArguments formal type arguments
*/
- private ParameterizedTypeImpl(Class<?> raw, Type useOwner, Type[] typeArguments) {
+ private ParameterizedTypeImpl(final Class<?> raw, final Type useOwner, final Type[] typeArguments) {
this.raw = raw;
this.useOwner = useOwner;
this.typeArguments = typeArguments;
@@ -196,7 +196,7 @@ public class TypeUtils {
* {@inheritDoc}
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
return obj == this || obj instanceof ParameterizedType && TypeUtils.equals(this, ((ParameterizedType) obj));
}
@@ -231,7 +231,7 @@ public class TypeUtils {
* @param upperBounds of this type
* @param lowerBounds of this type
*/
- private WildcardTypeImpl(Type[] upperBounds, Type[] lowerBounds) {
+ private WildcardTypeImpl(final Type[] upperBounds, final Type[] lowerBounds) {
this.upperBounds = ObjectUtils.defaultIfNull(upperBounds, EMPTY_BOUNDS);
this.lowerBounds = ObjectUtils.defaultIfNull(lowerBounds, EMPTY_BOUNDS);
}
@@ -264,7 +264,7 @@ public class TypeUtils {
* {@inheritDoc}
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
return obj == this || obj instanceof WildcardType && TypeUtils.equals(this, (WildcardType) obj);
}
@@ -1424,7 +1424,7 @@ public class TypeUtils {
* @return boolean
* @since 3.2
*/
- public static boolean containsTypeVariables(Type type) {
+ public static boolean containsTypeVariables(final Type type) {
if (type instanceof TypeVariable<?>) {
return true;
}
@@ -1432,7 +1432,7 @@ public class TypeUtils {
return ((Class<?>) type).getTypeParameters().length > 0;
}
if (type instanceof ParameterizedType) {
- for (Type arg : ((ParameterizedType) type).getActualTypeArguments()) {
+ for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) {
if (containsTypeVariables(arg)) {
return true;
}
@@ -1440,7 +1440,7 @@ public class TypeUtils {
return false;
}
if (type instanceof WildcardType) {
- WildcardType wild = (WildcardType) type;
+ final WildcardType wild = (WildcardType) type;
return containsTypeVariables(TypeUtils.getImplicitLowerBounds(wild)[0])
|| containsTypeVariables(TypeUtils.getImplicitUpperBounds(wild)[0]);
}
@@ -1528,10 +1528,10 @@ public class TypeUtils {
* @param variables expected map keys
* @return array of map values corresponding to specified keys
*/
- private static Type[] extractTypeArgumentsFrom(Map<TypeVariable<?>, Type> mappings, TypeVariable<?>[] variables) {
+ private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) {
final Type[] result = new Type[variables.length];
int index = 0;
- for (TypeVariable<?> var : variables) {
+ for (final TypeVariable<?> var : variables) {
Validate.isTrue(mappings.containsKey(var), "missing argument mapping for %s", toString(var));
result[index++] = mappings.get(var);
}
@@ -1568,7 +1568,7 @@ public class TypeUtils {
* @since 3.2
*/
@SuppressWarnings( "deprecation" ) // ObjectUtils.equals(Object, Object) has been deprecated in 3.2
- public static boolean equals(Type t1, Type t2) {
+ public static boolean equals(final Type t1, final Type t2) {
if (ObjectUtils.equals(t1, t2)) {
return true;
}
@@ -1591,7 +1591,7 @@ public class TypeUtils {
* @return boolean
* @since 3.2
*/
- private static boolean equals(ParameterizedType p, Type t) {
+ private static boolean equals(final ParameterizedType p, final Type t) {
if (t instanceof ParameterizedType) {
final ParameterizedType other = (ParameterizedType) t;
if (equals(p.getRawType(), other.getRawType()) && equals(p.getOwnerType(), other.getOwnerType())) {
@@ -1608,7 +1608,7 @@ public class TypeUtils {
* @return boolean
* @since 3.2
*/
- private static boolean equals(GenericArrayType a, Type t) {
+ private static boolean equals(final GenericArrayType a, final Type t) {
return t instanceof GenericArrayType
&& equals(a.getGenericComponentType(), ((GenericArrayType) t).getGenericComponentType());
}
@@ -1620,7 +1620,7 @@ public class TypeUtils {
* @return boolean
* @since 3.2
*/
- private static boolean equals(WildcardType w, Type t) {
+ private static boolean equals(final WildcardType w, final Type t) {
if (t instanceof WildcardType) {
final WildcardType other = (WildcardType) t;
return equals(getImplicitLowerBounds(w), getImplicitLowerBounds(other))
@@ -1636,7 +1636,7 @@ public class TypeUtils {
* @return boolean
* @since 3.2
*/
- private static boolean equals(Type[] t1, Type[] t2) {
+ private static boolean equals(final Type[] t1, final Type[] t2) {
if (t1.length == t2.length) {
for (int i = 0; i < t1.length; i++) {
if (!equals(t1[i], t2[i])) {
@@ -1655,7 +1655,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- public static String toString(Type type) {
+ public static String toString(final Type type) {
Validate.notNull(type);
if (type instanceof Class<?>) {
return classToString((Class<?>) type);
@@ -1682,7 +1682,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- public static String toLongString(TypeVariable<?> var) {
+ public static String toLongString(final TypeVariable<?> var) {
Validate.notNull(var, "var is null");
final StringBuilder buf = new StringBuilder();
final GenericDeclaration d = ((TypeVariable<?>) var).getGenericDeclaration();
@@ -1739,7 +1739,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- private static String classToString(Class<?> c) {
+ private static String classToString(final Class<?> c) {
final StringBuilder buf = new StringBuilder();
if (c.getEnclosingClass() != null) {
@@ -1761,7 +1761,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- private static String typeVariableToString(TypeVariable<?> v) {
+ private static String typeVariableToString(final TypeVariable<?> v) {
final StringBuilder buf = new StringBuilder(v.getName());
final Type[] bounds = v.getBounds();
if (bounds.length > 0 && !(bounds.length == 1 && Object.class.equals(bounds[0]))) {
@@ -1777,7 +1777,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- private static String parameterizedTypeToString(ParameterizedType p) {
+ private static String parameterizedTypeToString(final ParameterizedType p) {
final StringBuilder buf = new StringBuilder();
final Type useOwner = p.getOwnerType();
@@ -1804,7 +1804,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- private static String wildcardTypeToString(WildcardType w) {
+ private static String wildcardTypeToString(final WildcardType w) {
final StringBuilder buf = new StringBuilder().append('?');
final Type[] lowerBounds = w.getLowerBounds();
final Type[] upperBounds = w.getUpperBounds();
@@ -1822,7 +1822,7 @@ public class TypeUtils {
* @return String
* @since 3.2
*/
- private static String genericArrayTypeToString(GenericArrayType g) {
+ private static String genericArrayTypeToString(final GenericArrayType g) {
return String.format("%s[]", toString(g.getGenericComponentType()));
}
@@ -1834,7 +1834,7 @@ public class TypeUtils {
* @return {@code buf}
* @since 3.2
*/
- private static StringBuilder appendAllTo(StringBuilder buf, String sep, Type... types) {
+ private static StringBuilder appendAllTo(final StringBuilder buf, final String sep, final Type... types) {
Validate.notEmpty(Validate.noNullElements(types));
if (types.length > 0) {
buf.append(toString(types[0]));
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java Fri Jun 27 12:22:17 2014
@@ -510,7 +510,7 @@ public class StrSubstitutor {
* @return the result of the replace operation
* @since 3.2
*/
- public String replace(CharSequence source) {
+ public String replace(final CharSequence source) {
if (source == null) {
return null;
}
@@ -531,11 +531,11 @@ public class StrSubstitutor {
* @return the result of the replace operation
* @since 3.2
*/
- public String replace(CharSequence source, int offset, int length) {
+ public String replace(final CharSequence source, final int offset, final int length) {
if (source == null) {
return null;
}
- StrBuilder buf = new StrBuilder(length).append(source, offset, length);
+ final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
substitute(buf, 0, length);
return buf.toString();
}
@@ -649,7 +649,7 @@ public class StrSubstitutor {
* @return true if altered
* @since 3.2
*/
- public boolean replaceIn(StringBuilder source) {
+ public boolean replaceIn(final StringBuilder source) {
if (source == null) {
return false;
}
@@ -670,11 +670,11 @@ public class StrSubstitutor {
* @return true if altered
* @since 3.2
*/
- public boolean replaceIn(StringBuilder source, int offset, int length) {
+ public boolean replaceIn(final StringBuilder source, final int offset, final int length) {
if (source == null) {
return false;
}
- StrBuilder buf = new StrBuilder(length).append(source, offset, length);
+ final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
if (substitute(buf, 0, length) == false) {
return false;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/OctalUnescaper.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/OctalUnescaper.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/OctalUnescaper.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/OctalUnescaper.java Fri Jun 27 12:22:17 2014
@@ -37,12 +37,12 @@ public class OctalUnescaper extends Char
*/
@Override
public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
- int remaining = input.length() - index - 1; // how many characters left, ignoring the first \
- StringBuilder builder = new StringBuilder();
+ final int remaining = input.length() - index - 1; // how many characters left, ignoring the first \
+ final StringBuilder builder = new StringBuilder();
if(input.charAt(index) == '\\' && remaining > 0 && isOctalDigit(input.charAt(index + 1)) ) {
- int next = index + 1;
- int next2 = index + 2;
- int next3 = index + 3;
+ final int next = index + 1;
+ final int next2 = index + 2;
+ final int next3 = index + 3;
// we know this is good as we checked it in the if block above
builder.append(input.charAt(next));
@@ -65,7 +65,7 @@ public class OctalUnescaper extends Char
* @param ch the char to check
* @return true if the given char is the character representation of one of the digits from 0 to 7
*/
- private boolean isOctalDigit(char ch) {
+ private boolean isOctalDigit(final char ch) {
return ch >= '0' && ch <= '7';
}
@@ -74,7 +74,7 @@ public class OctalUnescaper extends Char
* @param ch the char to check
* @return true if the given char is the character representation of one of the digits from 0 to 3
*/
- private boolean isZeroToThree(char ch) {
+ private boolean isZeroToThree(final char ch) {
return ch >= '0' && ch <= '3';
}
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/UnicodeUnpairedSurrogateRemover.java Fri Jun 27 12:22:17 2014
@@ -30,7 +30,7 @@ public class UnicodeUnpairedSurrogateRem
* {@inheritDoc}
*/
@Override
- public boolean translate(int codepoint, Writer out) throws IOException {
+ public boolean translate(final int codepoint, final Writer out) throws IOException {
if (codepoint >= Character.MIN_SURROGATE && codepoint <= Character.MAX_SURROGATE) {
// It's a surrogate. Write nothing and say we've translated.
return true;
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DateUtils.java Fri Jun 27 12:22:17 2014
@@ -1671,7 +1671,7 @@ public class DateUtils {
long result = 0;
- int offset = (unit == TimeUnit.DAYS) ? 0 : 1;
+ final int offset = (unit == TimeUnit.DAYS) ? 0 : 1;
// Fragments bigger than a day require a breakdown to days
switch (fragment) {
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java Fri Jun 27 12:22:17 2014
@@ -424,7 +424,7 @@ public class DurationFormatUtils {
* @return the formatted string
*/
static String format(final Token[] tokens, final long years, final long months, final long days, final long hours, final long minutes, final long seconds,
- long milliseconds, final boolean padWithZeros) {
+ final long milliseconds, final boolean padWithZeros) {
final StringBuilder buffer = new StringBuilder();
boolean lastOutputSeconds = false;
for (final Token token : tokens) {
@@ -454,7 +454,7 @@ public class DurationFormatUtils {
} else if (value == S) {
if (lastOutputSeconds) {
// ensure at least 3 digits are displayed even if padding is not selected
- int width = padWithZeros ? Math.max(3, count) : 3;
+ final int width = padWithZeros ? Math.max(3, count) : 3;
buffer.append(paddedValue(milliseconds, true, width));
} else {
buffer.append(paddedValue(milliseconds, padWithZeros, count));
@@ -581,7 +581,7 @@ public class DurationFormatUtils {
* @return boolean <code>true</code> if contained
*/
static boolean containsTokenWithValue(final Token[] tokens, final Object value) {
- for (Token token : tokens) {
+ for (final Token token : tokens) {
if (token.getValue() == value) {
return true;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java Fri Jun 27 12:22:17 2014
@@ -145,7 +145,7 @@ public class FastDateParser implements D
*
* @param definingCalendar the {@link java.util.Calendar} instance used to initialize this FastDateParser
*/
- private void init(Calendar definingCalendar) {
+ private void init(final Calendar definingCalendar) {
final StringBuilder regex= new StringBuilder();
final List<Strategy> collector = new ArrayList<Strategy>();
@@ -398,7 +398,7 @@ public class FastDateParser implements D
* @return A value between centuryStart(inclusive) to centuryStart+100(exclusive)
*/
private int adjustYear(final int twoDigitYear) {
- int trial= century + twoDigitYear;
+ final int trial= century + twoDigitYear;
return twoDigitYear>=startYear ?trial :trial+100;
}
@@ -606,10 +606,10 @@ public class FastDateParser implements D
CaseInsensitiveTextStrategy(final int field, final Calendar definingCalendar, final Locale locale) {
this.field= field;
this.locale= locale;
- Map<String, Integer> keyValues = getDisplayNames(field, definingCalendar, locale);
+ final Map<String, Integer> keyValues = getDisplayNames(field, definingCalendar, locale);
this.lKeyValues= new HashMap<String,Integer>();
- for(Map.Entry<String, Integer> entry : keyValues.entrySet()) {
+ for(final Map.Entry<String, Integer> entry : keyValues.entrySet()) {
lKeyValues.put(entry.getKey().toLowerCase(locale), entry.getValue());
}
}
@@ -751,7 +751,7 @@ public class FastDateParser implements D
*/
TimeZoneStrategy(final Locale locale) {
final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
- for (String[] zone : zones) {
+ for (final String[] zone : zones) {
if (zone[ID].startsWith("GMT")) {
continue;
}
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java Fri Jun 27 12:22:17 2014
@@ -139,7 +139,7 @@ abstract class FormatCache<F extends For
* pattern defined
*/
// package protected, for access from FastDateFormat; do not make public or protected
- F getDateTimeInstance(final int dateStyle, final int timeStyle, final TimeZone timeZone, Locale locale) {
+ F getDateTimeInstance(final int dateStyle, final int timeStyle, final TimeZone timeZone, final Locale locale) {
return getDateTimeInstance(Integer.valueOf(dateStyle), Integer.valueOf(timeStyle), timeZone, locale);
}
@@ -156,7 +156,7 @@ abstract class FormatCache<F extends For
* pattern defined
*/
// package protected, for access from FastDateFormat; do not make public or protected
- F getDateInstance(final int dateStyle, final TimeZone timeZone, Locale locale) {
+ F getDateInstance(final int dateStyle, final TimeZone timeZone, final Locale locale) {
return getDateTimeInstance(Integer.valueOf(dateStyle), null, timeZone, locale);
}
@@ -173,7 +173,7 @@ abstract class FormatCache<F extends For
* pattern defined
*/
// package protected, for access from FastDateFormat; do not make public or protected
- F getTimeInstance(final int timeStyle, final TimeZone timeZone, Locale locale) {
+ F getTimeInstance(final int timeStyle, final TimeZone timeZone, final Locale locale) {
return getDateTimeInstance(null, Integer.valueOf(timeStyle), timeZone, locale);
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassPathUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassPathUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassPathUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ClassPathUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -53,8 +53,8 @@ public class ClassPathUtilsTest {
@Test
public void testToFullyQualifiedNameClassString() throws Exception {
- String expected = "org.apache.commons.lang3.Test.properties";
- String actual = ClassPathUtils.toFullyQualifiedName(ClassPathUtils.class, "Test.properties");
+ final String expected = "org.apache.commons.lang3.Test.properties";
+ final String actual = ClassPathUtils.toFullyQualifiedName(ClassPathUtils.class, "Test.properties");
assertEquals(expected, actual);
}
@@ -71,8 +71,8 @@ public class ClassPathUtilsTest {
@Test
public void testToFullyQualifiedNamePackageString() throws Exception {
- String expected = "org.apache.commons.lang3.Test.properties";
- String actual = ClassPathUtils.toFullyQualifiedName(ClassPathUtils.class.getPackage(), "Test.properties");
+ final String expected = "org.apache.commons.lang3.Test.properties";
+ final String actual = ClassPathUtils.toFullyQualifiedName(ClassPathUtils.class.getPackage(), "Test.properties");
assertEquals(expected, actual);
}
@@ -89,8 +89,8 @@ public class ClassPathUtilsTest {
@Test
public void testToFullyQualifiedPathClass() throws Exception {
- String expected = "org/apache/commons/lang3/Test.properties";
- String actual = ClassPathUtils.toFullyQualifiedPath(ClassPathUtils.class, "Test.properties");
+ final String expected = "org/apache/commons/lang3/Test.properties";
+ final String actual = ClassPathUtils.toFullyQualifiedPath(ClassPathUtils.class, "Test.properties");
assertEquals(expected, actual);
}
@@ -107,8 +107,8 @@ public class ClassPathUtilsTest {
@Test
public void testToFullyQualifiedPathPackage() throws Exception {
- String expected = "org/apache/commons/lang3/Test.properties";
- String actual = ClassPathUtils.toFullyQualifiedPath(ClassPathUtils.class.getPackage(), "Test.properties");
+ final String expected = "org/apache/commons/lang3/Test.properties";
+ final String actual = ClassPathUtils.toFullyQualifiedPath(ClassPathUtils.class.getPackage(), "Test.properties");
assertEquals(expected, actual);
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -378,8 +378,8 @@ public class LocaleUtilsTest {
*/
@Test
public void testThreeCharsLocale() {
- for (String str : Arrays.asList("udm", "tet")) {
- Locale locale = LocaleUtils.toLocale(str);
+ for (final String str : Arrays.asList("udm", "tet")) {
+ final Locale locale = LocaleUtils.toLocale(str);
assertNotNull(locale);
assertEquals(str, locale.getLanguage());
assertTrue(StringUtils.isBlank(locale.getCountry()));
@@ -554,11 +554,11 @@ public class LocaleUtilsTest {
@Test
public void testParseAllLocales() {
- Locale[] locales = Locale.getAvailableLocales();
+ final Locale[] locales = Locale.getAvailableLocales();
int failures = 0;
- for (Locale l : locales) {
+ for (final Locale l : locales) {
// Check if it's possible to recreate the Locale using just the standard constructor
- Locale locale = new Locale(l.getLanguage(), l.getCountry(), l.getVariant());
+ final Locale locale = new Locale(l.getLanguage(), l.getCountry(), l.getVariant());
if (l.equals(locale)) { // it is possible for LocaleUtils.toLocale to handle these Locales
String str = l.toString();
// Look for the script/extension suffix
@@ -572,12 +572,12 @@ public class LocaleUtilsTest {
System.out.println("Should not have parsed: " + str);
failures++;
continue; // try next Locale
- } catch (IllegalArgumentException iae) {
+ } catch (final IllegalArgumentException iae) {
// expected; try without suffix
str = str.substring(0, suff);
}
}
- Locale loc = LocaleUtils.toLocale(str);
+ final Locale loc = LocaleUtils.toLocale(str);
if (!l.equals(loc)) {
System.out.println("Failed to parse: " + str);
failures++;
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/NotImplementedExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/NotImplementedExceptionTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/NotImplementedExceptionTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/NotImplementedExceptionTest.java Fri Jun 27 12:22:17 2014
@@ -29,9 +29,9 @@ public class NotImplementedExceptionTest
@Test
public void testConstructors() {
- Throwable nested = new RuntimeException();
- String message = "Not Implemented";
- String code = "CODE";
+ final Throwable nested = new RuntimeException();
+ final String message = "Not Implemented";
+ final String code = "CODE";
NotImplementedException nie = new NotImplementedException(message);
assertCorrect("Issue in (String)", nie, message, null, null);
@@ -47,7 +47,7 @@ public class NotImplementedExceptionTest
assertCorrect("Issue in (String, Throwable, String)", nie, message, nested, code);
}
- private void assertCorrect(String assertMessage, NotImplementedException nie, String message, Throwable nested, String code) {
+ private void assertCorrect(final String assertMessage, final NotImplementedException nie, final String message, final Throwable nested, final String code) {
assertNotNull(assertMessage + ": target is null", nie);
assertEquals(assertMessage + ": Message not equal", message, nie.getMessage());
assertEquals(assertMessage + ": Nested throwable not equal", nested, nie.getCause());
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -264,7 +264,7 @@ public class ObjectUtilsTest {
final Appendable appendable = new StringBuilder();
ObjectUtils.identityToString(appendable, i);
assertEquals(expected, appendable.toString());
- } catch(IOException ex) {
+ } catch(final IOException ex) {
fail("IOException unexpected");
}
@@ -272,14 +272,14 @@ public class ObjectUtilsTest {
ObjectUtils.identityToString((Appendable)null, "tmp");
fail("NullPointerException expected");
} catch(final NullPointerException npe) {
- } catch (IOException ex) {
+ } catch (final IOException ex) {
}
try {
ObjectUtils.identityToString((Appendable)(new StringBuilder()), null);
fail("NullPointerException expected");
} catch(final NullPointerException npe) {
- } catch (IOException ex) {
+ } catch (final IOException ex) {
}
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RandomUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -93,7 +93,7 @@ public class RandomUtilsTest {
*/
@Test
public void testNextBytes() throws Exception {
- byte[] result = RandomUtils.nextBytes(20);
+ final byte[] result = RandomUtils.nextBytes(20);
assertEquals(20, result.length);
}
@@ -110,7 +110,7 @@ public class RandomUtilsTest {
*/
@Test
public void testNextInt() throws Exception {
- int result = RandomUtils.nextInt(33, 42);
+ final int result = RandomUtils.nextInt(33, 42);
assertTrue(result >= 33 && result < 42);
}
@@ -135,7 +135,7 @@ public class RandomUtilsTest {
*/
@Test
public void testNextDouble() throws Exception {
- double result = RandomUtils.nextDouble(33d, 42d);
+ final double result = RandomUtils.nextDouble(33d, 42d);
assertTrue(result >= 33d && result <= 42d);
}
@@ -144,7 +144,7 @@ public class RandomUtilsTest {
*/
@Test
public void testNextFloat() throws Exception {
- double result = RandomUtils.nextFloat(33f, 42f);
+ final double result = RandomUtils.nextFloat(33f, 42f);
assertTrue(result >= 33f && result <= 42f);
}
@@ -161,7 +161,7 @@ public class RandomUtilsTest {
*/
@Test
public void testNextLong() throws Exception {
- long result = RandomUtils.nextLong(33L, 42L);
+ final long result = RandomUtils.nextLong(33L, 42L);
assertTrue(result >= 33L && result < 42L);
}
@@ -171,7 +171,7 @@ public class RandomUtilsTest {
*/
@Test
public void testExtremeRangeInt() throws Exception {
- int result = RandomUtils.nextInt(0, Integer.MAX_VALUE);
+ final int result = RandomUtils.nextInt(0, Integer.MAX_VALUE);
assertTrue(result >= 0 && result < Integer.MAX_VALUE);
}
@@ -180,7 +180,7 @@ public class RandomUtilsTest {
*/
@Test
public void testExtremeRangeLong() throws Exception {
- long result = RandomUtils.nextLong(0, Long.MAX_VALUE);
+ final long result = RandomUtils.nextLong(0, Long.MAX_VALUE);
assertTrue(result >= 0 && result < Long.MAX_VALUE);
}
@@ -189,7 +189,7 @@ public class RandomUtilsTest {
*/
@Test
public void testExtremeRangeFloat() throws Exception {
- float result = RandomUtils.nextFloat(0, Float.MAX_VALUE);
+ final float result = RandomUtils.nextFloat(0, Float.MAX_VALUE);
assertTrue(result >= 0f && result <= Float.MAX_VALUE);
}
@@ -198,7 +198,7 @@ public class RandomUtilsTest {
*/
@Test
public void testExtremeRangeDouble() throws Exception {
- double result = RandomUtils.nextDouble(0, Double.MAX_VALUE);
+ final double result = RandomUtils.nextDouble(0, Double.MAX_VALUE);
assertTrue(result >= 0 && result <= Double.MAX_VALUE);
}
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/SerializationUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/SerializationUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/SerializationUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/SerializationUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -273,7 +273,7 @@ public class SerializationUtilsTest {
@Test
public void testRoundtrip() {
- HashMap<Object, Object> newMap = SerializationUtils.roundtrip(iMap);
+ final HashMap<Object, Object> newMap = SerializationUtils.roundtrip(iMap);
assertEquals(iMap, newMap);
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -219,7 +219,7 @@ public class StringEscapeUtilsTest {
@Test
public void testEscapeHtml() {
- for (String[] element : HTML_ESCAPES) {
+ for (final String[] element : HTML_ESCAPES) {
final String message = element[0];
final String expected = element[1];
final String original = element[2];
@@ -236,7 +236,7 @@ public class StringEscapeUtilsTest {
@Test
public void testUnescapeHtml4() {
- for (String[] element : HTML_ESCAPES) {
+ for (final String[] element : HTML_ESCAPES) {
final String message = element[0];
final String expected = element[2];
final String original = element[1];
@@ -584,9 +584,9 @@ public class StringEscapeUtilsTest {
*/
@Test
public void testLang911() {
- String bellsTest = "\ud83d\udc80\ud83d\udd14";
- String value = StringEscapeUtils.escapeJava(bellsTest);
- String valueTest = StringEscapeUtils.unescapeJava(value);
+ final String bellsTest = "\ud83d\udc80\ud83d\udd14";
+ final String value = StringEscapeUtils.escapeJava(bellsTest);
+ final String valueTest = StringEscapeUtils.unescapeJava(value);
assertEquals(bellsTest, valueTest);
}
@@ -610,8 +610,8 @@ public class StringEscapeUtilsTest {
assertEquals("He didn't say, \\\"stop!\\\"", StringEscapeUtils.escapeJson("He didn't say, \"stop!\""));
- String expected = "\\\"foo\\\" isn't \\\"bar\\\". specials: \\b\\r\\n\\f\\t\\\\\\/";
- String input ="\"foo\" isn't \"bar\". specials: \b\r\n\f\t\\/";
+ final String expected = "\\\"foo\\\" isn't \\\"bar\\\". specials: \\b\\r\\n\\f\\t\\\\\\/";
+ final String input ="\"foo\" isn't \"bar\". specials: \b\r\n\f\t\\/";
assertEquals(expected, StringEscapeUtils.escapeJson(input));
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java?rev=1606051&r1=1606050&r2=1606051&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java Fri Jun 27 12:22:17 2014
@@ -55,7 +55,7 @@ public class StringUtilsTest {
static {
String ws = "";
String nws = "";
- String hs = String.valueOf(((char) 160));
+ final String hs = String.valueOf(((char) 160));
String tr = "";
String ntr = "";
for (int i = 0; i < Character.MAX_VALUE; i++) {