[GitHub] commons-lang issue #354: Convert tests for Validate.isTrue overloads to @Nes...

2018-09-06 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/354
  
Build failure seems to be unrelated.


---


[GitHub] commons-lang issue #354: Convert tests for Validate.isTrue overloads to @Nes...

2018-09-06 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/354
  
Okay, as there is positive feedback for this change, I'm going to migrate 
the whole `ValidateTest` to this style and then merge it 👍 


---


[GitHub] commons-lang issue #355: Use @ParameterizedTest to iterate over available lo...

2018-09-06 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/355
  
I'm going to reach out to the JUnit maintainers to find out whether we can 
even inject zone values via parameter source.


---


[GitHub] commons-lang pull request #355: Use @ParameterizedTest to iterate over avail...

2018-09-05 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/355

Use @ParameterizedTest to iterate over available locales



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang 
parameterized-FastDateParser_TimeZoneStrategyTest

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/355.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #355


commit 7e440785d9ccdafc84ae7a50022097dc3dd422e8
Author: Benedikt Ritter 
Date:   2018-09-05T13:58:27Z

Use @ParameterizedTest to iterate over available locales




---


[GitHub] commons-lang issue #354: Convert tests for Validate.isTrue overloads to @Nes...

2018-09-05 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/354
  
@kinow @PascalSchumacher @chtompki WDYT?


---


[GitHub] commons-lang pull request #354: Convert tests for Validate.isTrue overloads ...

2018-09-05 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/354

Convert tests for Validate.isTrue overloads to @Nested test

Proposal for a better structure of tests using `@Nested`. Each method 
should have it's own `@Nested` container which is called like the method. 
Inside that container each overload has it's own `@Nested` container. I did 
this for `Validate.isTrue` to show the approach.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang nested-validate-test

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/354.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #354


commit aad2db8b12b8c61556df9df7de4fadc927633504
Author: Benedikt Ritter 
Date:   2018-09-05T12:26:25Z

Convert tests for Validate.isTrue overloads to @Nested test




---


[GitHub] commons-lang issue #353: WIP: LANG-1416: Update tests to JUnit5 via @boyarsk...

2018-09-04 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/353
  
In general it's hard to review gigantic change sets which have been created 
automatically, so I'd welcome an approach where we migrate one test case after 
another.


---


[GitHub] commons-lang issue #353: WIP: LANG-1416: Update tests to JUnit5 via @boyarsk...

2018-09-04 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/353
  
It looks like an approach that can potentially some some work. I personally 
would do it by hand. There is a lot of stuff that can't be detected 
automatically. For example we have some tests that run for loops. Those could 
be converted to be parameterized.


---


[GitHub] commons-lang pull request #352: LANG-1416: Update to JUnit 5

2018-09-04 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/352

LANG-1416: Update to JUnit 5

- Add dependencies required for JUnit 5
- Update one test (ValidateTest) to use the JUnit 5 test API

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1416

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/352.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #352


commit 83b472b754df1d4f8392490296d2467be7ce8855
Author: Benedikt Ritter 
Date:   2018-09-04T09:30:17Z

LANG-1416: Update to JUnit 5.3.0

commit 2bcf86d8af125b45d39bd1d43b8375911c551d78
Author: Benedikt Ritter 
Date:   2018-09-04T09:30:39Z

LANG-1416: Update ValidateTest to JUnit 5 API

commit 3287f3100f5940c254130192fb442077755477f6
Author: Benedikt Ritter 
Date:   2018-09-04T13:07:47Z

LANG-1416: Use latest Apache Maven Surefire Plugin release




---


[GitHub] commons-lang pull request #351: LANG-1417: Add @FunctionalInterface to Threa...

2018-09-04 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/351

LANG-1417: Add @FunctionalInterface to ThreadPredicate and ThreadGrou…

…pPredicate

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1417

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/351.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #351


commit 54f8d3c02abe04765ffe957e7d412bde2adf58c1
Author: Benedikt Ritter 
Date:   2018-09-04T09:16:55Z

LANG-1417: Add @FunctionalInterface to ThreadPredicate and 
ThreadGroupPredicate




---


[GitHub] commons-lang pull request #349: LANG-1417: Deprecate ThreadPredicate and Thr...

2018-09-04 Thread britter
Github user britter closed the pull request at:

https://github.com/apache/commons-lang/pull/349


---


[GitHub] commons-lang issue #349: LANG-1417: Deprecate ThreadPredicate and ThreadGrou...

2018-09-04 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/349
  
We agreed to just add `@FunctionalInterface` to `ThreadPredicate` and 
`ThreadGroupPredicate`


---


[GitHub] commons-lang issue #349: LANG-1417: Deprecate ThreadPredicate and ThreadGrou...

2018-08-28 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/349
  
Build is failing on Travis but not locally... 🤔 


---


[GitHub] commons-lang issue #349: LANG-1417: Deprecate ThreadPredicate and ThreadGrou...

2018-08-28 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/349
  
In this proposal I added the java.util.function.Predicate APIs to the 
ThreadUtils class. Another option is to deprecate ThreadUtils all together and 
put a new ThreadUtils class alongside which only hat the new APIs.


---


[GitHub] commons-lang pull request #349: LANG-1417: Deprecate ThreadPredicate and Thr...

2018-08-28 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/349

LANG-1417: Deprecate ThreadPredicate and ThreadGroupPredicate in favo…

…r of java.util.function.Predicate

