diff options
Diffstat (limited to 'dev-java/commons-beanutils')
4 files changed, 275 insertions, 102 deletions
diff --git a/dev-java/commons-beanutils/Manifest b/dev-java/commons-beanutils/Manifest index 63eb1dc29f73..6883d9083d64 100644 --- a/dev-java/commons-beanutils/Manifest +++ b/dev-java/commons-beanutils/Manifest @@ -1,3 +1,6 @@ +AUX commons-collections-3.2.2-fixes.patch 8659 BLAKE2B 801c60536f2060880331ef92ff1f00fac807231e631699ba398cca4f6430101b0585e7a33cd17e163635ebe48082e0ae0fe7b4a140548f100dfe40756ff3a63c SHA512 f81755930a2eb6d4e659c0dd143ffbf2969db58f919cc129b08521e1668d8f7dcdacf42ada5e161360f9a4a3be5236f10dba9c484e6d0a5ca8dd15c6aecc8bd4 DIST commons-beanutils-1.9.4-src.tar.gz 412606 BLAKE2B 213a2ad4d976ed4c55c9a73c0970a656e2f03efcba886369c8be164e04618937ad636ce7ffa6aa7b981e9595b24e4cbacc2bc632268bbfede8172091ef6eb4ff SHA512 6f3d30d02b9a66cf20509bd868c6e2dadb44bb27da1e6b9af7275675e0f3826845a5d4005509dd1eb77a5b2937820c4770a3753daaab072785dcdab0caa69e73 -EBUILD commons-beanutils-1.9.4-r1.ebuild 4632 BLAKE2B 7af9444c86099385097cda169be0d64d80076dbd564fe95bf950a6b6c812578c21666f4b9d970bab6bb3465a4947188468b3f7e99b6c0020e456185175afb64a SHA512 9ecb0a383526c4fac98594799ca0d1cecf4b88b656cc90c26b5884aa2ee3db27eccd8f8160286573537410c8e331cf8f74ac18d8e798fb8aa23189562e4592e1 +DIST commons-beanutils-1.9.4-src.tar.gz.asc 833 BLAKE2B c971231cfb034bd9bbbd6e7801a4fcb54853c0d18872cfae81ce761fc8f71ebb70955456827ad33b4abd4df8c9820031fd49f28c50eddef5251b2a0d1b01cff9 SHA512 2a966959b2c94bf013df71885c2906a092b43a0ac6d63963f1462e7c09376964bb948c0681278a58fffae6716d042dc846b1649e1f4b0816e2adb3733bf14451 +DIST commons-collections-3.2.2-src.tar.gz 630693 BLAKE2B a70cebe9526291d5207db7edd7c9b50060413880d41dcb28c01cf05f7e00a9f5e1560012c3c3c763162412282db9512bc2b64a5788f210c5c8866943d912dafb SHA512 2e8ef638f07515b028a3e7e97851fcf1d9023a2c188e211bd1e936f35d3d91c2885adf3b1103ad17dfb7aeea6e7a67ce7826ee346a8a29c1aa7c6b0cf14e9230 +EBUILD commons-beanutils-1.9.4-r2.ebuild 2770 BLAKE2B 5c50a5bc8edff3299993fc85ce1ff2b416379308f9d318cf9fb32e9b9deca10f82a13b891c78da902ff3ee0e8378bb13b3d11e578b35880d1067f454c2d26704 SHA512 9a96501bc1afaaaa38a4487fcc87fbc857632d138f83e21e10dce0fc3ce5b6c794a839a6fd36bbfd58f950e9bb33f7f000e8e97cfe9ef0bfb4a7cb6c1c644f9b MISC metadata.xml 233 BLAKE2B 2b385ca77219f08b2874b3a4a91a0c836d3cb45ec44b05babb33d590c56ceb5337ecb93a8450a37f8e6bbf4cfc1455892e8142d22e0a1d527d40361e2dce350b SHA512 1acc975a7dc3344bc63282d652ca00d8245970b58353b4fd00f09a4859db3eaba2dcd85e1537d424b7174e4f9c01c2ffb10ec6d107b5c895c9ca20730666de7f diff --git a/dev-java/commons-beanutils/commons-beanutils-1.9.4-r1.ebuild b/dev-java/commons-beanutils/commons-beanutils-1.9.4-r1.ebuild deleted file mode 100644 index a4b3175fa186..000000000000 --- a/dev-java/commons-beanutils/commons-beanutils-1.9.4-r1.ebuild +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# Skeleton command: -# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri mirror://apache/commons/beanutils/source/1.9.4-src.tar.gz --slot 1.7 --keywords "~amd64 ~x86 ~ppc64 ~amd64-linux ~x86-linux ~x64-macos" --ebuild commons-beanutils-1.9.4.ebuild - -EAPI=8 - -JAVA_PKG_IUSE="doc source test" -MAVEN_ID="commons-beanutils:commons-beanutils:1.9.4" -JAVA_TESTING_FRAMEWORKS="junit-4" - -inherit java-pkg-2 java-pkg-simple - -DESCRIPTION="Provides easy-to-use wrappers around Reflection and Introspection APIs" -HOMEPAGE="https://commons.apache.org/proper/commons-beanutils/" -SRC_URI="mirror://apache/commons/beanutils/source/${P}-src.tar.gz" - -LICENSE="Apache-2.0" -SLOT="1.7" -KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos" - -# Common dependencies -# POM: pom.xml -# commons-collections:commons-collections:3.2.2 -> >=dev-java/commons-collections-3.2.2:0 -# commons-logging:commons-logging:1.2 -> >=dev-java/commons-logging-1.2:0 - -CP_DEPEND=" - dev-java/commons-collections:0 - dev-java/commons-logging:0 -" - -# Compile dependencies -# POM: pom.xml -# test? commons-collections:commons-collections-testframework:3.2.1 -> !!!artifactId-not-found!!! -# test? junit:junit:4.12 -> >=dev-java/junit-4.12:4 - -DEPEND="${CP_DEPEND} - >=virtual/jdk-1.8:* - test? ( - dev-java/commons-collections:0[test] - )" - -RDEPEND="${CP_DEPEND} - >=virtual/jre-1.8:*" - -DOCS=( {CONTRIBUTING,README}.md {LICENSE,NOTICE,RELEASE-NOTES}.txt ) - -S="${WORKDIR}/${P}-src" - -JAVA_ENCODING="iso-8859-1" - -JAVA_SRC_DIR="src/main/java" - -JAVA_TEST_GENTOO_CLASSPATH="commons-collections,junit-4" -JAVA_TEST_SRC_DIR="src/test/java" - -JAVA_TEST_EXCLUDES=( - # Upstream: Tests run: 1293, Failures: 0, Errors: 0, Skipped: 3 - "org.apache.commons.beanutils.TestBeanPublicSubclass" # Invalid test class - "org.apache.commons.beanutils.TestBeanPackageSubclass" # Invalid test class - "org.apache.commons.beanutils.TestResultSetMetaData" # Invalid test class - "org.apache.commons.beanutils.TestResultSet" # Test class can only have one constructor - "org.apache.commons.beanutils.TestBean" # Test class can only have one constructor - # https://github.com/apache/commons-beanutils/blob/32ceb2c92512d44f97638805e2f3fd9d70dfcfc6/pom.xml#L378-L383 - # <!-- This test case is known to fail, and there isn't any proposed fix - # - so we will just exclude it until someone comes up with a solution. - # --> - "org.apache.commons.beanutils.converters.MemoryTestCase" -) - -src_test() { - # There were 8 failures: - # 1) testPropertyUtilsBean_descriptorsCache_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 2) testPropertyUtilsBean_mappedDescriptorsCache_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 3) testMappedPropertyDescriptor_MappedMethodReference1(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 4) testMappedPropertyDescriptor_MappedMethodReference2(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 5) testLocaleConvertUtilsBean_converters_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 6) testWrapDynaClass_dynaClasses_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 7) testMethodUtils_cache_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - # 8) testConvertUtilsBean_converters_memoryLeak(org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase) - # java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects - local vm_version="$(java-config -g PROVIDES_VERSION)" - if [[ "${vm_version}" == "11" ]] ; then - JAVA_TEST_EXCLUDES+=( "org.apache.commons.beanutils.memoryleaktests.MemoryLeakTestCase" ) - fi - - java-pkg-simple_src_test -} - -src_install() { - default # https://bugs.gentoo.org/789582 - java-pkg-simple_src_install -} diff --git a/dev-java/commons-beanutils/commons-beanutils-1.9.4-r2.ebuild b/dev-java/commons-beanutils/commons-beanutils-1.9.4-r2.ebuild new file mode 100644 index 000000000000..ba6bfd171173 --- /dev/null +++ b/dev-java/commons-beanutils/commons-beanutils-1.9.4-r2.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="commons-beanutils:commons-beanutils:1.9.4" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple verify-sig + +DESCRIPTION="Provides easy-to-use wrappers around Reflection and Introspection APIs" +HOMEPAGE="https://commons.apache.org/proper/commons-beanutils/" +# We need some test classes of commons-collections which are not part of the jar file. +ACC="commons-collections-3.2.2" +SRC_URI="mirror://apache/commons/beanutils/source/${P}-src.tar.gz + test? ( https://archive.apache.org/dist/commons/collections/source/${ACC}-src.tar.gz ) + verify-sig? ( https://downloads.apache.org/commons/beanutils/source/${P}-src.tar.gz.asc )" +S="${WORKDIR}/${P}-src" + +LICENSE="Apache-2.0" +SLOT="1.7" +KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos" + +VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/commons.apache.org.asc" +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-commons )" +CP_DEPEND=" + dev-java/commons-collections:0 + dev-java/commons-logging:0 +" +DEPEND="${CP_DEPEND} + >=virtual/jdk-1.8:*" +RDEPEND="${CP_DEPEND} + >=virtual/jre-1.8:*" + +DOCS=( {CONTRIBUTING,README}.md {NOTICE,RELEASE-NOTES}.txt ) + +JAVA_ENCODING="iso-8859-1" +JAVA_SRC_DIR="src/main/java" + +JAVA_TEST_GENTOO_CLASSPATH="junit-4 " +JAVA_TEST_SRC_DIR=( + src/test/java + ../"${ACC}"-src/src/test +) + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${P}-src.tar.gz{,.asc} + fi + default +} + +src_test() { + export LC_ALL="en_US.UTF-8" + # Apply patch to unpacked commons-collections + pushd "../${ACC}-src" >> /dev/null || die + eapply "${FILESDIR}/${ACC}-fixes.patch" + popd + + pushd src/test/java || die + # Selection according to lines 375-383 pom.xml + local JAVA_TEST_RUN_ONLY=$(find * \ + -path "**/*TestCase.java" \ + ! -path "**/*MemoryTestCase.java" \ + ! -path "**/*MemoryLeakTestCase.java" \ + ! -path "**/*LocaleBeanificationTestCase.java" \ + ! -path "**/Jira347TestCase.java" \ + ) + popd + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}" + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}" + + # We skip 2 more test classes conditionally which have failures with Java 21 + # Error converting 'String' to 'java.sql.Time' using pattern 'h:mm a' + # Error converting 'String' to 'java.sql.Timestamp' using pattern 'M/d/yy, h:mm a' + local vm_version="$(java-config -g PROVIDES_VERSION)" + if ver_test "${vm_version}" -ge "21"; then + JAVA_TEST_RUN_ONLY=${JAVA_TEST_RUN_ONLY//org.apache.commons.beanutils.converters.SqlTimeConverterTestCase} + JAVA_TEST_RUN_ONLY=${JAVA_TEST_RUN_ONLY//org.apache.commons.beanutils.converters.SqlTimestampConverterTestCase} + fi + + java-pkg-simple_src_test +} diff --git a/dev-java/commons-beanutils/files/commons-collections-3.2.2-fixes.patch b/dev-java/commons-beanutils/files/commons-collections-3.2.2-fixes.patch new file mode 100644 index 000000000000..2f1380a06ffc --- /dev/null +++ b/dev-java/commons-beanutils/files/commons-collections-3.2.2-fixes.patch @@ -0,0 +1,187 @@ +Patch stolen from: +From e90a6173247f06514731825677f3fc67c62bdc52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miroslav=20=C5=A0ulc?= <fordfrog@gentoo.org> +Date: Wed, 21 Apr 2021 11:31:11 +0200 +--- a/build.xml ++++ b/build.xml +@@ -154,8 +154,7 @@ + + <!-- NOTE: A jar built using JDK1.4 is incompatible with JDK1.2 --> + <jar jarfile="${build.jar.name}" +- basedir="${build.classes}" +- manifest="${build.conf}/MANIFEST.MF"/> ++ basedir="${build.classes}"/> + </target> + + <!-- ====================================================================== --> +--- a/src/java/org/apache/commons/collections/MultiHashMap.java ++++ b/src/java/org/apache/commons/collections/MultiHashMap.java +@@ -331,7 +331,7 @@ public class MultiHashMap extends HashMap implements MultiMap { + * @param item the value to remove + * @return the value removed (which was passed in), null if nothing removed + */ +- public Object remove(Object key, Object item) { ++ public Object removeMapping(Object key, Object item) { + Collection valuesForKey = getCollection(key); + if (valuesForKey == null) { + return null; +--- a/src/java/org/apache/commons/collections/MultiMap.java ++++ b/src/java/org/apache/commons/collections/MultiMap.java +@@ -66,7 +66,7 @@ public interface MultiMap extends Map { + * @throws ClassCastException if the key or value is of an invalid type + * @throws NullPointerException if the key or value is null and null is invalid + */ +- public Object remove(Object key, Object item); ++ public Object removeMapping(Object key, Object item); + + //----------------------------------------------------------------------- + /** +--- a/src/java/org/apache/commons/collections/map/MultiKeyMap.java ++++ b/src/java/org/apache/commons/collections/map/MultiKeyMap.java +@@ -197,7 +197,7 @@ public class MultiKeyMap + * @param key2 the second key + * @return the value mapped to the removed key, null if key not in map + */ +- public Object remove(Object key1, Object key2) { ++ public Object removeMultiKey(Object key1, Object key2) { + int hashCode = hash(key1, key2); + int index = map.hashIndex(hashCode, map.data.length); + AbstractHashedMap.HashEntry entry = map.data[index]; +--- a/src/java/org/apache/commons/collections/map/MultiValueMap.java ++++ b/src/java/org/apache/commons/collections/map/MultiValueMap.java +@@ -153,7 +153,7 @@ public class MultiValueMap extends AbstractMapDecorator implements MultiMap { + * @param value the value to remove + * @return the value removed (which was passed in), null if nothing removed + */ +- public Object remove(Object key, Object value) { ++ public Object removeMapping(Object key, Object value) { + Collection valuesForKey = getCollection(key); + if (valuesForKey == null) { + return null; +--- a/src/test/org/apache/commons/collections/TestMultiHashMap.java ++++ b/src/test/org/apache/commons/collections/TestMultiHashMap.java +@@ -217,7 +217,7 @@ public class TestMultiHashMap extends AbstractTestMap { + MultiHashMap one = new MultiHashMap(); + Integer value = new Integer(1); + one.put("One", value); +- one.remove("One", value); ++ one.removeMapping("One", value); + + MultiHashMap two = new MultiHashMap(); + assertEquals(two, one); +@@ -269,7 +269,7 @@ public class TestMultiHashMap extends AbstractTestMap { + assertEquals(4, map.totalSize()); + map.remove("A"); + assertEquals(3, map.totalSize()); +- map.remove("B", "BC"); ++ map.removeMapping("B", "BC"); + assertEquals(2, map.totalSize()); + } + +@@ -292,7 +292,7 @@ public class TestMultiHashMap extends AbstractTestMap { + map.remove("A"); + assertEquals(0, map.size("A")); + assertEquals(3, map.size("B")); +- map.remove("B", "BC"); ++ map.removeMapping("B", "BC"); + assertEquals(0, map.size("A")); + assertEquals(2, map.size("B")); + } +@@ -464,11 +464,11 @@ public class TestMultiHashMap extends AbstractTestMap { + map.put("A", "AA"); + map.put("A", "AB"); + map.put("A", "AC"); +- assertEquals(null, map.remove("C", "CA")); +- assertEquals(null, map.remove("A", "AD")); +- assertEquals("AC", map.remove("A", "AC")); +- assertEquals("AB", map.remove("A", "AB")); +- assertEquals("AA", map.remove("A", "AA")); ++ assertEquals(null, map.removeMapping("C", "CA")); ++ assertEquals(null, map.removeMapping("A", "AD")); ++ assertEquals("AC", map.removeMapping("A", "AC")); ++ assertEquals("AB", map.removeMapping("A", "AB")); ++ assertEquals("AA", map.removeMapping("A", "AA")); + assertEquals(new MultiHashMap(), map); + } + +--- 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 +--- a/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java ++++ b/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java +@@ -315,10 +315,10 @@ public class TestMultiKeyMap extends AbstractTestIterableMap { + switch (key.size()) { + case 2: + assertEquals(true, multimap.containsKey(key.getKey(0), key.getKey(1))); +- assertEquals(value, multimap.remove(key.getKey(0), key.getKey(1))); ++ assertEquals(value, multimap.removeMultiKey(key.getKey(0), key.getKey(1))); + assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1))); + assertEquals(size - 1, multimap.size()); +- assertEquals(null, multimap.remove(key.getKey(0), key.getKey(1))); ++ assertEquals(null, multimap.removeMultiKey(key.getKey(0), key.getKey(1))); + assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1))); + break; + case 3: +--- a/src/test/org/apache/commons/collections/map/TestMultiValueMap.java ++++ b/src/test/org/apache/commons/collections/map/TestMultiValueMap.java +@@ -161,7 +161,7 @@ public class TestMultiValueMap extends TestCase { + MultiValueMap one = new MultiValueMap();
+ Integer value = new Integer(1);
+ one.put("One", value);
+- one.remove("One", value);
++ one.removeMapping("One", value);
+
+ MultiValueMap two = new MultiValueMap();
+ assertEquals(two, one);
+@@ -187,7 +187,7 @@ public class TestMultiValueMap extends TestCase { + assertEquals(4, map.totalSize());
+ map.remove("A");
+ assertEquals(3, map.totalSize());
+- map.remove("B", "BC");
++ map.removeMapping("B", "BC");
+ assertEquals(2, map.totalSize());
+ }
+
+@@ -204,7 +204,7 @@ public class TestMultiValueMap extends TestCase { + assertEquals(2, map.size());
+ map.remove("A");
+ assertEquals(2, map.size());
+- map.remove("B", "BC");
++ map.removeMapping("B", "BC");
+ assertEquals(2, map.size());
+ }
+
+@@ -227,7 +227,7 @@ public class TestMultiValueMap extends TestCase { + map.remove("A");
+ assertEquals(0, map.size("A"));
+ assertEquals(3, map.size("B"));
+- map.remove("B", "BC");
++ map.removeMapping("B", "BC");
+ assertEquals(0, map.size("A"));
+ assertEquals(2, map.size("B"));
+ }
+@@ -338,11 +338,11 @@ public class TestMultiValueMap extends TestCase { + map.put("A", "AA");
+ map.put("A", "AB");
+ map.put("A", "AC");
+- assertEquals(null, map.remove("C", "CA"));
+- assertEquals(null, map.remove("A", "AD"));
+- assertEquals("AC", map.remove("A", "AC"));
+- assertEquals("AB", map.remove("A", "AB"));
+- assertEquals("AA", map.remove("A", "AA"));
++ assertEquals(null, map.removeMapping("C", "CA"));
++ assertEquals(null, map.removeMapping("A", "AD"));
++ assertEquals("AC", map.removeMapping("A", "AC"));
++ assertEquals("AB", map.removeMapping("A", "AB"));
++ assertEquals("AA", map.removeMapping("A", "AA"));
+ assertEquals(new MultiValueMap(), map);
+ }
+
|