Accepting request 621901 from Java:packages

Fix build with jdk 11

OBS-URL: https://build.opensuse.org/request/show/621901
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/apache-commons-collections?expand=0&rev=13
This commit is contained in:
Dominique Leuenberger 2018-07-24 15:32:24 +00:00 committed by Git OBS Bridge
commit 7c156dada5
3 changed files with 35 additions and 4 deletions

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Jul 10 13:02:58 UTC 2018 - fstrba@suse.com
- Added patch:
* commons-collections-jdk11.patch
+ resolve ambiguity with toArray(null)
+ fixes tests with jdk11
-------------------------------------------------------------------
Tue May 15 07:37:07 UTC 2018 - fstrba@suse.com
- Build with source and target 8 to prepare for a possible removal
of 1.6 compatibility
- Run fdupes on documentation
-------------------------------------------------------------------
Fri Sep 29 08:12:33 UTC 2017 - fstrba@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package apache-commons-collections
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -34,10 +34,12 @@ Patch2: java8-compat.patch
# PATCH-FIX-UPSTREAM add missing MANIFEST.MF file
Patch3: commons-collections-missing-MF.patch
Patch4: commons-collections-3.2.2-tf.javadoc.patch
Patch5: commons-collections-jdk11.patch
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: apache-commons-parent
BuildRequires: java-devel
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: junit
@ -100,6 +102,7 @@ find . -name "*.class" -exec rm -f {} \;
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Substitute version into testframework pom
cp -p %{SOURCE1} pom-testframework.xml
@ -108,8 +111,8 @@ sed -i 's/@VERSION@/%{version}/' pom-testframework.xml
%build
echo "junit.jar=$(build-classpath junit)" >>build.properties
ant \
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
-Dant.build.javadoc.source=1.6 \
-Dant.build.javac.source=8 -Dant.build.javac.target=8 \
-Dant.build.javadoc.source=8 \
-Djava.io.tmpdir=. jar javadoc tf.validate tf.jar dist.bin dist.src tf.javadoc
%install
@ -128,10 +131,12 @@ install -Dpm 644 pom-testframework.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_n
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
# testframework-javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-testframework
cp -pr build/docs/testframework/* %{buildroot}%{_javadocdir}/%{name}-testframework
%fdupes -s %{buildroot}%{_javadocdir}/%{name}-testframework
%files
%defattr(0644,root,root,0755)

View File

@ -0,0 +1,11 @@
--- commons-collections-3.2.2-src/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java 2015-11-12 23:25:16.000000000 +0100
+++ commons-collections-3.2.2-src/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java 2018-07-10 14:58:06.116528850 +0200
@@ -1116,7 +1116,7 @@
verify();
try {
- array = collection.toArray(null);
+ array = collection.toArray((Object[])null);
fail("toArray(null) should raise NPE");
} catch (NullPointerException e) {
// expected