I don't see a way to let ThreadGroupPredicate and ThreadPredicate inherit 
from java.util.function.Predicate. See my comment in 
[LANG-1417](https://issues.apache.org/jira/browse/LANG-1417). @salyh as author 
of the initial implementation, can you have a look please? Am I missing 
something?

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1417

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/349.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #349


commit a5a3b374b1f1ef0c7b7746e58a0dde19303e4492
Author: Benedikt Ritter 
Date:   2018-08-28T08:22:40Z

LANG-1417: Deprecate ThreadPredicate and ThreadGroupPredicate in favor of 
java.util.function.Predicate




---


[GitHub] commons-lang pull request #348: Explicit type parameters can be removed

2018-08-24 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/348

Explicit type parameters can be removed



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang remove-type-parameters

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/348.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #348


commit f013141f60df0bbbd57388c7bdd01a764ddfc1fd
Author: Benedikt Ritter 
Date:   2018-08-24T13:37:52Z

Explicit type parameters can be removed




---


[GitHub] commons-lang pull request #347: Looks like Java 11 no longer fails the build

2018-08-23 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/347

Looks like Java 11 no longer fails the build

Remove the allow_failures section for Java 11.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang java-11-build-passes

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/347.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #347


commit c696955b2ad1198d019f89df8578f660b41c421a
Author: Benedikt Ritter 
Date:   2018-08-23T17:20:21Z

Looks like Java 11 no longer fails the build




---


[GitHub] commons-lang pull request #346: LANG-1415: Update Java Language requirement ...

2018-08-22 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/346

LANG-1415: Update Java Language requirement to 1.8



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1415

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/346.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #346


commit b4609c81e41d678cf03898a7cc4a4660beef0f88
Author: Benedikt Ritter 
Date:   2018-08-23T06:25:27Z

LANG-1415: Update Java Language requirement to 1.8




---


[GitHub] commons-lang pull request #343: LANG-1341 update java doc to clarify use cas...

2018-08-20 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/343#discussion_r211340995
  
--- Diff: src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java 
---
@@ -25,10 +29,6 @@
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.ClassUtils;
-import org.apache.commons.lang3.tuple.Pair;
-
--- End diff --

Please don't reorganize imports


---


[GitHub] commons-lang pull request #343: LANG-1341 update java doc to clarify use cas...

2018-08-20 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/343#discussion_r211342005
  
--- Diff: src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java 
---
@@ -58,14 +58,17 @@
  *   }
  *   MyClass rhs = (MyClass) obj;
  *   return new EqualsBuilder()
- * .appendSuper(super.equals(obj))
  * .append(field1, rhs.field1)
  * .append(field2, rhs.field2)
  * .append(field3, rhs.field3)
  * .isEquals();
  *  }
  * 
  *
+ * 
+ * If required, the superclass appendSuper() can be added 
using {@link #appendSuper}.
+ * 
--- End diff --

The issues also suggested to add some documentation to 
`appendSuper(boolean)` making clear the implications of calling 
`super.equals(object)` when the class is a direct subclass ob 
`java.lang.Object`. I think we should add this.


---


[GitHub] commons-lang pull request #343: LANG-1341 update java doc to clarify use cas...

2018-08-20 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/343#discussion_r211341588
  
--- Diff: src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java 
---
@@ -58,14 +58,17 @@
  *   }
  *   MyClass rhs = (MyClass) obj;
  *   return new EqualsBuilder()
- * .appendSuper(super.equals(obj))
  * .append(field1, rhs.field1)
  * .append(field2, rhs.field2)
  * .append(field3, rhs.field3)
  * .isEquals();
  *  }
  * 
  *
