[jira] [Resolved] (COMPRESS-326) Fix threading issue in X5455_ExtendedTimestampTest test class (a test for COMPRESS-210)

2015-10-23 Thread Stefan Bodewig (JIRA)

 [ 
https://issues.apache.org/jira/browse/COMPRESS-326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Bodewig resolved COMPRESS-326.
-
   Resolution: Fixed
Fix Version/s: 1.11

test should be fixed with commit a2cda30

> Fix threading issue in X5455_ExtendedTimestampTest test class (a test for 
> COMPRESS-210)
> ---
>
> Key: COMPRESS-326
> URL: https://issues.apache.org/jira/browse/COMPRESS-326
> Project: Commons Compress
>  Issue Type: Bug
>Reporter: Konstantin Kolinko
> Fix For: 1.11
>
>
> The test for COMPRESS-210 is currently failing when Compress is built at 
> Apache Gump.
> http://vmgump.apache.org/gump/public/commons-compress/commons-compress-test/index.html
> It says that the last success was on 2015-10-06T00:00:09,
> it started failing at  2015-10-06T12:00:09
> and as of now the failure state is persistent for 22 runs (which means ~11 
> days).
> The failure:
> {noformat}
> [INFO] 
> 
> [INFO] Building Apache Commons Compress 1.11-SNAPSHOT
> [INFO] 
> 
> <...>
> Running org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.054 sec <<< 
> FAILURE! - in 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> testSampleFile(org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest)
>   Time elapsed: 0.027 sec  <<< FAILURE!
> org.junit.ComparisonFailure: expected:<2105-01-01/0[0:00:02] +> but 
> was:<2105-01-01/0[8:00:01] +>
>   at org.junit.Assert.assertEquals(Assert.java:116)
>   at org.junit.Assert.assertEquals(Assert.java:145)
>   at 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest.testSampleFile(X5455_ExtendedTimestampTest.java:171)
> {noformat}
> Reviewing rhe code of the test class, its usage of `SimpleDateFormat 
> DATE_FORMAT` field is wrong. The field is declared as "static". A 
> SimpleDateFormat is not thread-safe, so it must not be shared between tests, 
> as some testing configurations may run several tests in parallel.
> A simple fix will be to remove "static" from declaration of that field and 
> its initialization block, so that each running instance of the test gets its 
> own copy of SimpleDateFormat class.
> (I am not sure whether this bug is the actual cause of the test failure. I do 
> not see any reconfigurations of test environment on 2015-10-06. *Update*: 
> according to gump-general mailing list \[1], on Oct 06 the Java runtime used 
> to run Gump was updated to the latest Java 8 release)
> \[1] 
> http://mail-archives.apache.org/mod_mbox/gump-general/201510.mbox/%3C5613A448.8040109%40apache.org%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (COMPRESS-326) Fix threading issue in X5455_ExtendedTimestampTest test class (a test for COMPRESS-210)

2015-10-23 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972416#comment-14972416
 ] 

Stefan Bodewig edited comment on COMPRESS-326 at 10/24/15 5:42 AM:
---

I think I've tracked it down.

Traditionally Java's {{ZipEntry#getTime}} returned the {{lastModifiedTime}} 
from the archive entry's header directly - this is why we adjust the time to 
the local time zone just like InfoZIP would do since the test archive has been 
written by InfoZIP's zip.

