diff --git a/.gitignore b/.gitignore index b601209..55d03cc 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /commons-lang3-3.3.1-src.tar.gz /commons-lang3-3.3.2-src.tar.gz /commons-lang3-3.4-src.tar.gz +/commons-lang3-3.5-src.tar.gz diff --git a/0001-Fix-parsing-of-ISO-dates-with-UTC-TZ.patch b/0001-Fix-parsing-of-ISO-dates-with-UTC-TZ.patch deleted file mode 100644 index c7d5371..0000000 --- a/0001-Fix-parsing-of-ISO-dates-with-UTC-TZ.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5986eae18fc6006ac4b39c35a7cb7ced8e70c61e Mon Sep 17 00:00:00 2001 -From: Michael Simacek -Date: Mon, 15 Feb 2016 15:02:45 +0100 -Subject: [PATCH] Fix parsing of ISO dates with UTC TZ - ---- - .../java/org/apache/commons/lang3/time/DateUtils.java | 3 ++- - .../org/apache/commons/lang3/time/DateUtilsTest.java | 17 ++++++++++++----- - 2 files changed, 14 insertions(+), 6 deletions(-) - -diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java b/src/main/java/org/apache/commons/lang3/time/DateUtils.java -index 7535b8b..8312031 100644 ---- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java -+++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java -@@ -390,7 +390,8 @@ public class DateUtils { - String str2 = str; - // LANG-530 - need to make sure 'ZZ' output doesn't hit SimpleDateFormat as it will ParseException - if (parsePattern.endsWith("ZZ")) { -- str2 = str.replaceAll("([-+][0-9][0-9]):([0-9][0-9])$", "$1$2"); -+ str2 = str.replaceAll("([-+][0-9][0-9]):([0-9][0-9])$", "$1$2"); -+ str2 = str2.replaceAll("Z$", "+0000"); - } - - final Date date = parser.parse(str2, pos); -diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -index 7ef0b8a..a20cf3f 100644 ---- a/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java -@@ -30,6 +30,7 @@ import java.lang.reflect.Modifier; - import java.text.DateFormat; - import java.text.ParseException; - import java.text.SimpleDateFormat; -+import java.time.ZoneId; - import java.util.Calendar; - import java.util.Date; - import java.util.GregorianCalendar; -@@ -1218,11 +1219,17 @@ public class DateUtilsTest { - // http://issues.apache.org/jira/browse/LANG-530 - @Test - public void testLang530() throws ParseException { -- final Date d = new Date(); -- final String isoDateStr = DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(d); -- final Date d2 = DateUtils.parseDate(isoDateStr, new String[] { DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern() }); -- // the format loses milliseconds so have to reintroduce them -- assertEquals("Date not equal to itself ISO formatted and parsed", d.getTime(), d2.getTime() + d.getTime() % 1000); -+ for (long i = 1455545305000L; i <= 1455545306000L; i += 43) { -+ for (String id : ZoneId.getAvailableZoneIds()) { -+ final Date d = new Date(i); -+ FastDateFormat fmt = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ssZZ", TimeZone.getTimeZone(id)); -+ final String isoDateStr = fmt.format(d); -+ final Date d2 = DateUtils.parseDate(isoDateStr, new String[] { fmt.getPattern() }); -+ // the format loses milliseconds so have to reintroduce them -+ assertEquals("Date not equal to itself ISO formatted and parsed", d.getTime(), -+ d2.getTime() + d.getTime() % 1000); -+ } -+ } - } - - /** --- -2.5.0 - diff --git a/apache-commons-lang3.spec b/apache-commons-lang3.spec index 513b831..2f7dd06 100644 --- a/apache-commons-lang3.spec +++ b/apache-commons-lang3.spec @@ -2,24 +2,21 @@ %global short_name commons-%{base_name}3 Name: apache-%{short_name} -Version: 3.4 -Release: 5%{?dist} +Version: 3.5 +Release: 1%{?dist} Summary: Provides a host of helper utilities for the java.lang API License: ASL 2.0 URL: http://commons.apache.org/%{base_name} Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz BuildArch: noarch -# testParseSync() test fails on ARM and PPC64LE for unknown reason -Patch0: fix-ppc64le-test-failure.patch -Patch1: 0001-Fix-parsing-of-ISO-dates-with-UTC-TZ.patch - BuildRequires: maven-local BuildRequires: mvn(commons-io:commons-io) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) -BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) -BuildRequires: mvn(org.hamcrest:hamcrest-all) +BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) %if 0%{?rhel} <= 0 +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(org.hamcrest:hamcrest-all) BuildRequires: mvn(org.easymock:easymock) %endif @@ -48,10 +45,13 @@ Summary: API documentation for %{name} %prep %setup -q -n %{short_name}-%{version}-src -%patch0 -%patch1 -p1 + %mvn_file : %{name} %{short_name} +# testParseSync() test fails on ARM and PPC64LE for unknown reason +sed -i 's/\s*public void testParseSync().*/@org.junit.Ignore\n&/' \ + src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java + %build %mvn_build %{?rhel:-f} @@ -65,6 +65,9 @@ Summary: API documentation for %{name} %doc LICENSE.txt NOTICE.txt %changelog +* Wed Oct 19 2016 Michael Simacek - 3.5-1 +- Update to upstream version 3.5 + * Wed Mar 09 2016 Michael Simacek - 3.4-5 - Fix unapplied patch diff --git a/fix-ppc64le-test-failure.patch b/fix-ppc64le-test-failure.patch deleted file mode 100644 index f197f54..0000000 --- a/fix-ppc64le-test-failure.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java~ 2014-03-15 13:47:49.000000000 +0100 -+++ src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java 2014-03-20 17:16:47.817917653 +0100 -@@ -259,7 +259,6 @@ - FastDateFormat.getInstance(pattern); - } - -- @Test - public void testParseSync() throws InterruptedException { - final String pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS Z"; - final FastDateFormat formatter= FastDateFormat.getInstance(pattern); diff --git a/sources b/sources index b58f899..bb95a08 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -33eee9d9b612c5c5a96f1e23037413d8 commons-lang3-3.4-src.tar.gz +be37aeba82da47428570a7bd7651b41e commons-lang3-3.5-src.tar.gz