+ * 
+ * If required, the superclass appendSuper() can be added 
using {@link #appendSuper}.
--- End diff --

Better use a JavaDoc Link here: `{@link #appendSuper(boolean)}`


---


[GitHub] commons-lang pull request #341: Update maven-pmd-plugin to latest version

2018-08-16 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/341

Update maven-pmd-plugin to latest version

Just a tiny change to show everybody I'm still alive :o)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang update-pmd-plugin

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/341.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #341


commit 30fed5ecb02386cdfbb84ab76149133203ae3d35
Author: Benedikt Ritter 
Date:   2018-08-16T14:25:43Z

Update maven-pmd-plugin to latest version




---


[GitHub] commons-lang issue #299: Add module-info for Java 9

2017-10-27 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/299
  
I'll bring this up a last time on the ML to make sure nobody has objections 
against merging this.


---


[GitHub] commons-lang issue #275: [WIP] LANG-1339: replace java.beans.PropertyListene...

2017-10-22 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/275
  
Removing the dependency in 4.x is the way to go. I don't see a way to get 
this into 3.x :-(


---


[GitHub] commons-lang issue #301: Clean up EventUtilsTest

2017-10-22 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/301
  
Thank you!

Don't forget to have a look at CONTRIBUTING.md. If you intend to contribute 
on a regular basis, it would be great if you could sign an Indivicual 
Contributor License Agreement.


---


[GitHub] commons-lang pull request #301: Clean up EventUtilsTest

2017-10-21 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/301#discussion_r146108051
  
--- Diff: src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java 
---
@@ -135,9 +129,9 @@ public void testBindFilteredEventsToMethod() {
 final EventCounter counter = new EventCounter();
 EventUtils.bindEventsToMethod(counter, "eventOccurred", src, 
MultipleEventListener.class, "event1");
 assertEquals(0, counter.getCount());
-src.listeners.fire().event1(new PropertyChangeEvent(new Date(), 
"Day", Integer.valueOf(0), Integer.valueOf(1)));
+src.listeners.fire().event1(new PropertyChangeEvent(new Date(), 
"Day", 0, 1));
--- End diff --

We prefer explicit boxing of primitve values.


---


[GitHub] commons-lang issue #302: Remove ObjectUtils' trailing white spaces

2017-10-21 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/302
  
Thank you!


---


[GitHub] commons-lang pull request #299: Add module-info for Java 9

2017-10-14 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/299#discussion_r144693421
  
--- Diff: .travis.yml ---
@@ -17,12 +17,10 @@ language: java
 sudo: false
 
 jdk:
-  - openjdk7
--- End diff --

I think we should discuss this on the developer mailing list.


---


[GitHub] commons-lang issue #299: Add module-info for Java 9

2017-10-10 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/299
  
Awesome! Would be create if you could create and reference a JIRA ticket as 
described in CONTRIBUTING.md, so this will show up in our release notes.


---


[GitHub] commons-lang issue #290: Added string methods

2017-09-26 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/290
  
I agree with @garydgregory. @chtompki WDYT?


---


[GitHub] commons-lang issue #268: .travis.yml: add oraclejdk9

2017-06-12 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/268
  
Travis build failed. Any idea why? Java 8 has an heap space error, while 
the Java 9 build reports an unrecognized VM option.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #270: LANG-1338: Add Automatic-Module-Name MANIFES...

2017-06-07 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/270

LANG-1338: Add Automatic-Module-Name MANIFEST entry for Java 9 
compatibility.

This change duplicates the maven-jar-plugin configuration from parent
pom. After we have implemented a solution for this in parent pom, this
commit should be reverted.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1338

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/270.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #270






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #269: LANG-1337: Fix test failures in IBM JDK 8 fo...

2017-06-07 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/269#discussion_r120549733
  
--- Diff: 
src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java ---
@@ -316,7 +317,7 @@ public void testReflectionHierarchyArrayList() {
 // 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);
-final List list = new ArrayList<>();
+final List list = new 
ArrayList<>(arraylistInitialCapacity);
--- End diff --

Sorry to be nitpicking, but this should be a constant and wie should add a 
comment referencing JIRA-1337 with an explanation why we need to pass the 
initial capacity.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #:

2017-04-18 Thread britter
Github user britter commented on the pull request:


https://github.com/apache/commons-lang/commit/dfecbe970917754511a081f8b86efac211e624f6#commitcomment-21813145
  
Thank you! :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #216: Fix non-critical typos in comments and JavaDoc

2016-11-23 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/216
  
Great, thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #214: Fix typos in comments and javadoc.

2016-11-22 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/214
  
Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #213: LANG-1288: Add a builder to StringEscapeUtil...

2016-11-22 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/213#discussion_r89192411
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
   super();
 }
 
+/**
+ * Convenience wrapper for {@link java.lang.StringBuilder} 
providing escape methods.
+ *
+ * Example:
+ * 
+ * new Builder(ESCAPE_HTML4)
+ *  .append("<p>")
+ *  .escape("This is paragraph 1 and special chars like & get 
escaped.")
+ *  .append("</p><p>")
+ *  .escape("This is paragraph 2 & more...")
+ *  .append("</p>")
+ *  .toString()
+ * 
+ * 
+ * @since 3.6
+ */
+public static class Builder {
+
+private final StringBuilder sb;
+private final CharSequenceTranslator translator;
+
+public Builder(final CharSequenceTranslator translator) {
--- End diff --

This is true for `BasicThreadFactory.Builder` which has to be constructed 
using the default constructor (yiaks) but not for 
`TypeUtils.WildcardTypeBuilder` which has static factory methods and a private 
constructor. I prefer the latter approach.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #208: LANG-1066: Add shell/XSI escape/unescape sup...

2016-11-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/208#discussion_r88777893
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -413,6 +447,47 @@ public int translate(final CharSequence input, final 
int index, final Writer out
 }
 }
 
+public static final CharSequenceTranslator UNESCAPE_XSI = new 
BackslashUnescaper();
+
+/**
+ * Translator object for unescaping backslash escaped entries.
+ *
+ * @since 3.6
+ */
+static class BackslashUnescaper extends CharSequenceTranslator {
--- End diff --

Why not XsiUnescaper?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #208: LANG-1066: Add shell/XSI escape/unescape sup...

2016-11-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/208#discussion_r88777926
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -801,4 +876,61 @@ public static final String unescapeCsv(final String 
input) {
 return UNESCAPE_CSV.translate(input);
 }
 
+// Shell
+/**
+ * Escapes the characters in a {@code String} using XSI rules.
+ *
+ * Beware! In most cases you don't want to escape shell 
commands but use multi-argument
+ * methods provided by {@link java.lang.ProcessBuilder} or {@link 
java.lang.Runtime#exec(String[])}
+ * instead.
+ *
+ * Example:
+ * 
+ * input string: He didn't say, "Stop!"
+ * output string: He\ didn\'t\ say,\ \"Stop!\"
+ * 
+ *
+ * @see http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html";>Shell 
Command Language
+ * @param input  String to escape values in, may be null
+ * @return String with escaped values, {@code null} if null string 
input
+ * @since 3.6
+ */
+public static final String escapeXSI(final String input) {
+return ESCAPE_XSI.translate(input);
+}
+
+/**
+ * Alias for {@link #escapeXSI(String)}.
+ *
+ * @param input String to escape values in, may be null
+ * @return String with escaped values, {@code null} if null string 
input
+ * @since 3.6
+ */
+public static final String escapeShell(final String input) {
--- End diff --

I'm not sure whether it is a good idea to have aliases for methods. Does 
this help users to find what they are looking for or does this really cause 
confusion?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #208: LANG-1066: Add shell/XSI escape/unescape sup...

2016-11-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/208#discussion_r88777887
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -272,6 +272,40 @@ public int translate(final CharSequence input, final 
int index, final Writer out
 }
 }
 
+/**
+ * Translator object for escaping Shell command language.
+ *
+ * @see http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html";>Shell 
Command Language
+ */
+public static final CharSequenceTranslator ESCAPE_XSI =
+  new LookupTranslator(
+new String[][] {
+  {"|", "\\|"},
+  {"&", "\\&"},
+  {";", "\\;"},
+  {"<", "\\<"},
+  {">", "\\>"},
+  {"(", "\\("},
+  {")", "\\)"},
+  {"$", "\\$"},
+  {"`", "\\`"},
+  {"\\", ""},
+  {"\"", "\\\""},
+  {"'", "\\'"},
+  {" ", "\\ "},
+  {"\t", "\\\t"},
+  {"\r\n", ""},
+  {"\n", ""},
+  {"*", "\\*"},
+  {"?", "\\?"},
+  {"[", "\\["},
--- End diff --

What about the closing braked?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #213: LANG-1288: Add a builder to StringEscapeUtil...

2016-11-18 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/213#discussion_r88745033
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
   super();
 }
 
+/**
+ * Convenience wrapper for {@link java.lang.StringBuilder} 
providing escape methods.
+ *
+ * Example:
+ * 
+ * new Builder(ESCAPE_HTML4)
+ *  .append("<p>")
+ *  .escape("This is paragraph 1 and special chars like & get 
escaped.")
+ *  .append("</p><p>")
+ *  .escape("This is paragraph 2 & more...")
+ *  .append("</p>")
+ *  .toString()
+ * 
+ * 
+ * @since 3.6
+ */
+public static class Builder {
+
+private final StringBuilder sb;
--- End diff --

How about making it possible to pass in any `java.lang.Appendable` and use 
a `StringBuilder` as default value?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #213: LANG-1288: Add a builder to StringEscapeUtil...

2016-11-18 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/213#discussion_r88745694
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
   super();
 }
 
+/**
+ * Convenience wrapper for {@link java.lang.StringBuilder} 
providing escape methods.
+ *
+ * Example:
+ * 
+ * new Builder(ESCAPE_HTML4)
+ *  .append("<p>")
+ *  .escape("This is paragraph 1 and special chars like & get 
escaped.")
+ *  .append("</p><p>")
+ *  .escape("This is paragraph 2 & more...")
+ *  .append("</p>")
+ *  .toString()
+ * 
+ * 
+ * @since 3.6
+ */
+public static class Builder {
+
+private final StringBuilder sb;
--- End diff --

Actually, I'm now thinking that it may be good to have a real decorator for 
`Appendables` with decorates any `Appendable` by piping input to the append 
methods through the translator first. WDYT?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #213: LANG-1288: Add a builder to StringEscapeUtil...

2016-11-18 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/213#discussion_r88745531
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
   super();
 }
 
+/**
+ * Convenience wrapper for {@link java.lang.StringBuilder} 
providing escape methods.
+ *
+ * Example:
+ * 
+ * new Builder(ESCAPE_HTML4)
+ *  .append("<p>")
+ *  .escape("This is paragraph 1 and special chars like & get 
escaped.")
+ *  .append("</p><p>")
+ *  .escape("This is paragraph 2 & more...")
+ *  .append("</p>")
+ *  .toString()
+ * 
+ * 
+ * @since 3.6
+ */
+public static class Builder {
--- End diff --

Is `Builder` really a good name? It's more of a wrapper currently.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #213: LANG-1288: Add a builder to StringEscapeUtil...

2016-11-18 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/213#discussion_r88745205
  
--- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java ---
@@ -429,6 +429,65 @@ public StringEscapeUtils() {
   super();
 }
 
+/**
+ * Convenience wrapper for {@link java.lang.StringBuilder} 
providing escape methods.
+ *
+ * Example:
+ * 
+ * new Builder(ESCAPE_HTML4)
+ *  .append("<p>")
+ *  .escape("This is paragraph 1 and special chars like & get 
escaped.")
+ *  .append("</p><p>")
+ *  .escape("This is paragraph 2 & more...")
+ *  .append("</p>")
+ *  .toString()
+ * 
+ * 
+ * @since 3.6
+ */
+public static class Builder {
+
+private final StringBuilder sb;
+private final CharSequenceTranslator translator;
+
+public Builder(final CharSequenceTranslator translator) {
--- End diff --

I'd rather have a private constructor and then put a static factory method 
into `StringEscapeUtils` instead of having the inner class that one needs to 
construct like `new StringEscapeUtils.Builder(ESCAPE)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #196: site: Nav, javadoc now says GIT latest as opposed t...

2016-10-17 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/196
  
@chtompki we don' need jira for these kind of changes, since they do not 
affect the behavior of Commons Lang in any way. Feel free to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #192: Lang 1255: Add DateUtils.toCalendar(Date, TimeZone)...

2016-10-02 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/192
  
Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #194: add isAllBlank,isNotAllBlank method for String "nul...

2016-10-02 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/194
  
@wangdongxun thanks for this PR, but I don't see this as a feature in 
`StringUtils`. Can you elaborate some more what use case you have for this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #191: ToStringExcludeNullValue

2016-09-25 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/191
  
@amaral7 do you really want to configure this on a per field basis or would 
it be enough to add a configuration option to `ToStringBuilder` to configure 
the general behavior for all fields?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387226
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateNull() {
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown when Date is 
null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNotNull() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNull() {
+try {
+DateUtils.toCalendar(date1, null);
+fail("Expected NullPointerException to be thrown when TimeZone 
is null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithDateAndTimeZoneNotNull() {
+   Calendar c = DateUtils.toCalendar(date2, defaultZone);
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the Date back", date2, c.getTime());
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", defaultZone, c.getTimeZone());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateAndTimeZoneNull() {
+   try {
--- End diff --

you don't need a try-catch here. You can simply use 
`@Test(expected=NullPointerException.class)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387208
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateNull() {
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown when Date is 
null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNotNull() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
--- End diff --

This test is redundant because we have 
`testToCalendarWithDateAndTimeZoneNotNull()`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387206
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateNull() {
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown when Date is 
null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNotNull() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNull() {
+try {
--- End diff --

you don't need a try-catch here. You can simply use 
`@Test(expected=NullPointerException.class)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387223
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateNull() {
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown when Date is 
null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNotNull() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZoneNull() {
+try {
+DateUtils.toCalendar(date1, null);
+fail("Expected NullPointerException to be thrown when TimeZone 
is null");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithDateAndTimeZoneNotNull() {
+   Calendar c = DateUtils.toCalendar(date2, defaultZone);
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the Date back", date2, c.getTime());
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", defaultZone, c.getTimeZone());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateAndTimeZoneNull() {
+   try {
+   DateUtils.toCalendar(null, null);
--- End diff --

No tabs please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387200
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+}
+
+
//---
+@Test
+public void testToCalendarWithDateNull() {
+try {
--- End diff --

you don't need a try-catch here. You can simply use 
`@Test(expected=NullPointerException.class)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-25 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80387175
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,59 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDateNotNull() {
--- End diff --

This test is redundant because we have 
`testToCalendarWithDateAndTimeZoneNotNull()`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #189: new impl of LevenshteinDistance

2016-09-24 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/189
  
@kinow can you take the lead in reviewing this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-24 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80358050
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,43 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDate() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZone() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
+try {
+DateUtils.toCalendar(date1, null);
+fail("Expected NullPointerException to be thrown");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+  //---
+@Test
+public void testToCalendarWithDateAndTimeZone() {
+try {
+   Calendar c = DateUtils.toCalendar(date2, defaultZone);
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the Date back", date2, c.getTime());
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", defaultZone, c.getTimeZone());
--- End diff --

This looks redundant to me, since `testToCalendarWithDate()` already tests 
that the date has been set and `testToCalendarWithTimeZone()` already tests, 
that the timeZone has been set.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-24 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80357986
  
--- Diff: src/main/java/org/apache/commons/lang3/time/DateUtils.java ---
@@ -668,6 +668,19 @@ public static Calendar toCalendar(final Date date) {
 
 
//---
 /**
+ * Converts a {@code Date} of a given {@code TimeZone} into a {@code 
Calendar}
+ * @param date the date to convert to a Calendar
+ * @param timeZone the time zone of the @{code date}
+ * @return
--- End diff --

Missing JavaDoc


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #192: Lang 1255: Add DateUtils.toCalendar(Date, Ti...

2016-09-24 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/192#discussion_r80358033
  
--- Diff: src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java ---
@@ -693,6 +693,43 @@ public void testToCalendar() {
 // expected
 }
 }
+
+
//---
+@Test
+public void testToCalendarWithDate() {
+assertEquals("Convert Date and TimeZone to a Calendar, but failed 
to get the Date back", date1, DateUtils.toCalendar(date1, zone).getTime());
+try {
+DateUtils.toCalendar(null, zone);
+fail("Expected NullPointerException to be thrown");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+
//---
+@Test
+public void testToCalendarWithTimeZone() {
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", zone, DateUtils.toCalendar(date1, 
zone).getTimeZone());
+try {
+DateUtils.toCalendar(date1, null);
+fail("Expected NullPointerException to be thrown");
+} catch(final NullPointerException npe) {
+// expected
+}
+}
+
+  //---
+@Test
+public void testToCalendarWithDateAndTimeZone() {
+try {
+   Calendar c = DateUtils.toCalendar(date2, defaultZone);
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the Date back", date2, c.getTime());
+   assertEquals("Convert Date and TimeZone to a Calendar, but 
failed to get the TimeZone back", defaultZone, c.getTimeZone());
+   // expected
+} catch(final NullPointerException npe) {
+   fail("Expected NullPointerException to be thrown");
--- End diff --

I don't understand this code. Why is a `NullPointerException` expected at 
this point?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

2016-09-24 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/193#discussion_r80357934
  
--- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
@@ -358,6 +387,36 @@ public static boolean isAnyBlank(final CharSequence... 
css) {
 }
 
 /**
+ * Checks if any one of the CharSequences are not blank ("") or 
null and not whitespace only..
+ *
+ * 
+ * StringUtils.isAnyNotBlank(null) = false
+ * StringUtils.isAnyNotBlank(null, "foo")  = true
+ * StringUtils.isAnyNotBlank(null, null)   = false
+ * StringUtils.isAnyNotBlank("", "bar")= true
+ * StringUtils.isAnyNotBlank("bob", "")= true
+ * StringUtils.isAnyNotBlank("  bob  ", null)  = true
+ * StringUtils.isAnyNotBlank(" ", "bar")   = true
+ * StringUtils.isAnyNotBlank("foo", "bar") = false
+ * 
+ *
+ * @param css  the CharSequences to check, may be null or empty
+ * @return {@code true} if any of the CharSequences are not blank or 
null or whitespace only
+ * @since 3.5
+ */
+public static boolean isAnyNotBlank(final CharSequence... css) {
+  if (ArrayUtils.isEmpty(css)) {
+return true;
--- End diff --

See above


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #193: Add isAnyNotEmpty() and isAnyNotBlank() to S...

2016-09-24 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/193#discussion_r80357925
  
--- Diff: src/main/java/org/apache/commons/lang3/StringUtils.java ---
@@ -258,6 +258,35 @@ public static boolean isAnyEmpty(final CharSequence... 
css) {
 }
 
 /**
+ * Checks if any one of the CharSequences are not empty ("") or 
null.
+ *
+ * 
+ * StringUtils.isAnyNotEmpty(null) = false
+ * StringUtils.isAnyNotEmpty(null, "foo")  = true
+ * StringUtils.isAnyNotEmpty("", "bar")= true
+ * StringUtils.isAnyNotEmpty("bob", "")= true
+ * StringUtils.isAnyNotEmpty("  bob  ", null)  = true
+ * StringUtils.isAnyNotEmpty(" ", "bar")   = true
+ * StringUtils.isAnyNotEmpty("foo", "bar") = true
+ * 
+ *
+ * @param css  the CharSequences to check, may be null or empty
+ * @return {@code true} if any of the CharSequences are empty or null
+ * @since 3.5
+ */
+public static boolean isAnyNotEmpty(final CharSequence... css) {
+  if (ArrayUtils.isEmpty(css)) {
+return true;
--- End diff --

Shouldn't this return false? An empty Array does not contain any non empty 
CharSequences. WDYT?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #179: LANG-1023

2016-09-20 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/179#discussion_r79649084
  
--- Diff: src/main/java/org/apache/commons/lang3/text/WordUtils.java ---
@@ -172,6 +173,84 @@ public static String wrap(final String str, final int 
wrapLength) {
  * @return a line with newlines inserted, null if null 
input
  */
 public static String wrap(final String str, int wrapLength, String 
newLineStr, final boolean wrapLongWords) {
+return wrap(str, wrapLength, newLineStr, wrapLongWords, " ");
+}
+
+/**
+ * Wraps a single line of text, identifying words by ' 
'.
+ *
+ * Leading spaces on a new line are stripped.
+ * Trailing spaces are not stripped.
+ *
+ * 
+ *  
+ *   input
+ *   wrapLenght
+ *   newLineString
+ *   wrapLongWords
--- End diff --

The table is a column for the `wrapOn` parameter


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #179: LANG-1023

2016-09-20 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/179#discussion_r79648930
  
--- Diff: src/main/java/org/apache/commons/lang3/text/WordUtils.java ---
@@ -172,6 +173,84 @@ public static String wrap(final String str, final int 
wrapLength) {
  * @return a line with newlines inserted, null if null 
input
  */
 public static String wrap(final String str, int wrapLength, String 
newLineStr, final boolean wrapLongWords) {
+return wrap(str, wrapLength, newLineStr, wrapLongWords, " ");
+}
+
+/**
+ * Wraps a single line of text, identifying words by ' 
'.
--- End diff --

Should be `identifying word by wrapOn`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #188: LANG-1266 Add alphabet converter

2016-09-18 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/188
  
The issue has been moved to https://issues.apache.org/jira/browse/TEXT-19 
Please reference TEXT-19 in your PR against the Commons Text repository. Thank 
you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #187: LANG-1263 Add possibility to retrieve the current J...

2016-09-18 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/187
  
We already have `SystemUtils.isJavaVersionAtLeast(JavaVersion)` so there is 
no reason to add this API.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #187: LANG-1263 Add possibility to retrieve the cu...

2016-09-18 Thread britter
Github user britter closed the pull request at:

https://github.com/apache/commons-lang/pull/187


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #189: new impl of LevenshteinDistance

2016-09-14 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/189
  
Hello @yufcuy,

can you provide more information as to why you think this change is 
necessary? Does it improve performance properties? Do you have benchmarked the 
new implementation against the old implementation?

Regards,
Benedikt


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #163: LANG-1197: Prepare Java 9 detection (unfinished)

2016-09-12 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/163
  
No, it contains no fix for Java 9 at all :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #163: LANG-1197: Prepare Java 9 detection (unfinished)

2016-09-12 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/163
  
@PascalSchumacher but why? This was going in the right direction!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #187: LANG-1263 Add possibility to retrieve the current J...

2016-09-11 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/187
  
@PascalSchumacher I've changed the implementation to use the `IS_JAVA_XX` 
fields from `SystemUtils`. However, Java 9 detection is still broken, since it 
is broken in `SystemUtils`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #163: LANG-1197: Prepare Java 9 detection (unfinished)

2016-09-11 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/163
  
> Not complete: JavaVersion expects the java.version system property to 
return 1.x but for java 9 it will return 9*. Not sure how to handle this.

I think we should better work with `java.specification.version` here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #163: LANG-1197: Prepare Java 9 detection (unfinis...

2016-09-11 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/163#discussion_r78301302
  
--- Diff: src/main/java/org/apache/commons/lang3/JavaVersion.java ---
@@ -72,8 +72,15 @@
 
 /**
  * Java 1.9.
+ * 
+ * @deprecated As of release 3.5, replaced by {@link #JAVA_9}
+ */
+JAVA_1_9(1.9f, "9"),
+
+/**
+ * Java 9
  */
-JAVA_1_9(1.9f, "1.9"),
+JAVA_9(1.9f, "9"),
--- End diff --

I agree with Michael


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #187: LANG-1263 Add possibility to retrieve the cu...

2016-09-11 Thread britter
GitHub user britter opened a pull request:

https://github.com/apache/commons-lang/pull/187

LANG-1263 Add possibility to retrieve the current JavaVersion

Added a constant `CURRENT` to the `JavaVersion` enum which represents the 
JavaVersion for the `java.specification.version` system property. This allows 
for checks like this:

```java
if(JavaVersion.CURRENT.atLeast(JAVA_1_6) {
  // do something only possible in Java 1.6+
}
```

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/britter/commons-lang LANG-1263

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-lang/pull/187.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #187


commit 7c541954449659cf0bc8244ebf74d212cf7d9644
Author: Benedikt Ritter 
Date:   2016-09-11T15:25:24Z

Remove method which merely delegates to JavaVersion.get(String)

commit 71f1b05f085dde9867551c67bfbb03f584bf55aa
Author: Benedikt Ritter 
Date:   2016-09-11T15:26:24Z

Don't use wildcard imports

commit ef2e99772096885bf3302a617912d3519543d2b0
Author: Benedikt Ritter 
Date:   2016-09-11T15:47:53Z

Add missing @since tags to JavaVersion

commit 565bd90e5be3a93c07292ee35dccb76d960dbac6
Author: Benedikt Ritter 
Date:   2016-09-11T16:50:04Z

LANG-1263: Add possibility to retrieve the current JavaVersion.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #186: LANG-1252: rename isNumber, isCreatable. Accommodat...

2016-09-11 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/186
  
Please also add your change to `src/changes/changes.xml`. Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #186: LANG-1252: rename isNumber, isCreatable. Acc...

2016-09-11 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/186#discussion_r78298119
  
--- Diff: src/main/java/org/apache/commons/lang3/math/NumberUtils.java ---
@@ -1360,11 +1361,44 @@ public static boolean isDigits(final String str) {
  * null and empty/blank {@code String} will return
  * false.
  *
+ * Note, {@link #createNumber(String)} should return a number for 
every
+ * input resuling in true.
+ *
  * @param str  the String to check
  * @return true if the string is a correctly formatted 
number
- * @since 3.3 the code supports hex {@code 0Xhhh} and octal {@code 
0ddd} validation
+ * @since 3.3 the code supports hex {@code 0Xhhh} an
+ *octal {@code 0ddd} validation
+ * @deprecated This feature will be removed in Lang 4.0,
+ * use {@link NumberUtils#isCreatable(String)} instead
  */
+@Deprecated
 public static boolean isNumber(final String str) {
+return isCreatable(str);
+}
+
+/**
+ * Checks whether the String a valid Java number.
+ *
+ * Valid numbers include hexadecimal marked with the 
0x or
+ * 0X qualifier, octal numbers, scientific notation and
+ * numbers marked with a type qualifier (e.g. 123L).
+ *
+ * Non-hexadecimal strings beginning with a leading zero are
+ * treated as octal values. Thus the string 09 will return
+ * false, since 9 is not a valid octal value.
+ * However, numbers beginning with {@code 0.} are treated as 
decimal.
+ *
+ * null and empty/blank {@code String} will return
+ * false.
+ *
+ * Note, {@link #createNumber(String)} should return a number for 
every
+ * input resuling in true.
+ *
+ * @param str  the String to check
+ * @return true if the string is a correctly formatted 
number
+ * @since 3.3 the code supports hex {@code 0Xhhh} and octal {@code 
0ddd} validation
--- End diff --

should be changed to simply `@since 3.5`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #186: LANG-1252: rename isNumber, isCreatable. Acc...

2016-09-11 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/186#discussion_r78293625
  
--- Diff: src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java 
---
@@ -1216,91 +1217,104 @@ public void testIsDigits() {
 }
 
 /**
- * Tests isNumber(String) and tests that createNumber(String) returns
- * a valid number iff isNumber(String) returns false.
+ * Tests isCreatable(String) and tests that createNumber(String) 
returns
+ * a valid number iff isCreatable(String) returns false.
  */
 @Test
-public void testIsNumber() {
-compareIsNumberWithCreateNumber("12345", true);
--- End diff --

Don't remove this tests. Although we have deprecated `isNumber` we will 
probably have to maintain the code for a while before it can be dropped in Lang 
4.0


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request #186: LANG-1252: rename isNumber, isCreatable. Acc...

2016-09-11 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/186#discussion_r78293587
  
--- Diff: src/main/java/org/apache/commons/lang3/math/NumberUtils.java ---
@@ -1374,8 +1407,11 @@ public static boolean isNumber(final String str) {
 boolean hasDecPoint = false;
 boolean allowSigns = false;
 boolean foundDigit = false;
+boolean isJava6 = StringUtils.startsWith(
+System.getProperty("java.version"), "1.6");
--- End diff --

You can better use `SystemUtils`for this. But I'm about to extend 
`JavaVersion` in for 
[LANG-1263](https://issues.apache.org/jira/browse/LANG-1263) so that will make 
this even easier. I'll ping you when I have that finished.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #185: Fix ReflectionToStringBuilder toString javadoc

2016-09-06 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/185
  
Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #167: Fix typo in toMap javadoc

2016-06-24 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/167
  
Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang issue #9: Lang 4 x

2016-06-12 Thread britter
Github user britter commented on the issue:

https://github.com/apache/commons-lang/pull/9
  
@PascalSchumacher I think @lingeng1986 should take care of clearing the PR 
up so that it can be easily reviewed and applied.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Implementations of the circuit breaker ...

2016-05-27 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/95#issuecomment-222085429
  
@oheger @PascalSchumacher: Nobody objected adding it to the concurrent 
package. So from PoV it can be integrated into LANG.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Multiline recursive to string style

2015-11-04 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/34#issuecomment-153749334
  
It has already been made public. The change will be released in 3.5, 
probably before the end of the year.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Add sugar to RandomIUtils

2015-10-28 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/111#issuecomment-151862191
  
@Punkratz312 I don't have a date for you. But I think I'll have some time 
in Nov/Dec to push out a release.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request:

2015-10-20 Thread britter
Github user britter commented on the pull request:


https://github.com/apache/commons-lang/commit/131917a0d3303ca2c38fd1d6765b9bed2c23ff89#commitcomment-13893327
  
In src/test/java/org/apache/commons/lang3/StringUtilsTest.java:
In src/test/java/org/apache/commons/lang3/StringUtilsTest.java on line 2394:
JUnit tests should never write to std out, because that will obscure test 
reports generated by tools like maven. When running `mvn test` all you want to 
see is whether all tests have passed or not.

Further more in this case you've already made explicit which methods are 
excluded by defining the `excludeMethods` array.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/112#issuecomment-149324877
  
Looks good to me now. Feel free to merge to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/112#discussion_r42416452
  
--- Diff: src/assembly/src.xml ---
@@ -32,7 +32,6 @@
 pom.xml
 PROPOSAL.html
 RELEASE-NOTES.txt
-build.xml
 default.properties
--- End diff --

Should also be dropped


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/112#issuecomment-149307896
  
Looks good to me. But we should also drop:
* default.properties
* src/release-tools (it also depends on the main ant build)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/112#discussion_r42408499
  
--- Diff: src/changes/changes.xml ---
@@ -22,6 +22,7 @@
   
 
   
+Remove Ant-based build
--- End diff --

Copy and paste error. Should be `due-to`. I've corrected this for the other 
lines.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/112#discussion_r42408375
  
--- Diff: .gitignore ---
@@ -4,6 +4,7 @@ target
 maven-eclipse.xml
 build.properties
--- End diff --

Can be dropped from .gitignore


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1175: removed ant-based build

2015-10-19 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/112#discussion_r42408346
  
--- Diff: .gitignore ---
@@ -4,6 +4,7 @@ target
 maven-eclipse.xml
 build.properties
 site-content
+*~
--- End diff --

What does this mean?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Add sugar to RandomIUtils

2015-10-17 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/111#issuecomment-148897047
  
Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1146 Add helper method to SystemUt...

2015-07-08 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/103#issuecomment-119846022
  
Hello @gliptak,

sorry for the delay. There are a lot of pending PRs but I don't have time 
for OSS at the moment :-( I'll have a look as soon as I have more time again.

Benedikt


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: fix StringUtils.ordinalIndexOf("aaaaaa"...

2015-06-15 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/93#issuecomment-112310767
  
Shouldn't this result in ` StringUtils.ordinalIndexOf("aa", "aa", 2) == 
1` because the sequence 'aa' is at every index?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: fix StringUtils.ordinalIndexOf("aaaaaa"...

2015-06-15 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/93#discussion_r32494469
  
--- Diff: 
src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java ---
@@ -16,19 +16,16 @@
  */
 package org.apache.commons.lang3;
 
-import static org.junit.Assert.assertEquals;
--- End diff --

Please don't reorganize imports.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: RFC: provide support for generating ran...

2015-06-15 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/94#issuecomment-112309707
  
Can you describe a use case for this functionality?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: RFC: provide support for generating ran...

2015-06-15 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/94#discussion_r32494411
  
--- Diff: src/main/java/org/apache/commons/lang3/RandomStringUtils.java ---
@@ -95,6 +95,21 @@ public static String randomAscii(final int count) {
 public static String randomAlphabetic(final int count) {
 return random(count, true, false);
 }
+
+/**
+ * Creates a random string whose length is the number of characters
+ * specified.
--- End diff --

Dosn't exactly describe what the method does. More like `Creates a random 
string of length between minLength and maxLength`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: RFC: provide support for generating ran...

2015-06-15 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/94#discussion_r32494301
  
--- Diff: src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java 
---
@@ -16,18 +16,18 @@
  */
 package org.apache.commons.lang3;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.Test;
--- End diff --

Please don't reorganize imports.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: LANG-1124: Add StringUtils split by len...

2015-05-17 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/75#issuecomment-102940510
  
@rikles thank you for your thorough feedback. Give me some time to go 
through your comments. I'll have time to have a look later this week.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Lang 1134

2015-05-17 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/87#issuecomment-102938770
  
@Lady-Stardust, what is the name you want to be listed with in 
[changes.xml](https://github.com/apache/commons-lang/blob/master/src/changes/changes.xml)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Lang 1134

2015-05-17 Thread britter
Github user britter commented on the pull request:

https://github.com/apache/commons-lang/pull/87#issuecomment-102938179
  
Very nice, I'll have a look later this week!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] commons-lang pull request: Lang 1134

2015-05-13 Thread britter
Github user britter commented on a diff in the pull request:

https://github.com/apache/commons-lang/pull/87#discussion_r30207724
  
--- Diff: src/main/java/org/apache/commons/lang3/Validate.java ---
@@ -874,7 +888,752 @@ public static void matchesPattern(final CharSequence 
input, final String pattern
 throw new IllegalArgumentException(String.format(message, 
values));
 }
 }
-
+
+// notNaN
+
//-
+
+/**
+ * Validates that the specified argument is not {@code NaN}; 
otherwise
+ * throwing an exception.
+ * 
+ * Validate.notNaN(myDouble);
+ * 
+ * The message of the exception is "The validated value is not 
a 
+ * number".
+ * 
+ * @param value  the value to validate
+ * @throws IllegalArgumentException if the value is not a number
+ * @see #notNaN(double, java.lang.String, java.lang.Object...) 
+ * 
+ * @since 3.4
+ */
+public static void notNaN(final double value) {
+notNaN(value, DEFAULT_NOT_NAN_EX_MESSAGE);
+}
+
+/**
+ * Validates that the specified argument is not {@code NaN}; 
otherwise
+ * throwing an exception with the specified message.
+ * 
+ * Validate.notNaN(myDouble, "The value must be a number");
+ *
+ * @param value  the value to validate
+ * @param message  the {@link String#format(String, Object...)} 
exception message if invalid, not null
+ * @param values  the optional values for the formatted exception 
message
+ * @throws IllegalArgumentException if the value is not a number
+ * @see #notNaN(double) 
+ * 
+ * @since 3.4
+ */
+public static void notNaN(final double value, final String message, 
final Object... values) {
+if (value != value) {
--- End diff --

Hello @Lady-Stardust,

calling a method is not that expensive (approximately 2ns), so we can live 
with that ;-)

You can simply add more commits to your branch and github will update the 
PR when you push your changes to your fork. Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   >