[apache-poi] Add patch to fix compilation with JDK 1.7
Orion Poplawski
orion at fedoraproject.org
Fri Jul 13 23:05:39 UTC 2012
commit a764730b8add843192ecae83c8ac4bb52750fc84
Author: Orion Poplawski <orion at nwra.com>
Date: Fri Jul 13 17:05:21 2012 -0600
Add patch to fix compilation with JDK 1.7
apache-poi-jdk17.patch | 19 +++++++++++++++++++
apache-poi.spec | 9 ++++++++-
2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/apache-poi-jdk17.patch b/apache-poi-jdk17.patch
new file mode 100644
index 0000000..451e2ed
--- /dev/null
+++ b/apache-poi-jdk17.patch
@@ -0,0 +1,19 @@
+diff -up poi-3.8/src/java/org/apache/poi/ss/format/CellDateFormatter.java.jdk17 poi-3.8/src/java/org/apache/poi/ss/format/CellDateFormatter.java
+--- poi-3.8/src/java/org/apache/poi/ss/format/CellDateFormatter.java.jdk17 2012-03-17 07:19:44.000000000 -0600
++++ poi-3.8/src/java/org/apache/poi/ss/format/CellDateFormatter.java 2012-07-13 16:17:24.360763553 -0600
+@@ -150,7 +150,7 @@ public class CellDateFormatter extends C
+ StringBuffer descBuf = CellFormatPart.parseFormat(format,
+ CellFormatType.DATE, partHandler);
+ partHandler.finish(descBuf);
+- dateFmt = new SimpleDateFormat(descBuf.toString());
++ dateFmt = new SimpleDateFormat(descBuf.toString().replaceAll("((y)(?!y))(?<!yy)", "yy"),LOCALE.US);
+ }
+
+ /** {@inheritDoc} */
+@@ -214,4 +214,4 @@ public class CellDateFormatter extends C
+ public void simpleValue(StringBuffer toAppendTo, Object value) {
+ SIMPLE_DATE.formatValue(toAppendTo, value);
+ }
+-}
+\ No newline at end of file
++}
diff --git a/apache-poi.spec b/apache-poi.spec
index 835704c..bb6df8f 100644
--- a/apache-poi.spec
+++ b/apache-poi.spec
@@ -3,7 +3,7 @@
Name: apache-poi
Version: 3.8
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The Java API for Microsoft Documents
Group: Development/Libraries
@@ -17,6 +17,9 @@ Source2: http://repo2.maven.org/maven2/org/apache/poi/poi/%{version}/poi-
Patch1: %{name}-3.7-compile-xsds.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=799078
Patch2: apache-poi-CVE-2012-0213.patch
+# https://issues.apache.org/bugzilla/show_bug.cgi?id=53369
+# Patch to fix build with JDK 1.7
+Patch3: apache-poi-jdk17.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
ExcludeArch: ppc64
@@ -93,6 +96,7 @@ The manual for %{name}.
%setup -q -n poi-%{version}%{?rcver}
%patch1 -p1 -b .compile-xsds
%patch2 -p0 -b .CVE-2012-0213
+%patch3 -p1 -b .jdk17
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;
mkdir lib ooxml-lib
@@ -177,6 +181,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jul 13 2012 Orion Poplawski <orion at cora.nwra.com> - 3.8-2
+- Add patch to fix compilation with JDK 1.7
+
* Thu May 10 2012 Orion Poplawski <orion at cora.nwra.com> - 3.8-1
- Update to 3.8 final
- Add patch to fix CVE-2012-0213 (bugs 799078, 820788)
More information about the scm-commits
mailing list