Make sure lines in files don't have trailing white spaces and remove all 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/1da8ccdb Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/1da8ccdb Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/1da8ccdb Branch: refs/heads/release Commit: 1da8ccdbfe2faa3e6801fe44eaf3c336aab48bec Parents: fa91c1b Author: Benedikt Ritter <brit...@apache.org> Authored: Tue Jun 6 15:12:06 2017 +0200 Committer: Benedikt Ritter <brit...@apache.org> Committed: Tue Jun 6 15:12:06 2017 +0200 ---------------------------------------------------------------------- checkstyle.xml | 5 + .../org/apache/commons/lang3/ArrayUtils.java | 140 ++-- .../java/org/apache/commons/lang3/BitField.java | 32 +- .../org/apache/commons/lang3/BooleanUtils.java | 2 +- .../org/apache/commons/lang3/CharRange.java | 34 +- .../apache/commons/lang3/CharSequenceUtils.java | 2 +- .../java/org/apache/commons/lang3/CharSet.java | 34 +- .../org/apache/commons/lang3/CharSetUtils.java | 10 +- .../org/apache/commons/lang3/CharUtils.java | 112 ++-- .../org/apache/commons/lang3/ClassUtils.java | 26 +- .../org/apache/commons/lang3/Conversion.java | 88 +-- .../org/apache/commons/lang3/EnumUtils.java | 2 +- .../org/apache/commons/lang3/JavaVersion.java | 10 +- .../org/apache/commons/lang3/LocaleUtils.java | 16 +- .../commons/lang3/NotImplementedException.java | 26 +- .../org/apache/commons/lang3/ObjectUtils.java | 10 +- .../apache/commons/lang3/RandomStringUtils.java | 44 +- .../org/apache/commons/lang3/RandomUtils.java | 30 +- .../java/org/apache/commons/lang3/Range.java | 28 +- .../commons/lang3/SerializationException.java | 6 +- .../commons/lang3/SerializationUtils.java | 16 +- .../apache/commons/lang3/StringEscapeUtils.java | 206 +++--- .../org/apache/commons/lang3/StringUtils.java | 70 +- .../org/apache/commons/lang3/SystemUtils.java | 6 +- .../apache/commons/lang3/arch/Processor.java | 24 +- .../apache/commons/lang3/builder/Builder.java | 44 +- .../commons/lang3/builder/CompareToBuilder.java | 56 +- .../org/apache/commons/lang3/builder/Diff.java | 20 +- .../commons/lang3/builder/DiffBuilder.java | 68 +- .../commons/lang3/builder/DiffResult.java | 26 +- .../apache/commons/lang3/builder/Diffable.java | 6 +- .../commons/lang3/builder/EqualsBuilder.java | 56 +- .../commons/lang3/builder/HashCodeBuilder.java | 10 +- .../org/apache/commons/lang3/builder/IDKey.java | 20 +- .../MultilineRecursiveToStringStyle.java | 22 +- .../lang3/builder/RecursiveToStringStyle.java | 8 +- .../lang3/builder/ReflectionDiffBuilder.java | 10 +- .../builder/ReflectionToStringBuilder.java | 20 +- .../lang3/builder/StandardToStringStyle.java | 70 +- .../commons/lang3/builder/ToStringStyle.java | 6 +- .../lang3/concurrent/BasicThreadFactory.java | 4 +- .../commons/lang3/concurrent/Computable.java | 2 +- .../lang3/concurrent/ConcurrentUtils.java | 2 +- .../commons/lang3/concurrent/Memoizer.java | 2 +- .../lang3/exception/CloneFailedException.java | 12 +- .../lang3/exception/ContextedException.java | 26 +- .../exception/ContextedRuntimeException.java | 26 +- .../exception/DefaultExceptionContext.java | 12 +- .../lang3/exception/ExceptionContext.java | 20 +- .../commons/lang3/exception/ExceptionUtils.java | 14 +- .../org/apache/commons/lang3/math/Fraction.java | 48 +- .../commons/lang3/math/IEEE754rUtils.java | 50 +- .../apache/commons/lang3/math/NumberUtils.java | 134 ++-- .../apache/commons/lang3/mutable/Mutable.java | 12 +- .../commons/lang3/mutable/MutableBoolean.java | 38 +- .../commons/lang3/mutable/MutableByte.java | 38 +- .../commons/lang3/mutable/MutableDouble.java | 46 +- .../commons/lang3/mutable/MutableFloat.java | 46 +- .../commons/lang3/mutable/MutableInt.java | 38 +- .../commons/lang3/mutable/MutableLong.java | 38 +- .../commons/lang3/mutable/MutableObject.java | 22 +- .../commons/lang3/mutable/MutableShort.java | 38 +- .../commons/lang3/reflect/ConstructorUtils.java | 10 +- .../commons/lang3/reflect/FieldUtils.java | 66 +- .../commons/lang3/reflect/MethodUtils.java | 40 +- .../commons/lang3/reflect/TypeLiteral.java | 2 +- .../apache/commons/lang3/reflect/TypeUtils.java | 10 +- .../org/apache/commons/lang3/reflect/Typed.java | 2 +- .../commons/lang3/text/CompositeFormat.java | 18 +- .../lang3/text/ExtendedMessageFormat.java | 2 +- .../commons/lang3/text/FormatFactory.java | 6 +- .../commons/lang3/text/FormattableUtils.java | 16 +- .../apache/commons/lang3/text/StrBuilder.java | 92 +-- .../apache/commons/lang3/text/StrMatcher.java | 6 +- .../commons/lang3/text/StrSubstitutor.java | 4 +- .../apache/commons/lang3/text/StrTokenizer.java | 44 +- .../apache/commons/lang3/text/WordUtils.java | 60 +- .../text/translate/AggregateTranslator.java | 14 +- .../text/translate/CharSequenceTranslator.java | 26 +- .../text/translate/CodePointTranslator.java | 16 +- .../text/translate/JavaUnicodeEscaper.java | 14 +- .../lang3/text/translate/LookupTranslator.java | 4 +- .../text/translate/NumericEntityUnescaper.java | 16 +- .../lang3/text/translate/OctalUnescaper.java | 8 +- .../lang3/text/translate/UnicodeEscaper.java | 2 +- .../lang3/text/translate/UnicodeUnescaper.java | 10 +- .../UnicodeUnpairedSurrogateRemover.java | 4 +- .../commons/lang3/time/DateFormatUtils.java | 44 +- .../apache/commons/lang3/time/DateParser.java | 42 +- .../apache/commons/lang3/time/DatePrinter.java | 4 +- .../apache/commons/lang3/time/DateUtils.java | 494 +++++++-------- .../commons/lang3/time/DurationFormatUtils.java | 116 ++-- .../commons/lang3/time/FastDateFormat.java | 20 +- .../commons/lang3/time/FastDateParser.java | 32 +- .../commons/lang3/time/FastDatePrinter.java | 36 +- .../apache/commons/lang3/time/FormatCache.java | 46 +- .../apache/commons/lang3/time/StopWatch.java | 88 +-- .../commons/lang3/tuple/ImmutablePair.java | 12 +- .../commons/lang3/tuple/ImmutableTriple.java | 12 +- .../apache/commons/lang3/tuple/MutablePair.java | 12 +- .../org/apache/commons/lang3/tuple/Pair.java | 36 +- .../commons/lang3/AnnotationUtilsTest.java | 2 +- .../apache/commons/lang3/ArrayUtilsAddTest.java | 2 +- .../commons/lang3/ArrayUtilsInsertTest.java | 162 ++--- .../lang3/ArrayUtilsRemoveMultipleTest.java | 4 +- .../commons/lang3/ArrayUtilsRemoveTest.java | 54 +- .../apache/commons/lang3/ArrayUtilsTest.java | 632 +++++++++---------- .../org/apache/commons/lang3/BitFieldTest.java | 4 +- .../apache/commons/lang3/BooleanUtilsTest.java | 168 ++--- .../apache/commons/lang3/CharEncodingTest.java | 6 +- .../org/apache/commons/lang3/CharRangeTest.java | 6 +- .../commons/lang3/CharSequenceUtilsTest.java | 18 +- .../org/apache/commons/lang3/CharSetTest.java | 158 ++--- .../apache/commons/lang3/CharSetUtilsTest.java | 66 +- .../apache/commons/lang3/CharUtilsPerfRun.java | 6 +- .../org/apache/commons/lang3/CharUtilsTest.java | 72 +-- .../apache/commons/lang3/ClassUtilsTest.java | 30 +- .../org/apache/commons/lang3/EnumUtilsTest.java | 30 +- .../commons/lang3/HashSetvBitSetTest.java | 8 +- .../apache/commons/lang3/LocaleUtilsTest.java | 54 +- .../lang3/NotImplementedExceptionTest.java | 4 +- .../apache/commons/lang3/ObjectUtilsTest.java | 46 +- .../commons/lang3/RandomStringUtilsTest.java | 78 +-- .../apache/commons/lang3/RandomUtilsTest.java | 30 +- .../org/apache/commons/lang3/RangeTest.java | 4 +- .../commons/lang3/SerializationUtilsTest.java | 28 +- .../commons/lang3/StringEscapeUtilsTest.java | 40 +- .../commons/lang3/StringUtilsContainsTest.java | 2 +- .../lang3/StringUtilsEmptyBlankTest.java | 4 +- .../lang3/StringUtilsEqualsIndexOfTest.java | 6 +- .../apache/commons/lang3/StringUtilsIsTest.java | 6 +- .../lang3/StringUtilsStartsEndsWithTest.java | 8 +- .../commons/lang3/StringUtilsSubstringTest.java | 52 +- .../apache/commons/lang3/StringUtilsTest.java | 14 +- .../commons/lang3/StringUtilsTrimStripTest.java | 48 +- .../apache/commons/lang3/SystemUtilsTest.java | 2 +- .../lang3/builder/CompareToBuilderTest.java | 104 +-- .../lang3/builder/DefaultToStringStyleTest.java | 12 +- .../commons/lang3/builder/DiffBuilderTest.java | 140 ++-- .../apache/commons/lang3/builder/DiffTest.java | 18 +- .../lang3/builder/EqualsBuilderTest.java | 76 +-- .../HashCodeBuilderAndEqualsBuilderTest.java | 8 +- .../lang3/builder/HashCodeBuilderTest.java | 12 +- .../lang3/builder/JsonToStringStyleTest.java | 10 +- .../builder/MultiLineToStringStyleTest.java | 10 +- .../MultilineRecursiveToStringStyleTest.java | 176 +++--- .../builder/NoClassNameToStringStyleTest.java | 4 +- .../builder/NoFieldNamesToStringStyleTest.java | 12 +- .../builder/RecursiveToStringStyleTest.java | 20 +- ...eflectionToStringBuilderConcurrencyTest.java | 2 +- ...ionToStringBuilderExcludeNullValuesTest.java | 44 +- .../ReflectionToStringBuilderExcludeTest.java | 4 +- ...oStringBuilderExcludeWithAnnotationTest.java | 4 +- ...ringBuilderMutateInspectConcurrencyTest.java | 6 +- .../builder/ShortPrefixToStringStyleTest.java | 14 +- .../lang3/builder/SimpleToStringStyleTest.java | 12 +- .../builder/StandardToStringStyleTest.java | 16 +- .../lang3/builder/ToStringBuilderTest.java | 6 +- .../builder/ToStringStyleConcurrencyTest.java | 2 +- .../lang3/builder/ToStringStyleTest.java | 6 +- .../CallableBackgroundInitializerTest.java | 2 +- .../CircuitBreakingExceptionTest.java | 24 +- .../lang3/event/EventListenerSupportTest.java | 4 +- .../commons/lang3/event/EventUtilsTest.java | 4 +- .../exception/AbstractExceptionContextTest.java | 10 +- .../lang3/exception/AbstractExceptionTest.java | 6 +- .../exception/CloneFailedExceptionTest.java | 18 +- .../lang3/exception/ContextedExceptionTest.java | 12 +- .../ContextedRuntimeExceptionTest.java | 14 +- .../exception/DefaultExceptionContextTest.java | 8 +- .../lang3/exception/ExceptionUtilsTest.java | 78 +-- .../apache/commons/lang3/math/FractionTest.java | 448 ++++++------- .../commons/lang3/math/IEEE754rUtilsTest.java | 6 +- .../commons/lang3/math/NumberUtilsTest.java | 10 +- .../lang3/mutable/MutableBooleanTest.java | 10 +- .../commons/lang3/mutable/MutableByteTest.java | 30 +- .../lang3/mutable/MutableDoubleTest.java | 36 +- .../commons/lang3/mutable/MutableFloatTest.java | 34 +- .../commons/lang3/mutable/MutableIntTest.java | 30 +- .../commons/lang3/mutable/MutableLongTest.java | 28 +- .../lang3/mutable/MutableObjectTest.java | 14 +- .../commons/lang3/mutable/MutableShortTest.java | 30 +- .../commons/lang3/reflect/FieldUtilsTest.java | 2 +- .../commons/lang3/reflect/TypeUtilsTest.java | 4 +- .../commons/lang3/test/SystemDefaults.java | 4 +- .../lang3/test/SystemDefaultsSwitch.java | 14 +- .../lang3/test/SystemDefaultsSwitchTest.java | 4 +- .../commons/lang3/text/CompositeFormatTest.java | 6 +- .../lang3/text/ExtendedMessageFormatTest.java | 12 +- .../lang3/text/StrBuilderAppendInsertTest.java | 30 +- .../commons/lang3/text/StrBuilderTest.java | 354 +++++------ .../commons/lang3/text/StrMatcherTest.java | 4 +- .../commons/lang3/text/StrTokenizerTest.java | 50 +- .../commons/lang3/text/WordUtilsTest.java | 68 +- .../lang3/text/translate/EntityArraysTest.java | 14 +- .../text/translate/LookupTranslatorTest.java | 4 +- .../translate/NumericEntityEscaperTest.java | 4 +- .../translate/NumericEntityUnescaperTest.java | 4 +- .../text/translate/OctalUnescaperTest.java | 4 +- .../text/translate/UnicodeEscaperTest.java | 4 +- .../text/translate/UnicodeUnescaperTest.java | 4 +- .../UnicodeUnpairedSurrogateRemoverTest.java | 8 +- .../commons/lang3/time/DateFormatUtilsTest.java | 32 +- .../lang3/time/DateUtilsFragmentTest.java | 54 +- .../lang3/time/DateUtilsRoundingTest.java | 186 +++--- .../commons/lang3/time/DateUtilsTest.java | 108 ++-- .../lang3/time/DurationFormatUtilsTest.java | 90 +-- .../commons/lang3/time/FastDateFormatTest.java | 16 +- .../lang3/time/FastDateParserSDFTest.java | 12 +- .../commons/lang3/time/FastDateParserTest.java | 22 +- .../time/FastDateParser_MoreOrLessTest.java | 24 +- .../commons/lang3/time/FastDatePrinterTest.java | 20 +- .../commons/lang3/time/StopWatchTest.java | 22 +- .../commons/lang3/tuple/ImmutablePairTest.java | 16 +- .../lang3/tuple/ImmutableTripleTest.java | 10 +- .../commons/lang3/tuple/MutablePairTest.java | 2 +- .../commons/lang3/tuple/MutableTripleTest.java | 2 +- 217 files changed, 4111 insertions(+), 4106 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/checkstyle.xml ---------------------------------------------------------------------- diff --git a/checkstyle.xml b/checkstyle.xml index 7070d0b..82dfec9 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -30,6 +30,11 @@ limitations under the License. <module name="FileTabCharacter"> <property name="fileExtensions" value="java,xml"/> </module> + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> <module name="TreeWalker"> <property name="cacheFile" value="target/cachefile"/> <module name="AvoidStarImport"/> http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/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 f0e9f6b..35172fc 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -480,9 +480,9 @@ public class ArrayUtils { return type.cast(Array.newInstance(type.getComponentType(), 0)); } return array; - } - - + } + + /** * <p>Defensive programming technique to change a {@code null} * reference to an empty one. @@ -1536,10 +1536,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1569,10 +1569,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1602,10 +1602,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1635,10 +1635,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1668,10 +1668,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1701,10 +1701,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1734,10 +1734,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1767,10 +1767,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1800,10 +1800,10 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * + * * <p> * This method does nothing for a {@code null} input array. - * + * * @param array * the array to reverse, may be {@code null} * @param startIndexInclusive @@ -1838,7 +1838,7 @@ public class ArrayUtils { * <p>There is no special handling for multi-dimensional arrays. This method * does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero).</p> - * + * * Examples: * <ul> * <li>ArrayUtils.swap(["1", "2", "3"], 0, 2) -> ["3", "2", "1"]</li> @@ -1951,7 +1951,7 @@ public class ArrayUtils { * <p>There is no special handling for multi-dimensional arrays. This method * does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero).</p> - * + * * Examples: * <ul> * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> @@ -2093,7 +2093,7 @@ public class ArrayUtils { * of the sub-arrays to swap falls outside of the given array, then the * swap is stopped at the end of the array and as many as possible elements * are swapped.</p> - * + * * Examples: * <ul> * <li>ArrayUtils.swap([true, false, true, false], 0, 2, 1) -> [true, false, true, false]</li> @@ -2177,7 +2177,7 @@ public class ArrayUtils { * of the sub-arrays to swap falls outside of the given array, then the * swap is stopped at the end of the array and as many as possible elements * are swapped.</p> - * + * * Examples: * <ul> * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> @@ -2645,7 +2645,7 @@ public class ArrayUtils { * * <p>There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.</p> - * + * * @param array * the array to shift, may be {@code null} * @param startIndexInclusive @@ -2668,10 +2668,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2684,7 +2684,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -2705,7 +2705,7 @@ public class ArrayUtils { * * <p>There is no special handling for multi-dimensional arrays. This method * does nothing for {@code null} or empty input arrays.</p> - * + * * @param array * the array to shift, may be {@code null} * @param startIndexInclusive @@ -2728,10 +2728,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2744,7 +2744,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -2788,10 +2788,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2804,7 +2804,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -2848,10 +2848,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2864,7 +2864,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -2908,10 +2908,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2924,7 +2924,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -2968,10 +2968,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -2984,7 +2984,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -3028,10 +3028,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -3044,7 +3044,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -3088,10 +3088,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -3104,7 +3104,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -3148,10 +3148,10 @@ public class ArrayUtils { } if (startIndexInclusive < 0) { startIndexInclusive = 0; - } + } if (endIndexExclusive >= array.length) { endIndexExclusive = array.length; - } + } int n = endIndexExclusive - startIndexInclusive; if (n <= 1) { return; @@ -3164,7 +3164,7 @@ public class ArrayUtils { // see https://beradrian.wordpress.com/2015/04/07/shift-an-array-in-on-in-place/ while (n > 1 && offset > 0) { final int n_offset = n - offset; - + if (offset > n_offset) { swap(array, startIndexInclusive, startIndexInclusive + n - n_offset, n_offset); n = offset; @@ -7428,7 +7428,7 @@ public class ArrayUtils { /** * Removes multiple array elements specified by indices. - * + * * @param array source * @param indices to remove * @return new array of same type minus elements specified by the set bits in {@code indices} @@ -7440,7 +7440,7 @@ public class ArrayUtils { // No need to check maxIndex here, because method only currently called from removeElements() // which guarantee to generate on;y valid bit entries. // final int maxIndex = indices.length(); -// if (maxIndex > srcLength) { +// if (maxIndex > srcLength) { // throw new IndexOutOfBoundsException("Index: " + (maxIndex-1) + ", Length: " + srcLength); // } final int removals = indices.cardinality(); // true bits are items to remove @@ -7459,13 +7459,13 @@ public class ArrayUtils { } count = srcLength - srcIndex; if (count > 0) { - System.arraycopy(array, srcIndex, result, destIndex, count); + System.arraycopy(array, srcIndex, result, destIndex, count); } return result; } /** - * <p>This method checks whether the provided array is sorted according to the class's + * <p>This method checks whether the provided array is sorted according to the class's * {@code compareTo} method. * * @param array the array to check @@ -7481,7 +7481,7 @@ public class ArrayUtils { } }); } - + /** * <p>This method checks whether the provided array is sorted according to the provided {@code Comparator}. @@ -7496,7 +7496,7 @@ public class ArrayUtils { if (comparator == null) { throw new IllegalArgumentException("Comparator should not be null."); } - + if (array == null || array.length < 2) { return true; } @@ -8050,7 +8050,7 @@ public class ArrayUtils { final String[] result = new String[array.length]; for (int i = 0; i < array.length; i++) { - final Object object = array[i]; + final Object object = array[i]; result[i] = (object == null ? valueForNullElements : object.toString()); } @@ -8072,7 +8072,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8114,7 +8114,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8156,7 +8156,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8198,7 +8198,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8240,7 +8240,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8282,7 +8282,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8324,7 +8324,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8366,7 +8366,7 @@ public class ArrayUtils { * @param array the array to insert the values into, may be {@code null} * @param values the new values to insert, may be {@code null} * @return The new array. - * @throws IndexOutOfBoundsException if {@code array} is provided + * @throws IndexOutOfBoundsException if {@code array} is provided * and either {@code index < 0} or {@code index > array.length} * @since 3.6 */ @@ -8417,7 +8417,7 @@ public class ArrayUtils { public static <T> T[] insert(final int index, final T[] array, final T... values) { /* * Note on use of @SafeVarargs: - * + * * By returning null when 'array' is null, we avoid returning the vararg * array to the caller. We also avoid relying on the type of the vararg * array, by inspecting the component type of 'array'. http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/BitField.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/BitField.java b/src/main/java/org/apache/commons/lang3/BitField.java index 65b465e..bc2147e 100644 --- a/src/main/java/org/apache/commons/lang3/BitField.java +++ b/src/main/java/org/apache/commons/lang3/BitField.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,28 +17,28 @@ package org.apache.commons.lang3; /** - * <p>Supports operations on bit-mapped fields. Instances of this class can be - * used to store a flag or data within an {@code int}, {@code short} or + * <p>Supports operations on bit-mapped fields. Instances of this class can be + * used to store a flag or data within an {@code int}, {@code short} or * {@code byte}.</p> - * + * * <p>Each {@code BitField} is constructed with a mask value, which indicates - * the bits that will be used to store and retrieve the data for that field. - * For instance, the mask {@code 0xFF} indicates the least-significant byte + * the bits that will be used to store and retrieve the data for that field. + * For instance, the mask {@code 0xFF} indicates the least-significant byte * should be used to store the data.</p> - * + * * <p>As an example, consider a car painting machine that accepts * paint instructions as integers. Bit fields can be used to encode this:</p> * *<pre> - * // blue, green and red are 1 byte values (0-255) stored in the three least + * // blue, green and red are 1 byte values (0-255) stored in the three least * // significant bytes * BitField blue = new BitField(0xFF); * BitField green = new BitField(0xFF00); * BitField red = new BitField(0xFF0000); - * + * * // anyColor is a flag triggered if any color is used * BitField anyColor = new BitField(0xFFFFFF); - * + * * // isMetallic is a single bit flag * BitField isMetallic = new BitField(0x1000000); *</pre> @@ -54,24 +54,24 @@ package org.apache.commons.lang3; *</pre> * * <p>Flags and data can be retrieved from the integer:</p> - * + * *<pre> * // Prints true if red, green or blue is non-zero * System.out.println(anyColor.isSet(paintInstruction)); // prints true - * + * * // Prints value of red, green and blue * System.out.println(red.getValue(paintInstruction)); // prints 35 * System.out.println(green.getValue(paintInstruction)); // prints 100 * System.out.println(blue.getValue(paintInstruction)); // prints 255 - * - * // Prints true if isMetallic was set + * + * // Prints true if isMetallic was set * System.out.println(isMetallic.isSet(paintInstruction)); // prints false *</pre> * * @since 2.0 */ public class BitField { - + private final int _mask; private final int _shift_count; http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/BooleanUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/BooleanUtils.java b/src/main/java/org/apache/commons/lang3/BooleanUtils.java index 9a21289..fdeff74 100644 --- a/src/main/java/org/apache/commons/lang3/BooleanUtils.java +++ b/src/main/java/org/apache/commons/lang3/BooleanUtils.java @@ -699,7 +699,7 @@ public class BooleanUtils { * BooleanUtils.toBooleanObject("y") = true * BooleanUtils.toBooleanObject("n") = false * BooleanUtils.toBooleanObject("t") = true - * BooleanUtils.toBooleanObject("f") = false + * BooleanUtils.toBooleanObject("f") = false * </pre> * * @param str the String to check http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/CharRange.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/CharRange.java b/src/main/java/org/apache/commons/lang3/CharRange.java index bf82805..b395306 100644 --- a/src/main/java/org/apache/commons/lang3/CharRange.java +++ b/src/main/java/org/apache/commons/lang3/CharRange.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,30 +22,30 @@ import java.util.NoSuchElementException; /** * <p>A contiguous range of characters, optionally negated.</p> - * + * * <p>Instances are immutable.</p> * * <p>#ThreadSafe#</p> * @since 1.0 */ -// TODO: This is no longer public and will be removed later as CharSet is moved +// TODO: This is no longer public and will be removed later as CharSet is moved // to depend on Range. final class CharRange implements Iterable<Character>, Serializable { /** - * Required for serialization support. Lang version 2.0. - * + * Required for serialization support. Lang version 2.0. + * * @see java.io.Serializable */ private static final long serialVersionUID = 8270183163158333422L; - + /** The first character, inclusive, in the range. */ private final char start; /** The last character, inclusive, in the range. */ private final char end; /** True if the range is everything except the characters specified. */ private final boolean negated; - + /** Cached toString. */ private transient String iToString; @@ -55,7 +55,7 @@ final class CharRange implements Iterable<Character>, Serializable { * * <p>A negated range includes everything except that defined by the * start and end characters.</p> - * + * * <p>If start and end are in the wrong order, they are reversed. * Thus {@code a-e} is the same as {@code e-a}.</p> * @@ -70,7 +70,7 @@ final class CharRange implements Iterable<Character>, Serializable { start = end; end = temp; } - + this.start = start; this.end = end; this.negated = negated; @@ -130,7 +130,7 @@ final class CharRange implements Iterable<Character>, Serializable { //----------------------------------------------------------------------- /** * <p>Gets the start character for this character range.</p> - * + * * @return the start char (inclusive) */ public char getStart() { @@ -139,7 +139,7 @@ final class CharRange implements Iterable<Character>, Serializable { /** * <p>Gets the end character for this character range.</p> - * + * * @return the end char (inclusive) */ public char getEnd() { @@ -148,7 +148,7 @@ final class CharRange implements Iterable<Character>, Serializable { /** * <p>Is this {@code CharRange} negated.</p> - * + * * <p>A negated range includes everything except that defined by the * start and end characters.</p> * @@ -197,7 +197,7 @@ final class CharRange implements Iterable<Character>, Serializable { /** * <p>Compares two CharRange objects, returning true if they represent * exactly the same range of characters defined in the same way.</p> - * + * * @param obj the object to compare to * @return true if equal */ @@ -215,17 +215,17 @@ final class CharRange implements Iterable<Character>, Serializable { /** * <p>Gets a hashCode compatible with the equals method.</p> - * + * * @return a suitable hashCode */ @Override public int hashCode() { return 83 + start + 7 * end + (negated ? 1 : 0); } - + /** * <p>Gets a string representation of the character range.</p> - * + * * @return string representation of this range */ @Override http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java index e35f5aa..9bac1c5 100644 --- a/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSequenceUtils.java @@ -50,7 +50,7 @@ public class CharSequenceUtils { * @param cs the specified subsequence, null returns null * @param start the start index, inclusive, valid * @return a new subsequence, may be null - * @throws IndexOutOfBoundsException if {@code start} is negative or if + * @throws IndexOutOfBoundsException if {@code start} is negative or if * {@code start} is greater than {@code length()} */ public static CharSequence subSequence(final CharSequence cs, final int start) { http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/CharSet.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/CharSet.java b/src/main/java/org/apache/commons/lang3/CharSet.java index 150f850..70f9509 100644 --- a/src/main/java/org/apache/commons/lang3/CharSet.java +++ b/src/main/java/org/apache/commons/lang3/CharSet.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -34,37 +34,37 @@ import java.util.Set; public class CharSet implements Serializable { /** - * Required for serialization support. Lang version 2.0. - * + * Required for serialization support. Lang version 2.0. + * * @see java.io.Serializable */ private static final long serialVersionUID = 5947847346149275958L; - /** - * A CharSet defining no characters. + /** + * A CharSet defining no characters. * @since 2.0 */ public static final CharSet EMPTY = new CharSet((String) null); - /** + /** * A CharSet defining ASCII alphabetic characters "a-zA-Z". * @since 2.0 */ public static final CharSet ASCII_ALPHA = new CharSet("a-zA-Z"); - /** + /** * A CharSet defining ASCII alphabetic characters "a-z". * @since 2.0 */ public static final CharSet ASCII_ALPHA_LOWER = new CharSet("a-z"); - /** + /** * A CharSet defining ASCII alphabetic characters "A-Z". * @since 2.0 */ public static final CharSet ASCII_ALPHA_UPPER = new CharSet("A-Z"); - /** + /** * A CharSet defining ASCII alphabetic characters "0-9". * @since 2.0 */ @@ -76,7 +76,7 @@ public class CharSet implements Serializable { * @since 2.0 */ protected static final Map<String, CharSet> COMMON = Collections.synchronizedMap(new HashMap<String, CharSet>()); - + static { COMMON.put(null, EMPTY); COMMON.put(StringUtils.EMPTY, EMPTY); @@ -114,7 +114,7 @@ public class CharSet implements Serializable { * <li>Negated single character, such as "^a" * <li>Ordinary single character, such as "a" * </ol> - * + * * <p>Matching works left to right. Once a match is found the * search starts again from the next character.</p> * @@ -128,7 +128,7 @@ public class CharSet implements Serializable { * as the "a-e" and "e-a" are the same.</p> * * <p>The set of characters represented is the union of the specified ranges.</p> - * + * * <p>There are two ways to add a literal negation character ({@code ^}):</p> * <ul> * <li>As the last character in a string, e.g. {@code CharSet.getInstance("a-z^")}</li> @@ -141,11 +141,11 @@ public class CharSet implements Serializable { * CharSet.getInstance("^a-c").contains('d') = true * CharSet.getInstance("^^a-c").contains('a') = true // (only '^' is negated) * CharSet.getInstance("^^a-c").contains('^') = false - * CharSet.getInstance("^a-cd-f").contains('d') = true + * CharSet.getInstance("^a-cd-f").contains('d') = true * CharSet.getInstance("a-c^").contains('^') = true * CharSet.getInstance("^", "a-c").contains('^') = true * </pre> - * + * * <p>All CharSet objects returned by this method will be immutable.</p> * * @param setStrs Strings to merge into the set, may be null @@ -162,7 +162,7 @@ public class CharSet implements Serializable { return common; } } - return new CharSet(setStrs); + return new CharSet(setStrs); } //----------------------------------------------------------------------- @@ -222,7 +222,7 @@ public class CharSet implements Serializable { * @return an array of immutable CharRange objects * @since 2.0 */ -// NOTE: This is no longer public as CharRange is no longer a public class. +// NOTE: This is no longer public as CharRange is no longer a public class. // It may be replaced when CharSet moves to Range. /*public*/ CharRange[] getCharRanges() { return set.toArray(new CharRange[set.size()]); http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/CharSetUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/CharSetUtils.java b/src/main/java/org/apache/commons/lang3/CharSetUtils.java index 015eeb8..4ad4e67 100644 --- a/src/main/java/org/apache/commons/lang3/CharSetUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharSetUtils.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,7 +22,7 @@ package org.apache.commons.lang3; * <p>This class handles {@code null} input gracefully. * An exception will not be thrown for a {@code null} input. * Each method documents its behaviour in more detail.</p> - * + * * <p>#ThreadSafe#</p> * @see CharSet * @since 1.0 @@ -240,8 +240,8 @@ public class CharSetUtils { return buffer.toString(); } - /** - * Determines whether or not all the Strings in an array are + /** + * Determines whether or not all the Strings in an array are * empty or not. * * @param strings String[] whose elements are being checked for emptiness http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/CharUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/CharUtils.java b/src/main/java/org/apache/commons/lang3/CharUtils.java index bb45e5f..f697c08 100644 --- a/src/main/java/org/apache/commons/lang3/CharUtils.java +++ b/src/main/java/org/apache/commons/lang3/CharUtils.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,19 +22,19 @@ package org.apache.commons.lang3; * <p>This class tries to handle {@code null} input gracefully. * An exception will not be thrown for a {@code null} input. * Each method documents its behaviour in more detail.</p> - * + * * <p>#ThreadSafe#</p> * @since 2.1 */ public class CharUtils { - + private static final String[] CHAR_STRING_ARRAY = new String[128]; - + private static final char[] HEX_DIGITS = new char[] {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; /** * {@code \u000a} linefeed LF ('\n'). - * + * * @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6">JLF: Escape Sequences * for Character and String Literals</a> * @since 2.2 @@ -43,13 +43,13 @@ public class CharUtils { /** * {@code \u000d} carriage return CR ('\r'). - * + * * @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6">JLF: Escape Sequences * for Character and String Literals</a> * @since 2.2 */ public static final char CR = '\r'; - + static { for (char c = 0; c < CHAR_STRING_ARRAY.length; c++) { @@ -71,7 +71,7 @@ public class CharUtils { //----------------------------------------------------------------------- /** * <p>Converts the character to a Character.</p> - * + * * <p>For ASCII 7 bit characters, this uses a cache that will return the * same Character object each time.</p> * @@ -88,14 +88,14 @@ public class CharUtils { public static Character toCharacterObject(final char ch) { return Character.valueOf(ch); } - + /** * <p>Converts the String to a Character using the first character, returning * null for empty Strings.</p> - * + * * <p>For ASCII 7 bit characters, this uses a cache that will return the * same Character object each time.</p> - * + * * <pre> * CharUtils.toCharacterObject(null) = null * CharUtils.toCharacterObject("") = null @@ -112,11 +112,11 @@ public class CharUtils { } return Character.valueOf(str.charAt(0)); } - + //----------------------------------------------------------------------- /** * <p>Converts the Character to a char throwing an exception for {@code null}.</p> - * + * * <pre> * CharUtils.toChar(' ') = ' ' * CharUtils.toChar('A') = 'A' @@ -131,10 +131,10 @@ public class CharUtils { Validate.isTrue(ch != null, "The Character must not be null"); return ch.charValue(); } - + /** * <p>Converts the Character to a char handling {@code null}.</p> - * + * * <pre> * CharUtils.toChar(null, 'X') = 'X' * CharUtils.toChar(' ', 'X') = ' ' @@ -151,12 +151,12 @@ public class CharUtils { } return ch.charValue(); } - + //----------------------------------------------------------------------- /** * <p>Converts the String to a char using the first character, throwing * an exception on empty Strings.</p> - * + * * <pre> * CharUtils.toChar("A") = 'A' * CharUtils.toChar("BA") = 'B' @@ -172,11 +172,11 @@ public class CharUtils { Validate.isTrue(StringUtils.isNotEmpty(str), "The String must not be empty"); return str.charAt(0); } - + /** * <p>Converts the String to a char using the first character, defaulting * the value on empty Strings.</p> - * + * * <pre> * CharUtils.toChar(null, 'X') = 'X' * CharUtils.toChar("", 'X') = 'X' @@ -194,12 +194,12 @@ public class CharUtils { } return str.charAt(0); } - + //----------------------------------------------------------------------- /** * <p>Converts the character to the Integer it represents, throwing an * exception if the character is not numeric.</p> - * + * * <p>This method coverts the char '1' to the int 1 and so on.</p> * * <pre> @@ -217,11 +217,11 @@ public class CharUtils { } return ch - 48; } - + /** * <p>Converts the character to the Integer it represents, throwing an * exception if the character is not numeric.</p> - * + * * <p>This method coverts the char '1' to the int 1 and so on.</p> * * <pre> @@ -239,11 +239,11 @@ public class CharUtils { } return ch - 48; } - + /** * <p>Converts the character to the Integer it represents, throwing an * exception if the character is not numeric.</p> - * + * * <p>This method coverts the char '1' to the int 1 and so on.</p> * * <pre> @@ -260,11 +260,11 @@ public class CharUtils { Validate.isTrue(ch != null, "The character must not be null"); return toIntValue(ch.charValue()); } - + /** * <p>Converts the character to the Integer it represents, throwing an * exception if the character is not numeric.</p> - * + * * <p>This method coverts the char '1' to the int 1 and so on.</p> * * <pre> @@ -283,11 +283,11 @@ public class CharUtils { } return toIntValue(ch.charValue(), defaultValue); } - + //----------------------------------------------------------------------- /** * <p>Converts the character to a String that contains the one character.</p> - * + * * <p>For ASCII 7 bit characters, this uses a cache that will return the * same String object each time.</p> * @@ -305,13 +305,13 @@ public class CharUtils { } return new String(new char[] {ch}); } - + /** * <p>Converts the character to a String that contains the one character.</p> - * + * * <p>For ASCII 7 bit characters, this uses a cache that will return the * same String object each time.</p> - * + * * <p>If {@code null} is passed in, {@code null} will be returned.</p> * * <pre> @@ -329,18 +329,18 @@ public class CharUtils { } return toString(ch.charValue()); } - + //-------------------------------------------------------------------------- /** * <p>Converts the string to the Unicode format '\u0020'.</p> - * + * * <p>This format is the Java source code format.</p> * * <pre> * CharUtils.unicodeEscaped(' ') = "\u0020" * CharUtils.unicodeEscaped('A') = "\u0041" * </pre> - * + * * @param ch the character to convert * @return the escaped Unicode string */ @@ -353,12 +353,12 @@ public class CharUtils { sb.append(HEX_DIGITS[(ch) & 15]); return sb.toString(); } - + /** * <p>Converts the string to the Unicode format '\u0020'.</p> - * + * * <p>This format is the Java source code format.</p> - * + * * <p>If {@code null} is passed in, {@code null} will be returned.</p> * * <pre> @@ -366,7 +366,7 @@ public class CharUtils { * CharUtils.unicodeEscaped(' ') = "\u0020" * CharUtils.unicodeEscaped('A') = "\u0041" * </pre> - * + * * @param ch the character to convert, may be null * @return the escaped Unicode string, null if null input */ @@ -376,7 +376,7 @@ public class CharUtils { } return unicodeEscaped(ch.charValue()); } - + //-------------------------------------------------------------------------- /** * <p>Checks whether the character is ASCII 7 bit.</p> @@ -389,14 +389,14 @@ public class CharUtils { * CharUtils.isAscii('\n') = true * CharUtils.isAscii('©') = false * </pre> - * + * * @param ch the character to check * @return true if less than 128 */ public static boolean isAscii(final char ch) { return ch < 128; } - + /** * <p>Checks whether the character is ASCII 7 bit printable.</p> * @@ -408,14 +408,14 @@ public class CharUtils { * CharUtils.isAsciiPrintable('\n') = false * CharUtils.isAsciiPrintable('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 32 and 126 inclusive */ public static boolean isAsciiPrintable(final char ch) { return ch >= 32 && ch < 127; } - + /** * <p>Checks whether the character is ASCII 7 bit control.</p> * @@ -427,14 +427,14 @@ public class CharUtils { * CharUtils.isAsciiControl('\n') = true * CharUtils.isAsciiControl('©') = false * </pre> - * + * * @param ch the character to check * @return true if less than 32 or equals 127 */ public static boolean isAsciiControl(final char ch) { return ch < 32 || ch == 127; } - + /** * <p>Checks whether the character is ASCII 7 bit alphabetic.</p> * @@ -446,14 +446,14 @@ public class CharUtils { * CharUtils.isAsciiAlpha('\n') = false * CharUtils.isAsciiAlpha('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 65 and 90 or 97 and 122 inclusive */ public static boolean isAsciiAlpha(final char ch) { return isAsciiAlphaUpper(ch) || isAsciiAlphaLower(ch); } - + /** * <p>Checks whether the character is ASCII 7 bit alphabetic upper case.</p> * @@ -465,14 +465,14 @@ public class CharUtils { * CharUtils.isAsciiAlphaUpper('\n') = false * CharUtils.isAsciiAlphaUpper('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 65 and 90 inclusive */ public static boolean isAsciiAlphaUpper(final char ch) { return ch >= 'A' && ch <= 'Z'; } - + /** * <p>Checks whether the character is ASCII 7 bit alphabetic lower case.</p> * @@ -484,14 +484,14 @@ public class CharUtils { * CharUtils.isAsciiAlphaLower('\n') = false * CharUtils.isAsciiAlphaLower('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 97 and 122 inclusive */ public static boolean isAsciiAlphaLower(final char ch) { return ch >= 'a' && ch <= 'z'; } - + /** * <p>Checks whether the character is ASCII 7 bit numeric.</p> * @@ -503,14 +503,14 @@ public class CharUtils { * CharUtils.isAsciiNumeric('\n') = false * CharUtils.isAsciiNumeric('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 48 and 57 inclusive */ public static boolean isAsciiNumeric(final char ch) { return ch >= '0' && ch <= '9'; } - + /** * <p>Checks whether the character is ASCII 7 bit numeric.</p> * @@ -522,7 +522,7 @@ public class CharUtils { * CharUtils.isAsciiAlphanumeric('\n') = false * CharUtils.isAsciiAlphanumeric('©') = false * </pre> - * + * * @param ch the character to check * @return true if between 48 and 57 or 65 and 90 or 97 and 122 inclusive */ http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/ClassUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/ClassUtils.java b/src/main/java/org/apache/commons/lang3/ClassUtils.java index 60395ef..e0b4d72 100644 --- a/src/main/java/org/apache/commons/lang3/ClassUtils.java +++ b/src/main/java/org/apache/commons/lang3/ClassUtils.java @@ -1252,51 +1252,51 @@ public class ClassUtils { */ public static Iterable<Class<?>> hierarchy(final Class<?> type, final Interfaces interfacesBehavior) { final Iterable<Class<?>> classes = new Iterable<Class<?>>() { - + @Override public Iterator<Class<?>> iterator() { final MutableObject<Class<?>> next = new MutableObject<Class<?>>(type); return new Iterator<Class<?>>() { - + @Override public boolean hasNext() { return next.getValue() != null; } - + @Override public Class<?> next() { final Class<?> result = next.getValue(); next.setValue(result.getSuperclass()); return result; } - + @Override public void remove() { throw new UnsupportedOperationException(); } - + }; } - + }; if (interfacesBehavior != Interfaces.INCLUDE) { return classes; } return new Iterable<Class<?>>() { - + @Override public Iterator<Class<?>> iterator() { final Set<Class<?>> seenInterfaces = new HashSet<>(); final Iterator<Class<?>> wrapped = classes.iterator(); - + return new Iterator<Class<?>>() { Iterator<Class<?>> interfaces = Collections.<Class<?>> emptySet().iterator(); - + @Override public boolean hasNext() { return interfaces.hasNext() || wrapped.hasNext(); } - + @Override public Class<?> next() { if (interfaces.hasNext()) { @@ -1310,7 +1310,7 @@ public class ClassUtils { interfaces = currentInterfaces.iterator(); return nextSuperclass; } - + private void walkInterfaces(final Set<Class<?>> addTo, final Class<?> c) { for (final Class<?> iface : c.getInterfaces()) { if (!seenInterfaces.contains(iface)) { @@ -1319,12 +1319,12 @@ public class ClassUtils { walkInterfaces(addTo, iface); } } - + @Override public void remove() { throw new UnsupportedOperationException(); } - + }; } }; http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/Conversion.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/Conversion.java b/src/main/java/org/apache/commons/lang3/Conversion.java index 6d381c0..d177cc4 100644 --- a/src/main/java/org/apache/commons/lang3/Conversion.java +++ b/src/main/java/org/apache/commons/lang3/Conversion.java @@ -59,12 +59,12 @@ import java.util.UUID; * Development status: work on going, only a part of the little endian, Lsb0 methods implemented * so far. * </p> - * + * * @since Lang 3.2 */ public class Conversion { - + private static final boolean[] TTTT = new boolean[] { true, true, true, true }; private static final boolean[] FTTT = new boolean[] { false, true, true, true }; private static final boolean[] TFTT = new boolean[] { true, false, true, true }; @@ -89,7 +89,7 @@ public class Conversion { * <p> * '1' is converted to 1 * </p> - * + * * @param hexDigit the hexadecimal digit to convert * @return an int equals to {@code hexDigit} * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit @@ -109,7 +109,7 @@ public class Conversion { * <p> * '1' is converted to 8 * </p> - * + * * @param hexDigit the hexadecimal digit to convert * @return an int equals to {@code hexDigit} * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit @@ -167,7 +167,7 @@ public class Conversion { * <p> * '1' is converted as follow: (1, 0, 0, 0) * </p> - * + * * @param hexDigit the hexadecimal digit to convert * @return a boolean array with the binary representation of {@code hexDigit} * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit @@ -225,7 +225,7 @@ public class Conversion { * <p> * '1' is converted as follow: (0, 0, 0, 1) * </p> - * + * * @param hexDigit the hexadecimal digit to convert * @return a boolean array with the binary representation of {@code hexDigit} * @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit @@ -283,7 +283,7 @@ public class Conversion { * <p> * (1, 0, 0, 0) is converted as follow: '1' * </p> - * + * * @param src the binary to convert * @return a hexadecimal digit representing the selected bits * @throws IllegalArgumentException if {@code src} is empty @@ -301,7 +301,7 @@ public class Conversion { * <p> * (1, 0, 0, 0) is converted as follow: '1' * </p> - * + * * @param src the binary to convert * @param srcPos the position of the lsb to start the conversion * @return a hexadecimal digit representing the selected bits @@ -344,7 +344,7 @@ public class Conversion { * <p> * (1, 0, 0, 0) is converted as follow: '8' * </p> - * + * * @param src the binary to convert * @return a hexadecimal digit representing the selected bits * @throws IllegalArgumentException if {@code src} is empty, {@code src.length < 4} or @@ -364,7 +364,7 @@ public class Conversion { * (1, 0, 0, 0) is converted as follow: '8' (1,0,0,1,1,0,1,0) with srcPos = 3 is converted * to 'D' * </p> - * + * * @param src the binary to convert * @param srcPos the position of the lsb to start the conversion * @return a hexadecimal digit representing the selected bits @@ -412,7 +412,7 @@ public class Conversion { * (1, 0, 0, 0) is converted as follow: '8' (1,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0) is converted * to '4' * </p> - * + * * @param src the binary to convert * @return a hexadecimal digit representing the selected bits * @throws IllegalArgumentException if {@code src} is empty @@ -431,7 +431,7 @@ public class Conversion { * (1, 0, 0, 0) with srcPos = 0 is converted as follow: '8' (1,0,0,0,0,0,0,0, * 0,0,0,1,0,1,0,0) with srcPos = 2 is converted to '5' * </p> - * + * * @param src the binary to convert * @param srcPos the position of the lsb to start the conversion * @return a hexadecimal digit representing the selected bits @@ -485,7 +485,7 @@ public class Conversion { * <p> * 10 returns 'A' and so on... * </p> - * + * * @param nibble the 4 bits to convert * @return a hexadecimal digit representing the 4 lsb of {@code nibble} * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15} @@ -511,7 +511,7 @@ public class Conversion { * <p> * 10 returns '5' and so on... * </p> - * + * * @param nibble the 4 bits to convert * @return a hexadecimal digit representing the 4 lsb of {@code nibble} * @throws IllegalArgumentException if {@code nibble < 0} or {@code nibble > 15} @@ -560,7 +560,7 @@ public class Conversion { * Converts an array of int into a long using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the int array to convert * @param srcPos the position in {@code src}, in int unit, from where to start the * conversion @@ -595,7 +595,7 @@ public class Conversion { * Converts an array of short into a long using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the short array to convert * @param srcPos the position in {@code src}, in short unit, from where to start the * conversion @@ -630,7 +630,7 @@ public class Conversion { * Converts an array of short into an int using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the short array to convert * @param srcPos the position in {@code src}, in short unit, from where to start the * conversion @@ -665,7 +665,7 @@ public class Conversion { * Converts an array of byte into a long using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the byte array to convert * @param srcPos the position in {@code src}, in byte unit, from where to start the * conversion @@ -700,7 +700,7 @@ public class Conversion { * Converts an array of byte into an int using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the byte array to convert * @param srcPos the position in {@code src}, in byte unit, from where to start the * conversion @@ -735,7 +735,7 @@ public class Conversion { * Converts an array of byte into a short using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the byte array to convert * @param srcPos the position in {@code src}, in byte unit, from where to start the * conversion @@ -770,7 +770,7 @@ public class Conversion { * Converts an array of Char into a long using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the hex string to convert * @param srcPos the position in {@code src}, in Char unit, from where to start the * conversion @@ -803,7 +803,7 @@ public class Conversion { * Converts an array of Char into an int using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the hex string to convert * @param srcPos the position in {@code src}, in Char unit, from where to start the * conversion @@ -835,7 +835,7 @@ public class Conversion { * Converts an array of Char into a short using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the hex string to convert * @param srcPos the position in {@code src}, in Char unit, from where to start the * conversion @@ -868,7 +868,7 @@ public class Conversion { * Converts an array of Char into a byte using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the hex string to convert * @param srcPos the position in {@code src}, in Char unit, from where to start the * conversion @@ -901,7 +901,7 @@ public class Conversion { * Converts binary (represented as boolean array) into a long using the default (little * endian, Lsb0) byte and bit ordering. * </p> - * + * * @param src the binary to convert * @param srcPos the position in {@code src}, in boolean unit, from where to start the * conversion @@ -936,7 +936,7 @@ public class Conversion { * Converts binary (represented as boolean array) into an int using the default (little * endian, Lsb0) byte and bit ordering. * </p> - * + * * @param src the binary to convert * @param srcPos the position in {@code src}, in boolean unit, from where to start the * conversion @@ -971,7 +971,7 @@ public class Conversion { * Converts binary (represented as boolean array) into a short using the default (little * endian, Lsb0) byte and bit ordering. * </p> - * + * * @param src the binary to convert * @param srcPos the position in {@code src}, in boolean unit, from where to start the * conversion @@ -1006,7 +1006,7 @@ public class Conversion { * Converts binary (represented as boolean array) into a byte using the default (little * endian, Lsb0) byte and bit ordering. * </p> - * + * * @param src the binary to convert * @param srcPos the position in {@code src}, in boolean unit, from where to start the * conversion @@ -1041,7 +1041,7 @@ public class Conversion { * Converts a long into an array of int using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the long to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1073,7 +1073,7 @@ public class Conversion { * Converts a long into an array of short using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the long to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1105,7 +1105,7 @@ public class Conversion { * Converts an int into an array of short using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the int to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1137,7 +1137,7 @@ public class Conversion { * Converts a long into an array of byte using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the long to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1169,7 +1169,7 @@ public class Conversion { * Converts an int into an array of byte using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the int to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1201,7 +1201,7 @@ public class Conversion { * Converts a short into an array of byte using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the short to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1233,7 +1233,7 @@ public class Conversion { * Converts a long into an array of Char using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the long to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dstInit the initial value for the result String @@ -1272,7 +1272,7 @@ public class Conversion { * Converts an int into an array of Char using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the int to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dstInit the initial value for the result String @@ -1311,7 +1311,7 @@ public class Conversion { * Converts a short into an array of Char using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the short to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dstInit the initial value for the result String @@ -1350,7 +1350,7 @@ public class Conversion { * Converts a byte into an array of Char using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the byte to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dstInit the initial value for the result String @@ -1389,7 +1389,7 @@ public class Conversion { * Converts a long into an array of boolean using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the long to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1421,7 +1421,7 @@ public class Conversion { * Converts an int into an array of boolean using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the int to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1453,7 +1453,7 @@ public class Conversion { * Converts a short into an array of boolean using the default (little endian, Lsb0) byte * and bit ordering. * </p> - * + * * @param src the short to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1486,7 +1486,7 @@ public class Conversion { * Converts a byte into an array of boolean using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the byte to convert * @param srcPos the position in {@code src}, in bits, from where to start the conversion * @param dst the destination array @@ -1518,7 +1518,7 @@ public class Conversion { * Converts UUID into an array of byte using the default (little endian, Lsb0) byte and bit * ordering. * </p> - * + * * @param src the UUID to convert * @param dst the destination array * @param dstPos the position in {@code dst} where to copy the result @@ -1548,7 +1548,7 @@ public class Conversion { * Converts bytes from an array into a UUID using the default (little endian, Lsb0) byte and * bit ordering. * </p> - * + * * @param src the byte array to convert * @param srcPos the position in {@code src} where to copy the result from * @return a UUID http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/EnumUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/EnumUtils.java b/src/main/java/org/apache/commons/lang3/EnumUtils.java index d6bcdc0..84e93e2 100644 --- a/src/main/java/org/apache/commons/lang3/EnumUtils.java +++ b/src/main/java/org/apache/commons/lang3/EnumUtils.java @@ -289,7 +289,7 @@ public class EnumUtils { */ private static <E extends Enum<E>> Class<E> checkBitVectorable(final Class<E> enumClass) { final E[] constants = asEnum(enumClass).getEnumConstants(); - Validate.isTrue(constants.length <= Long.SIZE, CANNOT_STORE_S_S_VALUES_IN_S_BITS, + Validate.isTrue(constants.length <= Long.SIZE, CANNOT_STORE_S_S_VALUES_IN_S_BITS, Integer.valueOf(constants.length), enumClass.getSimpleName(), Integer.valueOf(Long.SIZE)); return enumClass; http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/JavaVersion.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java b/src/main/java/org/apache/commons/lang3/JavaVersion.java index 8c992f2..e464043 100644 --- a/src/main/java/org/apache/commons/lang3/JavaVersion.java +++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java @@ -26,12 +26,12 @@ import org.apache.commons.lang3.math.NumberUtils; * @since 3.0 */ public enum JavaVersion { - + /** * The Java version reported by Android. This is not an official Java version number. */ JAVA_0_9(1.5f, "0.9"), - + /** * Java 1.1. */ @@ -74,7 +74,7 @@ public enum JavaVersion { /** * Java 1.9. - * + * * @deprecated As of release 3.5, replaced by {@link #JAVA_9} */ @Deprecated @@ -198,7 +198,7 @@ public enum JavaVersion { /** * Gets the Java Version from the system or 99.0 if the {@code java.specification.version} system property is not set. - * + * * @return the value of {@code java.specification.version} system property or 99.0 if it is not set. */ private static float maxVersion() { @@ -211,7 +211,7 @@ public enum JavaVersion { /** * Parses a float value from a String. - * + * * @param value the String to parse. * @return the float value represented by the string or -1 if the given String can not be parsed. */ http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1da8ccdb/src/main/java/org/apache/commons/lang3/LocaleUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java index af0731f..51bbf5f 100644 --- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java +++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,11 +38,11 @@ import java.util.concurrent.ConcurrentMap; public class LocaleUtils { /** Concurrent map of language locales by country. */ - private static final ConcurrentMap<String, List<Locale>> cLanguagesByCountry = + private static final ConcurrentMap<String, List<Locale>> cLanguagesByCountry = new ConcurrentHashMap<>(); /** Concurrent map of country locales by language. */ - private static final ConcurrentMap<String, List<Locale>> cCountriesByLanguage = + private static final ConcurrentMap<String, List<Locale>> cCountriesByLanguage = new ConcurrentHashMap<>(); /** @@ -243,7 +243,7 @@ public class LocaleUtils { //----------------------------------------------------------------------- /** * <p>Obtains an unmodifiable list of installed locales.</p> - * + * * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}. * It is more efficient, as the JDK method must create a new array each * time it is called.</p> @@ -257,7 +257,7 @@ public class LocaleUtils { //----------------------------------------------------------------------- /** * <p>Obtains an unmodifiable set of installed locales.</p> - * + * * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}. * It is more efficient, as the JDK method must create a new array each * time it is called.</p> @@ -314,7 +314,7 @@ public class LocaleUtils { //----------------------------------------------------------------------- /** * <p>Obtains the list of countries supported for a given language.</p> - * + * * <p>This method takes a language code and searches to find the * countries available for that language. Variant locales are removed.</p> * @@ -351,7 +351,7 @@ public class LocaleUtils { private static final List<Locale> AVAILABLE_LOCALE_LIST; /** Unmodifiable set of available locales. */ private static final Set<Locale> AVAILABLE_LOCALE_SET; - + static { final List<Locale> list = new ArrayList<>(Arrays.asList(Locale.getAvailableLocales())); // extra safe AVAILABLE_LOCALE_LIST = Collections.unmodifiableList(list);