commit:     510bcd96906092e82a7549d8fcb0477494d7b02b
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 21 08:48:14 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Wed Apr 21 09:33:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=510bcd96

dev-java/commons-collections: fixed compilation of tests in 3.2.1-r3

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 .../commons-collections/commons-collections-3.2.1-r3.ebuild | 11 +++++++----
 .../files/commons-collections-3.2.1-fix-tests.patch         | 13 +++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/dev-java/commons-collections/commons-collections-3.2.1-r3.ebuild 
b/dev-java/commons-collections/commons-collections-3.2.1-r3.ebuild
index cfd46905336..75a4556fc9c 100644
--- a/dev-java/commons-collections/commons-collections-3.2.1-r3.ebuild
+++ b/dev-java/commons-collections/commons-collections-3.2.1-r3.ebuild
@@ -19,17 +19,20 @@ IUSE="test"
 RESTRICT="!test? ( test )"
 
 DEPEND="
-       >=virtual/jdk-1.8
+       >=virtual/jdk-1.8:*
        test? (
                dev-java/junit:0
                dev-java/ant-junit:0
        )"
 
-RDEPEND=">=virtual/jre-1.8"
+RDEPEND=">=virtual/jre-1.8:*"
 
 S="${WORKDIR}/${P}-src"
 
-PATCHES=( "${FILESDIR}/${P}-Java-8.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-Java-8.patch"
+       "${FILESDIR}/${P}-fix-tests.patch"
+)
 
 src_prepare() {
        default
@@ -38,7 +41,7 @@ src_prepare() {
 src_compile() {
        local antflags
        if use test; then
-               antflags="tf.jar -Djunit.jar=$(java-pkg_getjars junit)"
+               antflags="tf.jar -Djunit.jar=$(java-pkg_getjars --build-only 
junit)"
        fi
        eant jar $(use_doc) ${antflags}
 }

diff --git 
a/dev-java/commons-collections/files/commons-collections-3.2.1-fix-tests.patch 
b/dev-java/commons-collections/files/commons-collections-3.2.1-fix-tests.patch
new file mode 100644
index 00000000000..9ba66eb6e4a
--- /dev/null
+++ 
b/dev-java/commons-collections/files/commons-collections-3.2.1-fix-tests.patch
@@ -0,0 +1,13 @@
+diff --git 
a/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java
 
b/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java
+index 1c01b53..aea6edf 100644
+--- 
a/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java
++++ 
b/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java
+@@ -1116,7 +1116,7 @@ public abstract class AbstractTestCollection extends 
AbstractTestObject {
+         verify();
+ 
+         try {
+-            array = collection.toArray(null);
++            array = collection.toArray((Object[]) null);
+             fail("toArray(null) should raise NPE");
+         } catch (NullPointerException e) {
+             // expected

Reply via email to