Then came http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/90df6756406f which 
changes the logic of {{ZipEntry#getTime}} and now uses additional time fields 
InfoZIP or Microsoft's Compressed Folders feature would use in order to get a 
better result.  I haven't tracked down which Java8 update has been the first 
one to receive the patch.

I'll try to adjust the test.


was (Author: bodewig):
I think I've tracked it down.

Traditionally Java's {{ZipEntry#getTime}} returned the {{astModifiedTime}} from 
the archive entry's header directly - this is why we adjust the time to the 
local time zone just like InfoZIP would do since the test archive has been 
written by InfoZIP's zip.

Then came http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/90df6756406f which 
changes the logic of {{ZipEntry#getTime}} and now uses additional time fields 
InfoZIP or Microsoft's Compressed Folders feature would use in order to get a 
better result.  I haven't tracked down which Java8 update has been the first 
one to receive the patch.

I'll try to adjust the test.

> Fix threading issue in X5455_ExtendedTimestampTest test class (a test for 
> COMPRESS-210)
> ---
>
> Key: COMPRESS-326
> URL: https://issues.apache.org/jira/browse/COMPRESS-326
> Project: Commons Compress
>  Issue Type: Bug
>Reporter: Konstantin Kolinko
>
> The test for COMPRESS-210 is currently failing when Compress is built at 
> Apache Gump.
> http://vmgump.apache.org/gump/public/commons-compress/commons-compress-test/index.html
> It says that the last success was on 2015-10-06T00:00:09,
> it started failing at  2015-10-06T12:00:09
> and as of now the failure state is persistent for 22 runs (which means ~11 
> days).
> The failure:
> {noformat}
> [INFO] 
> 
> [INFO] Building Apache Commons Compress 1.11-SNAPSHOT
> [INFO] 
> 
> <...>
> Running org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.054 sec <<< 
> FAILURE! - in 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> testSampleFile(org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest)
>   Time elapsed: 0.027 sec  <<< FAILURE!
> org.junit.ComparisonFailure: expected:<2105-01-01/0[0:00:02] +> but 
> was:<2105-01-01/0[8:00:01] +>
>   at org.junit.Assert.assertEquals(Assert.java:116)
>   at org.junit.Assert.assertEquals(Assert.java:145)
>   at 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest.testSampleFile(X5455_ExtendedTimestampTest.java:171)
> {noformat}
> Reviewing rhe code of the test class, its usage of `SimpleDateFormat 
> DATE_FORMAT` field is wrong. The field is declared as "static". A 
> SimpleDateFormat is not thread-safe, so it must not be shared between tests, 
> as some testing configurations may run several tests in parallel.
> A simple fix will be to remove "static" from declaration of that field and 
> its initialization block, so that each running instance of the test gets its 
> own copy of SimpleDateFormat class.
> (I am not sure whether this bug is the actual cause of the test failure. I do 
> not see any reconfigurations of test environment on 2015-10-06. *Update*: 
> according to gump-general mailing list \[1], on Oct 06 the Java runtime used 
> to run Gump was updated to the latest Java 8 release)
> \[1] 
> http://mail-archives.apache.org/mod_mbox/gump-general/201510.mbox/%3C5613A448.8040109%40apache.org%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (COMPRESS-326) Fix threading issue in X5455_ExtendedTimestampTest test class (a test for COMPRESS-210)

2015-10-23 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972416#comment-14972416
 ] 

Stefan Bodewig commented on COMPRESS-326:
-

I think I've tracked it down.

Traditionally Java's {{ZipEntry#getTime}} returned the {{astModifiedTime}} from 
the archive entry's header directly - this is why we adjust the time to the 
local time zone just like InfoZIP would do since the test archive has been 
written by InfoZIP's zip.

Then came http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/90df6756406f which 
changes the logic of {{ZipEntry#getTime}} and now uses additional time fields 
InfoZIP or Microsoft's Compressed Folders feature would use in order to get a 
better result.  I haven't tracked down which Java8 update has been the first 
one to receive the patch.

I'll try to adjust the test.

> Fix threading issue in X5455_ExtendedTimestampTest test class (a test for 
> COMPRESS-210)
> ---
>
> Key: COMPRESS-326
> URL: https://issues.apache.org/jira/browse/COMPRESS-326
> Project: Commons Compress
>  Issue Type: Bug
>Reporter: Konstantin Kolinko
>
> The test for COMPRESS-210 is currently failing when Compress is built at 
> Apache Gump.
> http://vmgump.apache.org/gump/public/commons-compress/commons-compress-test/index.html
> It says that the last success was on 2015-10-06T00:00:09,
> it started failing at  2015-10-06T12:00:09
> and as of now the failure state is persistent for 22 runs (which means ~11 
> days).
> The failure:
> {noformat}
> [INFO] 
> 
> [INFO] Building Apache Commons Compress 1.11-SNAPSHOT
> [INFO] 
> 
> <...>
> Running org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.054 sec <<< 
> FAILURE! - in 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest
> testSampleFile(org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest)
>   Time elapsed: 0.027 sec  <<< FAILURE!
> org.junit.ComparisonFailure: expected:<2105-01-01/0[0:00:02] +> but 
> was:<2105-01-01/0[8:00:01] +>
>   at org.junit.Assert.assertEquals(Assert.java:116)
>   at org.junit.Assert.assertEquals(Assert.java:145)
>   at 
> org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestampTest.testSampleFile(X5455_ExtendedTimestampTest.java:171)
> {noformat}
> Reviewing rhe code of the test class, its usage of `SimpleDateFormat 
> DATE_FORMAT` field is wrong. The field is declared as "static". A 
> SimpleDateFormat is not thread-safe, so it must not be shared between tests, 
> as some testing configurations may run several tests in parallel.
> A simple fix will be to remove "static" from declaration of that field and 
> its initialization block, so that each running instance of the test gets its 
> own copy of SimpleDateFormat class.
> (I am not sure whether this bug is the actual cause of the test failure. I do 
> not see any reconfigurations of test environment on 2015-10-06. *Update*: 
> according to gump-general mailing list \[1], on Oct 06 the Java runtime used 
> to run Gump was updated to the latest Java 8 release)
> \[1] 
> http://mail-archives.apache.org/mod_mbox/gump-general/201510.mbox/%3C5613A448.8040109%40apache.org%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (MATH-1269) FastMath.exp may return NaN for non-NaN arguments

2015-10-23 Thread Otmar Ertl (JIRA)

 [ 
https://issues.apache.org/jira/browse/MATH-1269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otmar Ertl updated MATH-1269:
-
Attachment: MATH-1269-fix-tempC-infinity.patch

One more proposal. The problem is the calculation of (1+z)(tempA+tempB) if 
tempA is infinite. In this case tempC is also infinite. If z < 0 at the same 
time we get NaN for tempC*z + tempB + tempA. The proposed patch returns 
infinity for the case tempC is positive infinite. In all other cases tempC*z 
cannot be negative infinite and the evaluation of tempC*z + tempB + tempA is 
not a problem even if tempA or tempB are positive infinite.

> FastMath.exp may return NaN for non-NaN arguments
> -
>
> Key: MATH-1269
> URL: https://issues.apache.org/jira/browse/MATH-1269
> Project: Commons Math
>  Issue Type: Bug
>Affects Versions: 4.0
>Reporter: Otmar Ertl
> Attachments: MATH-1269-fix-tempC-infinity.patch, MATH-1269.patch, 
> MATH-1269.patch, MATH-1269_fix_z.patch
>
>
> I have observed that FastMath.exp(709.8125) returns NaN. However, the 
> exponential function must never return NaN (if the argument is not NaN). The 
> result must always be non-negative or positive infinity.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LANG-1171) Add compare methods in StringUtils

2015-10-23 Thread Loic Guibert (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971475#comment-14971475
 ] 

Loic Guibert commented on LANG-1171:


PR #110 has been merged

> Add compare methods in StringUtils
> --
>
> Key: LANG-1171
> URL: https://issues.apache.org/jira/browse/LANG-1171
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Loic Guibert
>Assignee: Loic Guibert
> Fix For: 3.5
>
>
> Add null safe methods in {{StringUtils}} to compare 2 Strings :
> {code:java}
> public static int compare(final String str1, final String str2);
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> public static int compareIgnoreCase(final String str1, final String str2);
> public static int compareIgnoreCase(final String str1, final String str2, 
> final boolean nullIsLess);
> {code}
> Those methods are null safe equivalent to :
> {code:java}
> String.compareTo(String);
> String.compareToIgnoreCase(String);
> {code}
> More details :
> {code:java}
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null)   = 0
>  * StringUtils.compare(null , "a")   < 0
>  * StringUtils.compare("a", null)> 0
>  * StringUtils.compare("abc", "abc") = 0
>  * StringUtils.compare("a", "b") < 0
>  * StringUtils.compare("b", "a") > 0
>  * StringUtils.compare("a", "B") > 0
>  * StringUtils.compare("ab", "abc")  < 0
>  * 
>  *
>  * @see #compare(String, String, boolean)
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2);
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} inputs are handled according to the {@code nullIsLess} 
> parameter.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null, *) = 0
>  * StringUtils.compare(null , "a", true)  < 0
>  * StringUtils.compare(null , "a", false) > 0
>  * StringUtils.compare("a", null, true)   > 0
>  * StringUtils.compare("a", null, false)  < 0
>  * StringUtils.compare("abc", "abc", *)   = 0
>  * StringUtils.compare("a", "b", *)   < 0
>  * StringUtils.compare("b", "a", *)   > 0
>  * StringUtils.compare("a", "B", *)   > 0
>  * StringUtils.compare("ab", "abc", *)< 0
>  * 
>  *
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @param nullIsLess  whether consider {@code null} value less than 
> non-{@code null} value
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> /**
>  * Compare two Strings lexicographically, ignoring case differences,
>  * as per {@link String#compareToIgnoreCase(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareToIgnoreCase(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  * Comparison is case insensitive.
>  *
>  * 
>  * StringUtils.compareIgnoreCase(null, null)   = 0
>  * StringUtils.compareIgnoreCase(null , "a")   < 0
>  * StringUtils.compareIgnoreCase("a", null)> 0
>  * StringUtils.compareIgnoreCase("abc", "abc") = 0
>  * StringUtils.compareIgnoreCase("abc", "ABC") = 0
>  * StringUtils.compareIgnoreCase("a", "b") < 0
>  * StringUtils.comp

[jira] [Resolved] (LANG-1171) Add compare methods in StringUtils

2015-10-23 Thread Loic Guibert (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Loic Guibert resolved LANG-1171.

Resolution: Fixed

> Add compare methods in StringUtils
> --
>
> Key: LANG-1171
> URL: https://issues.apache.org/jira/browse/LANG-1171
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Loic Guibert
>Assignee: Loic Guibert
> Fix For: 3.5
>
>
> Add null safe methods in {{StringUtils}} to compare 2 Strings :
> {code:java}
> public static int compare(final String str1, final String str2);
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> public static int compareIgnoreCase(final String str1, final String str2);
> public static int compareIgnoreCase(final String str1, final String str2, 
> final boolean nullIsLess);
> {code}
> Those methods are null safe equivalent to :
> {code:java}
> String.compareTo(String);
> String.compareToIgnoreCase(String);
> {code}
> More details :
> {code:java}
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null)   = 0
>  * StringUtils.compare(null , "a")   < 0
>  * StringUtils.compare("a", null)> 0
>  * StringUtils.compare("abc", "abc") = 0
>  * StringUtils.compare("a", "b") < 0
>  * StringUtils.compare("b", "a") > 0
>  * StringUtils.compare("a", "B") > 0
>  * StringUtils.compare("ab", "abc")  < 0
>  * 
>  *
>  * @see #compare(String, String, boolean)
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2);
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} inputs are handled according to the {@code nullIsLess} 
> parameter.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null, *) = 0
>  * StringUtils.compare(null , "a", true)  < 0
>  * StringUtils.compare(null , "a", false) > 0
>  * StringUtils.compare("a", null, true)   > 0
>  * StringUtils.compare("a", null, false)  < 0
>  * StringUtils.compare("abc", "abc", *)   = 0
>  * StringUtils.compare("a", "b", *)   < 0
>  * StringUtils.compare("b", "a", *)   > 0
>  * StringUtils.compare("a", "B", *)   > 0
>  * StringUtils.compare("ab", "abc", *)< 0
>  * 
>  *
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @param nullIsLess  whether consider {@code null} value less than 
> non-{@code null} value
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> /**
>  * Compare two Strings lexicographically, ignoring case differences,
>  * as per {@link String#compareToIgnoreCase(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareToIgnoreCase(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  * Comparison is case insensitive.
>  *
>  * 
>  * StringUtils.compareIgnoreCase(null, null)   = 0
>  * StringUtils.compareIgnoreCase(null , "a")   < 0
>  * StringUtils.compareIgnoreCase("a", null)> 0
>  * StringUtils.compareIgnoreCase("abc", "abc") = 0
>  * StringUtils.compareIgnoreCase("abc", "ABC") = 0
>  * StringUtils.compareIgnoreCase("a", "b") < 0
>  * StringUtils.compareIgnoreCase("b", "a") > 0
>  * StringUtils.compareIg

[jira] [Updated] (LANG-1171) Add compare methods in StringUtils

2015-10-23 Thread Loic Guibert (JIRA)

 [ 
https://issues.apache.org/jira/browse/LANG-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Loic Guibert updated LANG-1171:
---
Fix Version/s: 3.5

> Add compare methods in StringUtils
> --
>
> Key: LANG-1171
> URL: https://issues.apache.org/jira/browse/LANG-1171
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Loic Guibert
>Assignee: Loic Guibert
> Fix For: 3.5
>
>
> Add null safe methods in {{StringUtils}} to compare 2 Strings :
> {code:java}
> public static int compare(final String str1, final String str2);
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> public static int compareIgnoreCase(final String str1, final String str2);
> public static int compareIgnoreCase(final String str1, final String str2, 
> final boolean nullIsLess);
> {code}
> Those methods are null safe equivalent to :
> {code:java}
> String.compareTo(String);
> String.compareToIgnoreCase(String);
> {code}
> More details :
> {code:java}
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null)   = 0
>  * StringUtils.compare(null , "a")   < 0
>  * StringUtils.compare("a", null)> 0
>  * StringUtils.compare("abc", "abc") = 0
>  * StringUtils.compare("a", "b") < 0
>  * StringUtils.compare("b", "a") > 0
>  * StringUtils.compare("a", "B") > 0
>  * StringUtils.compare("ab", "abc")  < 0
>  * 
>  *
>  * @see #compare(String, String, boolean)
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2);
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} inputs are handled according to the {@code nullIsLess} 
> parameter.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null, *) = 0
>  * StringUtils.compare(null , "a", true)  < 0
>  * StringUtils.compare(null , "a", false) > 0
>  * StringUtils.compare("a", null, true)   > 0
>  * StringUtils.compare("a", null, false)  < 0
>  * StringUtils.compare("abc", "abc", *)   = 0
>  * StringUtils.compare("a", "b", *)   < 0
>  * StringUtils.compare("b", "a", *)   > 0
>  * StringUtils.compare("a", "B", *)   > 0
>  * StringUtils.compare("ab", "abc", *)< 0
>  * 
>  *
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @param nullIsLess  whether consider {@code null} value less than 
> non-{@code null} value
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> /**
>  * Compare two Strings lexicographically, ignoring case differences,
>  * as per {@link String#compareToIgnoreCase(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareToIgnoreCase(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  * Comparison is case insensitive.
>  *
>  * 
>  * StringUtils.compareIgnoreCase(null, null)   = 0
>  * StringUtils.compareIgnoreCase(null , "a")   < 0
>  * StringUtils.compareIgnoreCase("a", null)> 0
>  * StringUtils.compareIgnoreCase("abc", "abc") = 0
>  * StringUtils.compareIgnoreCase("abc", "ABC") = 0
>  * StringUtils.compareIgnoreCase("a", "b") < 0
>  * StringUtils.compareIgnoreCase("b", "a") > 0
>  * StringUtils.compareIgn

[jira] [Commented] (LANG-1171) Add compare methods in StringUtils

2015-10-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-1171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971470#comment-14971470
 ] 

ASF GitHub Bot commented on LANG-1171:
--

Github user asfgit closed the pull request at:

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


> Add compare methods in StringUtils
> --
>
> Key: LANG-1171
> URL: https://issues.apache.org/jira/browse/LANG-1171
> Project: Commons Lang
>  Issue Type: New Feature
>  Components: lang.*
>Reporter: Loic Guibert
>Assignee: Loic Guibert
>
> Add null safe methods in {{StringUtils}} to compare 2 Strings :
> {code:java}
> public static int compare(final String str1, final String str2);
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> public static int compareIgnoreCase(final String str1, final String str2);
> public static int compareIgnoreCase(final String str1, final String str2, 
> final boolean nullIsLess);
> {code}
> Those methods are null safe equivalent to :
> {code:java}
> String.compareTo(String);
> String.compareToIgnoreCase(String);
> {code}
> More details :
> {code:java}
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null)   = 0
>  * StringUtils.compare(null , "a")   < 0
>  * StringUtils.compare("a", null)> 0
>  * StringUtils.compare("abc", "abc") = 0
>  * StringUtils.compare("a", "b") < 0
>  * StringUtils.compare("b", "a") > 0
>  * StringUtils.compare("a", "B") > 0
>  * StringUtils.compare("ab", "abc")  < 0
>  * 
>  *
>  * @see #compare(String, String, boolean)
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2);
> /**
>  * Compare two Strings lexicographically, as per {@link 
> String#compareTo(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareTo(str2)
>  * 
>  * {@code null} inputs are handled according to the {@code nullIsLess} 
> parameter.
>  * Two {@code null} references are considered equal.
>  *
>  * 
>  * StringUtils.compare(null, null, *) = 0
>  * StringUtils.compare(null , "a", true)  < 0
>  * StringUtils.compare(null , "a", false) > 0
>  * StringUtils.compare("a", null, true)   > 0
>  * StringUtils.compare("a", null, false)  < 0
>  * StringUtils.compare("abc", "abc", *)   = 0
>  * StringUtils.compare("a", "b", *)   < 0
>  * StringUtils.compare("b", "a", *)   > 0
>  * StringUtils.compare("a", "B", *)   > 0
>  * StringUtils.compare("ab", "abc", *)< 0
>  * 
>  *
>  * @see String#compareTo(String)
>  * @param str1  the String to compare from
>  * @param str2  the String to compare to
>  * @param nullIsLess  whether consider {@code null} value less than 
> non-{@code null} value
>  * @return < 0, 0, > 0, if {@code str1} is respectively less, equal ou 
> greater than {@code str2}
>  */
> public static int compare(final String str1, final String str2, final boolean 
> nullIsLess);
> /**
>  * Compare two Strings lexicographically, ignoring case differences,
>  * as per {@link String#compareToIgnoreCase(String)}, returning :
>  * 
>  *  {@code int = 0}, if {@code str1} is equal to {@code str2} (or both 
> {@code null})
>  *  {@code int < 0}, if {@code str1} is less than {@code str2}
>  *  {@code int > 0}, if {@code str1} is greater than {@code str2}
>  * 
>  * 
>  * This is a {@code null} safe version of :
>  * str1.compareToIgnoreCase(str2)
>  * 
>  * {@code null} value is considered less than non-{@code null} value.
>  * Two {@code null} references are considered equal.
>  * Comparison is case insensitive.
>  *
>  * 
>  * StringUtils.compareIgnoreCase(null, null)   = 0
>  * StringUtils.compareIgnoreCase(null , "a")   < 0
>  * StringUtils.compareIgnoreCase("a", null)> 0
>  * StringUtils.compareIgnoreCase("abc", "abc") = 0
>  * StringUtils.compareIgnoreCase("abc", "ABC") = 0
>  * StringUtils.compa

[GitHub] commons-lang pull request: LANG-1171 Add null safe compare methods...

2015-10-23 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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.
---


[jira] [Commented] (VALIDATOR-376) EmailValidator says addresses such as x.y@gmail are valid although most mail apps will fail to send it

2015-10-23 Thread Benedikt Ritter (JIRA)

[ 
https://issues.apache.org/jira/browse/VALIDATOR-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971068#comment-14971068
 ] 

Benedikt Ritter commented on VALIDATOR-376:
---

[~ralph_go...@dslextreme.com] go for it!

> EmailValidator says addresses such as x.y@gmail are valid although most mail 
> apps will fail to send it
> --
>
> Key: VALIDATOR-376
> URL: https://issues.apache.org/jira/browse/VALIDATOR-376
> Project: Commons Validator
>  Issue Type: Bug
>  Components: Routines
>Affects Versions: 1.4.1 Release
>Reporter: Ralph Goers
> Attachments: VALIDATOR-376.patch
>
>
> The VALIDATOR-273 patch causes EmailValidator to allow addresses such as 
> x.y@gmail. Unfortunately, this is causing us problems as none of the email 
> apps we have tried will actually allow that email address to be sent. 
> Although the RFCs may state it is valid, in practice it apparently isn't. 
> Some sort of option is needed to allow providing just the domain to fail. As 
> a consequence we have had to revert to a prior release of commons-validator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (VALIDATOR-377) EmailValidator 1.4.1 validating invalid emails

2015-10-23 Thread Benedikt Ritter (JIRA)

[ 
https://issues.apache.org/jira/browse/VALIDATOR-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14971062#comment-14971062
 ] 

Benedikt Ritter commented on VALIDATOR-377:
---

Duplicate of VALIDATOR-376

> EmailValidator 1.4.1 validating invalid emails
> --
>
> Key: VALIDATOR-377
> URL: https://issues.apache.org/jira/browse/VALIDATOR-377
> Project: Commons Validator
>  Issue Type: Bug
>  Components: Routines
>Affects Versions: 1.4.1 Release
>Reporter: Hemant
>
> EmailValidator(org.apache.commons.validator.routines.EmailValidator) from 
> 1.4.1 is validating invalid emails as true.
> Example of such emails: fred@gmail, test@gmail



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (VALIDATOR-377) EmailValidator 1.4.1 validating invalid emails

2015-10-23 Thread Hemant (JIRA)
Hemant created VALIDATOR-377:


 Summary: EmailValidator 1.4.1 validating invalid emails
 Key: VALIDATOR-377
 URL: https://issues.apache.org/jira/browse/VALIDATOR-377
 Project: Commons Validator
  Issue Type: Bug
  Components: Routines
Affects Versions: 1.4.1 Release
Reporter: Hemant


EmailValidator(org.apache.commons.validator.routines.EmailValidator) from 1.4.1 
is validating invalid emails as true.
Example of such emails: fred@gmail, test@gmail






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)