[commons-collections] branch master updated: COLLECTIONS-697: correct changelog entry (ref #55)
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git The following commit(s) were added to refs/heads/master by this push: new 0bf44ae COLLECTIONS-697: correct changelog entry (ref #55) 0bf44ae is described below commit 0bf44ae0404307e5dcaf5fe02cb6b1ac34341d5d Author: Eitan Adler AuthorDate: Sat Feb 1 14:34:50 2020 -0800 COLLECTIONS-697: correct changelog entry (ref #55) use the apache committer name instead of the github username ref: 64420e34cc20b08d4386cfbfec5aaa3f49973c10 --- src/changes/changes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index bde17b3..4e59ace 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -21,7 +21,7 @@ - + JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented
[commons-codec] branch master updated: NOTICE: bump copyright year
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-codec.git The following commit(s) were added to refs/heads/master by this push: new 0107996 NOTICE: bump copyright year 0107996 is described below commit 010799634ce1366bac0fa7bfb5bcc26992678602 Author: Eitan Adler AuthorDate: Sun Jan 5 10:17:29 2020 -0800 NOTICE: bump copyright year --- NOTICE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index 7144883..9899d21 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Apache Commons Codec -Copyright 2002-2019 The Apache Software Foundation +Copyright 2002-2020 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/).
[commons-numbers] branch master updated: testutils: correct order of expected and actual results
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git The following commit(s) were added to refs/heads/master by this push: new 34542f4 testutils: correct order of expected and actual results 34542f4 is described below commit 34542f4232cd7941e810cab0f43be1dbe70d9777 Author: Eitan Adler AuthorDate: Tue Dec 24 10:14:59 2019 -0800 testutils: correct order of expected and actual results --- .../src/test/java/org/apache/commons/numbers/core/TestUtils.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/TestUtils.java b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/TestUtils.java index 2d01f9c..bfdb434 100644 --- a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/TestUtils.java +++ b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/TestUtils.java @@ -107,7 +107,7 @@ public final class TestUtils { } else if (Double.isInfinite(actual) || Double.isInfinite(expected)) { Assertions.assertEquals(expected, actual, relativeError); } else if (expected == 0.0) { -Assertions.assertEquals(actual, expected, relativeError, msg); +Assertions.assertEquals(expected, actual, relativeError, msg); } else { double absError = Math.abs(expected) * relativeError; Assertions.assertEquals(expected, actual, absError, msg);
[commons-numbers] branch master updated (7a3f962 -> 6bcc6d9)
This is an automated email from the ASF dual-hosted git repository. eax pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git. from 7a3f962 NUMBERS-77: merged fraction-dev new 01f2e0e Revert "[numbers] support JUnit 5 tests" new 6bcc6d9 [numbers] support JUnit 5 tests The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: pom.xml | 39 --- 1 file changed, 16 insertions(+), 23 deletions(-)
[commons-numbers] 01/02: Revert "[numbers] support JUnit 5 tests"
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git commit 01f2e0eac182e67a2bc38be875e303fbb231f1ac Author: Eitan Adler AuthorDate: Thu Jun 6 21:11:44 2019 -0700 Revert "[numbers] support JUnit 5 tests" This reverts commit 35b53cff1a9fc8c9a5b4a44bd33d22c959c4. --- pom.xml | 23 --- 1 file changed, 23 deletions(-) diff --git a/pom.xml b/pom.xml index a161a95..8ff0a23 100644 --- a/pom.xml +++ b/pom.xml @@ -101,17 +101,6 @@ - org.junit.jupiter - junit-jupiter-engine - 5.0.0-M4 - - - org.junit.platform - junit-platform-runner - 5.0.0-M4 - test - - junit junit 4.12 @@ -206,18 +195,6 @@ false - - -org.junit.platform -junit-platform-surefire-provider -1.3.2 - - -org.junit.vintage -junit-vintage-engine -5.4.2 - - maven-assembly-plugin
[commons-numbers] 02/02: [numbers] support JUnit 5 tests
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git commit 6bcc6d9a16bea265243f68b298713d10abb09224 Author: Eitan Adler AuthorDate: Wed Jun 5 02:34:25 2019 -0700 [numbers] support JUnit 5 tests --- pom.xml | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 8ff0a23..b3d5dff 100644 --- a/pom.xml +++ b/pom.xml @@ -96,14 +96,30 @@ test-jar test + +org.junit +junit-bom +${numbers.junit.bom.version} +import +pom + - junit - junit - 4.12 + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.platform + junit-platform-runner + test + + + org.junit.vintage + junit-vintage-engine test @@ -133,6 +149,7 @@ 3.9.0 3.0.0 2.7.2 +5.4.2 ${basedir} @@ -188,13 +205,12 @@ -org.apache.maven.plugins maven-surefire-plugin - - - - false - +2.22.0 + + +maven-failsafe-plugin +2.22.0 maven-assembly-plugin
[commons-numbers] branch eax/simple-migrate-map created (now 8508164)
This is an automated email from the ASF dual-hosted git repository. eax pushed a change to branch eax/simple-migrate-map in repository https://gitbox.apache.org/repos/asf/commons-numbers.git. at 8508164 Merge branch 'master' of http://gitbox.apache.org/repos/asf/commons-numbers into eax/simple-migrate-map This branch includes the following new commits: new 8508164 Merge branch 'master' of http://gitbox.apache.org/repos/asf/commons-numbers into eax/simple-migrate-map The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[commons-numbers] 01/01: Merge branch 'master' of http://gitbox.apache.org/repos/asf/commons-numbers into eax/simple-migrate-map
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch eax/simple-migrate-map in repository https://gitbox.apache.org/repos/asf/commons-numbers.git commit 8508164a4135167a41be3f9645db8f9cf3448007 Merge: a28928f 7a3f962 Author: Eitan Adler AuthorDate: Thu Jun 6 21:04:19 2019 -0700 Merge branch 'master' of http://gitbox.apache.org/repos/asf/commons-numbers into eax/simple-migrate-map .../commons/numbers/fraction/AbstractFormat.java | 205 --- .../commons/numbers/fraction/BigFraction.java | 366 +-- .../numbers/fraction/BigFractionFormat.java| 282 --- .../apache/commons/numbers/fraction/Fraction.java | 318 - .../commons/numbers/fraction/FractionFormat.java | 260 -- .../numbers/fraction/ProperBigFractionFormat.java | 233 .../numbers/fraction/ProperFractionFormat.java | 225 .../numbers/fraction/BigFractionFormatTest.java| 332 - .../commons/numbers/fraction/BigFractionTest.java | 391 +++-- .../numbers/fraction/FractionFormatTest.java | 350 -- .../commons/numbers/fraction/FractionTest.java | 378 ++-- 11 files changed, 721 insertions(+), 2619 deletions(-) diff --cc commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java index be45cc0,eedb910..476972b --- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java +++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java @@@ -26,16 -26,7 +26,7 @@@ import org.apache.commons.numbers.core. * Representation of a rational number without any overflow. This class is * immutable. */ - public class BigFraction - extends Number - implements Comparable, Serializable { - - /** A fraction representing "2 / 1". */ - public static final BigFraction TWO = new BigFraction(2); - - /** A fraction representing "1". */ - public static final BigFraction ONE = new BigFraction(1); - -public class BigFraction extends Number implements Comparable, Serializable { ++public class BigFraction extends Number implements Comparable, Serializable { /** A fraction representing "0". */ public static final BigFraction ZERO = new BigFraction(0); @@@ -328,8 -189,143 +189,143 @@@ denominator = BigInteger.valueOf(q1); } } - + /** + * Create a fraction given the double value. + * + * This constructor behaves differently from + * {@link #BigFraction(double, double, int)}. It converts the double value + * exactly, considering its internal bits representation. This works for all + * values except NaN and infinities and does not requires any loop or + * convergence threshold. + * + * + * Since this conversion is exact and since double numbers are sometimes + * approximated, the fraction created may seem strange in some cases. For example, + * calling new BigFraction(1.0 / 3.0) does not create + * the fraction 1/3, but the fraction 6004799503160661 / 18014398509481984 + * because the double number passed to the constructor is not exactly 1/3 + * (this number cannot be stored exactly in IEEE754). + * + * @see #BigFraction(double, double, int) + * @param value the double value to convert to a fraction. + * @exception IllegalArgumentException if value is NaN or infinite + */ + private BigFraction(final double value) throws IllegalArgumentException { + if (Double.isNaN(value)) { + throw new IllegalArgumentException("cannot convert NaN value"); + } + if (Double.isInfinite(value)) { + throw new IllegalArgumentException("cannot convert infinite value"); + } + + // compute m and k such that value = m * 2^k + final long bits = Double.doubleToLongBits(value); + final long sign = bits & 0x8000L; + final long exponent = bits & 0x7ff0L; + long m = bits & 0x000fL; + if (exponent != 0) { + // this was a normalized number, add the implicit most significant bit + m |= 0x0010L; + } + if (sign != 0) { + m = -m; + } + int k = ((int) (exponent >> 52)) - 1075; + while (((m & 0x001eL) != 0) && ((m & 0x1) == 0)) { + m >>= 1; + ++k; + } + + if (k < 0) { + numerator = BigInteger.valueOf(m); + denominator = BigInteger.ZERO.flipBit(-k); + } else { + numerator = BigIntege
[commons-numbers] branch master updated: [numbers] support JUnit 5 tests
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-numbers.git The following commit(s) were added to refs/heads/master by this push: new 35b [numbers] support JUnit 5 tests 35b is described below commit 35b53cff1a9fc8c9a5b4a44bd33d22c959c4 Author: Eitan Adler AuthorDate: Wed Jun 5 02:34:25 2019 -0700 [numbers] support JUnit 5 tests --- pom.xml | 23 +++ 1 file changed, 23 insertions(+) diff --git a/pom.xml b/pom.xml index 8ff0a23..a161a95 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,17 @@ + org.junit.jupiter + junit-jupiter-engine + 5.0.0-M4 + + + org.junit.platform + junit-platform-runner + 5.0.0-M4 + test + + junit junit 4.12 @@ -195,6 +206,18 @@ false + + +org.junit.platform +junit-platform-surefire-provider +1.3.2 + + +org.junit.vintage +junit-vintage-engine +5.4.2 + + maven-assembly-plugin
[commons-lang] branch master updated: [ToStringBuilderTest] clean up after some old issues
This is an automated email from the ASF dual-hosted git repository. eax pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git The following commit(s) were added to refs/heads/master by this push: new 6b7a848 [ToStringBuilderTest] clean up after some old issues 6b7a848 is described below commit 6b7a8480102144663b567982a5536340a57a431e Author: Eitan Adler AuthorDate: Sat Feb 9 02:08:32 2019 -0800 [ToStringBuilderTest] clean up after some old issues - Remove code to handle old JDK 6 bugs - Fix a mis-ordered assertEquals - Remove a deprecated call to Character's constructor --- .../org/apache/commons/lang3/builder/ToStringBuilderTest.java | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java index da973e7..72ce965 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java @@ -21,14 +21,12 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.SystemUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; @@ -104,7 +102,7 @@ public class ToStringBuilderTest { */ @Test public void testReflectionCharacter() { -final Character c = new Character('A'); +final Character c = 'A'; assertEquals(this.toBaseString(c) + "[value=A]", ToStringBuilder.reflectionToString(c)); } @@ -315,10 +313,6 @@ public class ToStringBuilderTest { // Reflection hierarchy tests @Test public void testReflectionHierarchyArrayList() { -// note, the test data depends on the internal representation of the ArrayList, which may differ between JDK versions and vendors -// representation different for IBM JDK 1.6.0, LANG-727 -assumeFalse("IBM Corporation".equals(SystemUtils.JAVA_VENDOR) && "1.6".equals(SystemUtils.JAVA_SPECIFICATION_VERSION)); -assumeFalse("Oracle Corporation".equals(SystemUtils.JAVA_VENDOR) && "1.6".compareTo(SystemUtils.JAVA_SPECIFICATION_VERSION) < 0); // LANG-1337 without this, the generated string can differ depending on the JVM version/vendor final List list = new ArrayList<>(ARRAYLIST_INITIAL_CAPACITY); final String baseString = this.toBaseString(list); @@ -1276,6 +1270,7 @@ public class ToStringBuilderTest { /** * Test fixture for ReflectionToStringBuilder.toString() for statics. */ +@SuppressWarnings("unused") class InheritedReflectionStaticFieldsFixture extends SimpleReflectionStaticFieldsFixture { static final String staticString2 = "staticString2"; static final int staticInt2 = 67890; @@ -1303,7 +1298,7 @@ public class ToStringBuilderTest { final MultiLineTestObject obj = new MultiLineTestObject(); final ToStringBuilder testBuilder = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .appendToString(obj.toString()); -assertEquals(testBuilder.toString().indexOf("testInt=31337"), -1); +assertEquals(-1, testBuilder.toString().indexOf("testInt=31337")); } }
commons-io git commit: [io] use non-short-circuit operator
Repository: commons-io Updated Branches: refs/heads/master 769842a21 -> 3ad22fe3d [io] use non-short-circuit operator This should have identical semantics but is less confusing to read. Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/3ad22fe3 Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/3ad22fe3 Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/3ad22fe3 Branch: refs/heads/master Commit: 3ad22fe3d689781a76a92908d0bbc119b2c68892 Parents: 769842a Author: Eitan Adler Authored: Fri Nov 2 21:21:18 2018 -0700 Committer: Eitan Adler Committed: Fri Nov 2 21:21:18 2018 -0700 -- .../org/apache/commons/io/input/compatibility/XmlStreamReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-io/blob/3ad22fe3/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java -- diff --git a/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java b/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java index 5442315..fe417ba 100644 --- a/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java +++ b/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java @@ -510,7 +510,7 @@ public class XmlStreamReader extends Reader { final String bomEnc, final String xmlGuessEnc, final String xmlEnc, final InputStream is, final boolean lenient) throws IOException { String encoding; -if (lenient & xmlEnc != null) { +if (lenient && (xmlEnc != null)) { encoding = xmlEnc; } else { final boolean appXml = isAppXml(cTMime);
svn commit: r1843039 - in /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines: CurrencyValidator.java PercentValidator.java
Author: eax Date: Sun Oct 7 01:19:13 2018 New Revision: 1843039 URL: http://svn.apache.org/viewvc?rev=1843039=rev Log: Fix minor documentation issue: an an extra word Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java?rev=1843039=1843038=1843039=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CurrencyValidator.java Sun Oct 7 01:19:13 2018 @@ -24,7 +24,7 @@ import java.text.Format; * * This is one implementation of a currency validator that has the following features: * - * It is lenient about the the presence of the currency symbol + * It is lenient about the presence of the currency symbol * It converts the currency to a java.math.BigDecimal * * Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java?rev=1843039=1843038=1843039=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/PercentValidator.java Sun Oct 7 01:19:13 2018 @@ -25,7 +25,7 @@ import java.math.BigDecimal; * * This is one implementation of a percent validator that has the following features: * - * It is lenient about the the presence of the percent symbol + * It is lenient about the presence of the percent symbol * It converts the percent to a java.math.BigDecimal * *
commons-collections git commit: COLLECTIONS-697: Ensure FixedSizeList respects underlying list's size
Repository: commons-collections Updated Branches: refs/heads/master d6800c606 -> 74ad21147 COLLECTIONS-697: Ensure FixedSizeList respects underlying list's size Formally document and test that if the size of the backing list of FixedSizeList changes, then so does the FixedSizeList. This has been the historical behavior. Letting it be part of the contract is reasonable, expected, and worthwhile to note. Fixes #55 Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-collections/commit/74ad2114 Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/74ad2114 Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/74ad2114 Branch: refs/heads/master Commit: 74ad2114700446837ed451f36107a056301a65fc Parents: d6800c6 Author: george-ranjan Authored: Tue Oct 2 23:14:07 2018 +0530 Committer: Eitan Adler Committed: Wed Oct 3 03:40:46 2018 -0700 -- .../commons/collections4/list/FixedSizeList.java | 5 + .../collections4/list/FixedSizeListTest.java | 17 + 2 files changed, 22 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-collections/blob/74ad2114/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java -- diff --git a/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java b/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java index 6e087a9..f86ebb3 100644 --- a/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java +++ b/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java @@ -31,6 +31,11 @@ import org.apache.commons.collections4.iterators.UnmodifiableIterator; * The add, remove, clear and retain operations are unsupported. * The set method is allowed (as it doesn't change the list size). * + * NOTE: + * Modifying the decorated list directly would results in influencing the outcome + * of method calls on this object. For example, the bounds of this list would reflect + * a newly added object to the underlying list. + * * This class is Serializable from Commons Collections 3.1. * * @param the type of elements in this collection http://git-wip-us.apache.org/repos/asf/commons-collections/blob/74ad2114/src/test/java/org/apache/commons/collections4/list/FixedSizeListTest.java -- diff --git a/src/test/java/org/apache/commons/collections4/list/FixedSizeListTest.java b/src/test/java/org/apache/commons/collections4/list/FixedSizeListTest.java index bb99abb..0c112ff 100644 --- a/src/test/java/org/apache/commons/collections4/list/FixedSizeListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/FixedSizeListTest.java @@ -16,6 +16,8 @@ */ package org.apache.commons.collections4.list; +import org.junit.Assert; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -66,4 +68,19 @@ public class FixedSizeListTest extends AbstractListTest { //writeExternalFormToDisk((java.io.Serializable) getCollection(), "src/test/resources/data/test/FixedSizeList.fullCollection.version4.obj"); //} +public void testListAllowsMutationOfUnderlyingCollection() { + +List decoratedList = new ArrayList<>(); +decoratedList.add("item 1"); +decoratedList.add("item 2"); +// +FixedSizeList fixedSizeList = FixedSizeList.fixedSizeList(decoratedList); +int sizeBefore = fixedSizeList.size(); +// +boolean changed = decoratedList.add("New Value"); +Assert.assertTrue(changed); +// +Assert.assertEquals("Modifying an the underlying list is allowed", +sizeBefore + 1, fixedSizeList.size()); +} }
[lang] StringUtils: trivial formatting change.
Repository: commons-lang Updated Branches: refs/heads/master 69e843890 -> ba7ca7998 StringUtils: trivial formatting change. This replaces with {@code} primarily as a way to test INFRA-17094. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/ba7ca799 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/ba7ca799 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/ba7ca799 Branch: refs/heads/master Commit: ba7ca7998f9fe0fa443e9636122944de727f9be4 Parents: 69e8438 Author: Eitan Adler Authored: Fri Oct 5 19:47:03 2018 -0700 Committer: Eitan Adler Committed: Fri Oct 5 19:47:58 2018 -0700 -- src/main/java/org/apache/commons/lang3/StringUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/ba7ca799/src/main/java/org/apache/commons/lang3/StringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 1d7b9b9..f96c7c5 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -8022,7 +8022,7 @@ public class StringUtils { * CharSequences begin to differ. * * For example, - * indexOfDifference(new String[] {"i am a machine", "i am a robot"}) - 7 + * {@code indexOfDifference(new String[] {"i am a machine", "i am a robot"}) -> 7} * * * StringUtils.indexOfDifference(null) = -1
[text] tests: fix junit usage in a few instances
Repository: commons-text Updated Branches: refs/heads/master 9273e5eda -> 9dd0e051e tests: fix junit usage in a few instances - for assertNotNull the order is value, message. In this case the wrong order impact is that nothing is tested. Im - for assertEquals the order is expected, actual. In this case the wrong order just results in a weird error message. Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/9dd0e051 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/9dd0e051 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/9dd0e051 Branch: refs/heads/master Commit: 9dd0e051e44e842bc3ee81fdd3bb32b42279be82 Parents: 9273e5e Author: Eitan Adler Authored: Thu Aug 23 23:21:59 2018 -0700 Committer: Eitan Adler Committed: Thu Aug 23 23:29:40 2018 -0700 -- .../java/org/apache/commons/text/ExtendedMessageFormatTest.java| 2 +- .../java/org/apache/commons/text/lookup/DateStringLookupTest.java | 2 +- .../apache/commons/text/lookup/InterpolatorStringLookupTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/9dd0e051/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java -- diff --git a/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java b/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java index 0563826..626ae93 100644 --- a/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java +++ b/src/test/java/org/apache/commons/text/ExtendedMessageFormatTest.java @@ -84,7 +84,7 @@ public class ExtendedMessageFormatTest { public void testEmbeddedPatternInChoice() { final String pattern = "Hi {0,lower}, got {1,choice,0#none|1#one|1<{1,number}}, {2,upper}!"; final ExtendedMessageFormat emf = new ExtendedMessageFormat(pattern, registry); -assertEquals(emf.format(new Object[] {"there", 3, "great"}), "Hi there, got 3, GREAT!"); +assertEquals("Hi there, got 3, GREAT!", emf.format(new Object[] {"there", 3, "great"})); } /** http://git-wip-us.apache.org/repos/asf/commons-text/blob/9dd0e051/src/test/java/org/apache/commons/text/lookup/DateStringLookupTest.java -- diff --git a/src/test/java/org/apache/commons/text/lookup/DateStringLookupTest.java b/src/test/java/org/apache/commons/text/lookup/DateStringLookupTest.java index 020baf3..7a46c94 100644 --- a/src/test/java/org/apache/commons/text/lookup/DateStringLookupTest.java +++ b/src/test/java/org/apache/commons/text/lookup/DateStringLookupTest.java @@ -40,7 +40,7 @@ public class DateStringLookupTest { public void testFormat() { final String fomat = "-MM-dd"; final String value = DateStringLookup.INSTANCE.lookup(fomat); -assertNotNull("No Date", value); +assertNotNull(value, "No Date"); final SimpleDateFormat format = new SimpleDateFormat(fomat); final String today = format.format(new Date()); assertEquals(value, today); http://git-wip-us.apache.org/repos/asf/commons-text/blob/9dd0e051/src/test/java/org/apache/commons/text/lookup/InterpolatorStringLookupTest.java -- diff --git a/src/test/java/org/apache/commons/text/lookup/InterpolatorStringLookupTest.java b/src/test/java/org/apache/commons/text/lookup/InterpolatorStringLookupTest.java index 595d20c..3954c5a 100644 --- a/src/test/java/org/apache/commons/text/lookup/InterpolatorStringLookupTest.java +++ b/src/test/java/org/apache/commons/text/lookup/InterpolatorStringLookupTest.java @@ -81,7 +81,7 @@ public class InterpolatorStringLookupTest { value = lookup.lookup("env:PATH"); assertNotNull(value); value = lookup.lookup("date:-MM-dd"); -assertNotNull("No Date", value); +assertNotNull(value, "No Date"); final SimpleDateFormat format = new SimpleDateFormat("-MM-dd"); final String today = format.format(new Date()); assertEquals(value, today);
[lang] (fix) Add missing @Test annotation
Repository: commons-lang Updated Branches: refs/heads/master d1e72ebed -> ce178d8e8 (fix) Add missing @Test annotation Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/ce178d8e Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/ce178d8e Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/ce178d8e Branch: refs/heads/master Commit: ce178d8e87ff6f9a12aea4b217c1e09254936236 Parents: d1e72eb Author: Eitan Adler Authored: Wed Aug 22 04:06:44 2018 -0700 Committer: Eitan Adler Committed: Wed Aug 22 04:07:44 2018 -0700 -- src/test/java/org/apache/commons/lang3/EnumUtilsTest.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/ce178d8e/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java b/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java index 7c732b2..2b9dc08 100644 --- a/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java @@ -407,6 +407,7 @@ public class EnumUtilsTest { EnumUtils.processBitVector(TooMany.class, 0L); } +@Test public void test_processBitVectors_longClass() { assertEquals(EnumSet.noneOf(TooMany.class), EnumUtils.processBitVectors(TooMany.class, 0L)); assertEquals(EnumSet.of(TooMany.A), EnumUtils.processBitVectors(TooMany.class, 1L));
[text] WordUtils: fix typo: occured -> occurred
Repository: commons-text Updated Branches: refs/heads/master 4464ac019 -> 5ee933190 WordUtils: fix typo: occured -> occurred Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/5ee93319 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/5ee93319 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/5ee93319 Branch: refs/heads/master Commit: 5ee9331907760eea9c5d74e642d68475e99bffd4 Parents: 4464ac0 Author: Eitan Adler Authored: Fri Aug 17 23:29:46 2018 -0700 Committer: Eitan Adler Committed: Fri Aug 17 23:29:46 2018 -0700 -- src/main/java/org/apache/commons/text/WordUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/5ee93319/src/main/java/org/apache/commons/text/WordUtils.java -- diff --git a/src/main/java/org/apache/commons/text/WordUtils.java b/src/main/java/org/apache/commons/text/WordUtils.java index 4cd078c..91e4ff8 100644 --- a/src/main/java/org/apache/commons/text/WordUtils.java +++ b/src/main/java/org/apache/commons/text/WordUtils.java @@ -859,7 +859,7 @@ public class WordUtils { final int index = StringUtils.indexOf(str, " ", lower); if (index == -1) { result.append(str, 0, upper); -// only if abbreviation has occured do we append the appendToEnd value +// only if abbreviation has occurred do we append the appendToEnd value if (upper != str.length()) { result.append(StringUtils.defaultString(appendToEnd)); }