Sync from SUSE:ALP:Source:Standard:1.0 apache-commons-collections revision d266086f4f82cb1f1959f04e0e8516df

This commit is contained in:
Adrian Schröter 2024-02-19 16:53:26 +01:00
commit bf42f6b2df
10 changed files with 617 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,173 @@
-------------------------------------------------------------------
Wed Oct 25 16:30:13 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Modified patch:
* commons-collections-3.2-build_xml.patch
+ In ant Javac task, use "release" with compilers that support
it. Use source/target for others. Fixes some return value
incompatibilities with jdk 21
-------------------------------------------------------------------
Thu May 5 16:22:53 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Do not use a dummy pom that only declares dependencies for the
testframework artifact
- Clean up the spec file
-------------------------------------------------------------------
Mon Mar 25 17:25:30 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Remove pom parent, since we don't use it when not building with
maven
-------------------------------------------------------------------
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
- Don't condition the maven defines on release version, but on
_maven_repository being defined
-------------------------------------------------------------------
Thu Sep 14 11:07:55 UTC 2017 - fstrba@suse.com
- Fix build with jdk9 by specifying java source and target 1.6
- Added patch:
* commons-collections-3.2.2-tf.javadoc.patch
- Fix unresolved symbols when building tf.javadoc
-------------------------------------------------------------------
Fri May 19 08:49:50 UTC 2017 - tchvatal@suse.com
- Fix build with new javapackages-tools
-------------------------------------------------------------------
Thu Dec 17 18:24:36 UTC 2015 - tchvatal@suse.com
- Version update to 3.2.2:
* Various bugfixes
* Unix formating in the archive
* Fixes bnc#954102
- Refresh patches for the dos2unix conversion:
* commons-collections-3.2-build_xml.patch
* jakarta-commons-collections-javadoc-nonet.patch
- Add patch to add missing MANIFEST.MF file:
* commons-collections-missing-MF.patch
-------------------------------------------------------------------
Wed Jul 29 10:46:22 UTC 2015 - tchvatal@suse.com
- Fix build with jdk8:
* java8-compat.patch
-------------------------------------------------------------------
Wed Mar 18 09:45:57 UTC 2015 - tchvatal@suse.com
- Fix build with new javapackages-tools
-------------------------------------------------------------------
Mon Jul 7 14:48:57 UTC 2014 - tchvatal@suse.com
- Do not depend on junit4 but use junit
-------------------------------------------------------------------
Thu May 15 13:17:17 UTC 2014 - darin@darins.net
- no bytecode check from sles
-------------------------------------------------------------------
Mon Sep 9 11:04:10 UTC 2013 - tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
-------------------------------------------------------------------
Thu Sep 5 11:58:13 UTC 2013 - mvyskocil@suse.com
- update to 3.2.1
- rename to apache-commons-collections
- deleted patches
* jakarta-commons-collections-navigation.patch
* jakarta-commons-collections-target15.patch
- added patches
* commons-collections-3.2-build_xml.patch
- use newest add_maven_depmap from javapackages-tools
- drop -tomcat5 subpackage
-------------------------------------------------------------------
Tue Nov 11 09:47:14 CET 2008 - mvyskocil@suse.cz
- fix of bnc#441085: yast2-schema is missing on media (openSUSE-11. 1-DVD-ppc-Build0113)
- unittest disabled as it fails on ppc with openjdk b11
-------------------------------------------------------------------
Mon Aug 25 16:30:12 CEST 2008 - mvyskocil@suse.cz
- target=1.5 source=1.5
-------------------------------------------------------------------
Thu Mar 13 11:19:36 CET 2008 - mvyskocil@suse.cz
- merged with jpackage-1.7
- update to 3.2
- changes in BuildRequires:
- java2-devel-packages was substituded by java-devel
- added ant-junit
- maven build support and a maven specific BuildRequires
- added maven pom files
- provides and obsoletes contains a version
- the gcj build support
- new subpackages:
- jakarta-commons-collections-testframework
- jakarta-commons-collections-testframework-javadoc
- jakarta-commons-collections-tomcat5
-------------------------------------------------------------------
Mon Sep 25 11:37:13 CEST 2006 - skh@suse.de
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
-------------------------------------------------------------------
Wed Jan 25 21:46:36 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Wed Jul 27 16:09:34 CEST 2005 - jsmeix@suse.de
- Adjustments in the spec file.
-------------------------------------------------------------------
Mon Jul 18 16:03:12 CEST 2005 - jsmeix@suse.de
- Current version 3.1 from JPackage.org
-------------------------------------------------------------------
Mon Feb 21 17:17:15 CET 2005 - skh@suse.de
- update to version 3.1
- don't use icecream
-------------------------------------------------------------------
Thu Sep 16 14:59:08 CEST 2004 - skh@suse.de
- Fix prerequires of javadoc subpackage
-------------------------------------------------------------------
Thu Sep 2 17:46:58 CEST 2004 - skh@suse.de
- Initial package created with version 2.1.1 (JPackage 1.5)

View File

@ -0,0 +1,136 @@
#
# spec file for package apache-commons-collections
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define base_name collections
%define short_name commons-%{base_name}
Name: apache-commons-collections
Version: 3.2.2
Release: 0
Summary: Commons Collections Package
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/commons-collections/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Patch0: jakarta-commons-collections-javadoc-nonet.patch
Patch1: commons-collections-3.2-build_xml.patch
# PATCH-FIX-UPSTREAM build with jdk8
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: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
BuildRequires: junit
Provides: %{short_name} = %{version}-%{release}
Obsoletes: %{short_name} < %{version}-%{release}
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
BuildArch: noarch
%description
The introduction of the Collections API by Sun in JDK 1.2
has been a boon to quick and effective Java programming.
Ready access to powerful data structures has accelerated
development by reducing the need for custom container
classes around each core object. Most Java2 APIs are
significantly easier to use because of the Collections API.
However, there are certain holes left unfilled by Sun's
implementations, and the Jakarta-Commons Collections
Component strives to fulfill them. Among the features of
this package are: - special-purpose implementations of
Lists and Maps for fast access
- adapter classes from Java1-style containers (arrays,
enumerations) to Java2-style collections
- methods to test or create typical set theory properties
of collections such as union, intersection, and closure
%package testframework
Summary: Test framework for %{name}
Group: Development/Libraries/Java
%description testframework
%{summary}.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
Provides: %{name}-testframework-javadoc = %{version}-%{release}
Obsoletes: %{name}-testframework-javadoc < %{version}-%{release}
%description javadoc
%{summary}.
%prep
%setup -q -n %{short_name}-%{version}-src
# remove all binary libs
find . -name "*.jar" -delete
find . -name "*.class" -delete
# Fix file eof
sed -i 's/\r//' LICENSE.txt PROPOSAL.html README.txt NOTICE.txt
%patch0 -p1
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
echo "junit.jar=$(build-classpath junit)" >>build.properties
ant \
-Dtf.build.docs=build/docs/apidocs/ -Djava.io.tmpdir=. \
jar javadoc tf.validate tf.jar dist.bin dist.src tf.javadoc
%install
# jars
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 build/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{short_name}.jar
ln -sf %{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar
install -m 644 build/%{short_name}-testframework-%{version}.jar %{buildroot}%{_javadir}/%{short_name}-testframework.jar
ln -sf %{short_name}-testframework.jar %{buildroot}%{_javadir}/%{name}-testframework.jar
# poms
install -d -m 0755 %{buildroot}%{_mavenpomdir}
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom
%add_maven_depmap %{short_name}.pom %{short_name}.jar -a "org.apache.commons:%{short_name}"
%add_maven_depmap %{short_name}:%{short_name}-testframework:%{version} %{short_name}-testframework.jar -f "testframework" -a "org.apache.commons:%{short_name}-testframework"
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%license LICENSE.txt NOTICE.txt
%doc PROPOSAL.html README.txt RELEASE-NOTES.txt
%{_javadir}/%{name}.jar
%files testframework -f .mfiles-testframework
%{_javadir}/%{name}-testframework.jar
%files javadoc
%license LICENSE.txt NOTICE.txt
%{_javadocdir}/%{name}
%changelog

View File

@ -0,0 +1,66 @@
--- build.xml 2023-10-25 18:15:51.721217809 +0200
+++ build.xml 2023-10-25 18:26:44.848980199 +0200
@@ -124,6 +124,9 @@
<mkdir dir="${build.classes}"/>
<javac srcdir="${source.java}"
destdir="${build.classes}"
+ release="8"
+ source="8"
+ target="8"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
@@ -267,6 +270,9 @@
<mkdir dir="${build.tests}"/>
<javac srcdir="${source.test}"
destdir="${build.tests}"
+ release="8"
+ source="8"
+ target="8"
debug="true"
deprecation="false"
optimize="false">
@@ -286,7 +292,7 @@
<!-- Runs all tests -->
<target name="-test-all" depends="compile.tests" unless="testcase">
<mkdir dir="${build.test.reports}"/>
- <junit printsummary="yes" haltonfailure="yes" showoutput="yes">
+ <junit printsummary="yes" haltonfailure="no" showoutput="yes">
<formatter type="brief" />
<classpath>
<pathelement location="${build.classes}"/>
@@ -331,7 +337,7 @@
<target name="testjar" depends="compile.tests,jar"
description="Run all unit test cases">
<echo message="Running collections tests against built jar ..."/>
- <junit printsummary="yes" haltonfailure="yes">
+ <junit printsummary="yes" haltonfailure="no">
<classpath>
<pathelement location="${build.jar.name}"/>
<pathelement location="${build.tests}"/>
@@ -355,6 +361,7 @@
<delete dir="${build.docs}"/>
<mkdir dir="${build.docs}"/>
<javadoc sourcepath="${source.java}"
+ source="8"
destdir="${build.docs}"
packagenames="${component.package}.*"
access="${javadoc.access}"
@@ -412,6 +419,9 @@
<javac srcdir="${source.test}"
destdir="${tf.build.tf}"
debug="true"
+ release="8"
+ source="8"
+ target="8"
deprecation="false"
optimize="false">
<patternset refid="tf.patternset.validate" />
@@ -453,6 +463,7 @@
<delete dir="${tf.build.docs}"/>
<mkdir dir="${tf.build.docs}"/>
<javadoc destdir="${tf.build.docs}"
+ source="8"
access="protected"
author="false"
version="false"

BIN
commons-collections-3.2.2-src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,13 @@
--- commons-collections-3.2.2-src/build.xml 2017-09-14 12:45:40.626106146 +0200
+++ commons-collections-3.2.2-src/build.xml 2017-09-14 13:04:45.932517074 +0200
@@ -460,6 +460,10 @@
doctitle="${tf.title} ${tf.version} API;"
windowtitle="${tf.title} ${tf.version} API"
bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved.">
+ <classpath>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${junit.jar}"/>
+ </classpath>
<fileset dir="${source.test}">
<include name="**/AbstractTest*.java"/>
<include name="**/BulkTest*.java"/>

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

View File

@ -0,0 +1,18 @@
Index: commons-collections-3.2.2-src/src/conf/MANIFEST.MF
===================================================================
--- /dev/null
+++ commons-collections-3.2.2-src/src/conf/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Package: org.apache.commons.collections
+Extension-Name: commons-collections
+Specification-Version: @version@
+Specification-Vendor: Apache Software Foundation
+Specification-Title: Commons Collections
+Implementation-Version: @version@
+Implementation-Vendor: Apache Software Foundation
+Implementation-Title: Commons Collections
+Implementation-Vendor-Id: org.apache
+X-Compile-Source-JDK: 1.2
+X-Compile-Target-JDK: 1.2
\ No newline at end of file

View File

@ -0,0 +1,26 @@
--- commons-collections-3.1/build.xml~ 2004-06-23 00:17:14.000000000 +0100
+++ commons-collections-3.1/build.xml 2005-05-04 13:58:44.000000000 +0100
@@ -80,7 +80,6 @@
<!-- Javadoc -->
<property name="javadoc.access" value="protected"/>
- <property name="javadoc.links" value="http://java.sun.com/j2se/1.3/docs/api/"/>
<!-- JUnit -->
<property name="test.failonerror" value="true"/>
@@ -362,7 +361,6 @@
author="true"
version="true"
use="true"
- link="${javadoc.links}"
overview="${source.java}/org/apache/commons/collections/overview.html"
doctitle="${component.title} ${component.version} API;"
windowtitle="${component.title} ${component.version} API"
@@ -470,7 +468,6 @@
access="protected"
author="false"
version="false"
- link="${javadoc.links}"
overview="${source.test}/org/apache/commons/collections/overview.html"
doctitle="${tf.title} ${tf.version} API;"
windowtitle="${tf.title} ${tf.version} API"

148
java8-compat.patch Normal file
View File

@ -0,0 +1,148 @@
diff --git a/src/java/org/apache/commons/collections/MultiHashMap.java b/src/java/org/apache/commons/collections/MultiHashMap.java
index 25158b4..ab0ca71 100644
--- a/src/java/org/apache/commons/collections/MultiHashMap.java
+++ b/src/java/org/apache/commons/collections/MultiHashMap.java
@@ -331,21 +331,21 @@ 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 boolean remove(Object key, Object item) {
Collection valuesForKey = getCollection(key);
if (valuesForKey == null) {
- return null;
+ return false;
}
boolean removed = valuesForKey.remove(item);
if (removed == false) {
- return null;
+ return false;
}
// remove the list if it is now empty
// (saves space, and allows equals to work)
if (valuesForKey.isEmpty()){
remove(key);
}
- return item;
+ return true;
}
/**
diff --git a/src/java/org/apache/commons/collections/MultiMap.java b/src/java/org/apache/commons/collections/MultiMap.java
index 8cd7212..60f22ae 100644
--- 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 boolean remove(Object key, Object item);
//-----------------------------------------------------------------------
/**
@@ -144,7 +144,7 @@ public interface MultiMap extends Map {
* @throws ClassCastException if the key is of an invalid type
* @throws NullPointerException if the key is null and null keys are invalid
*/
- Object remove(Object key);
+ //boolean remove(Object key);
/**
* Gets a collection containing all the values in the map.
diff --git a/src/java/org/apache/commons/collections/map/MultiKeyMap.java b/src/java/org/apache/commons/collections/map/MultiKeyMap.java
index 1ba1cea..3523b5c 100644
--- 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 boolean remove(Object key1, Object key2) {
int hashCode = hash(key1, key2);
int index = map.hashIndex(hashCode, map.data.length);
AbstractHashedMap.HashEntry entry = map.data[index];
@@ -206,12 +206,14 @@ public class MultiKeyMap
if (entry.hashCode == hashCode && isEqualKey(entry, key1, key2)) {
Object oldValue = entry.getValue();
map.removeMapping(entry, index, previous);
- return oldValue;
+ //return oldValue;
+ return true;
}
previous = entry;
entry = entry.next;
}
- return null;
+ //return null;
+ return false;
}
/**
diff --git a/src/java/org/apache/commons/collections/map/MultiValueMap.java b/src/java/org/apache/commons/collections/map/MultiValueMap.java
index cc74fd7..b347e84 100644
--- a/src/java/org/apache/commons/collections/map/MultiValueMap.java
+++ b/src/java/org/apache/commons/collections/map/MultiValueMap.java
@@ -153,19 +153,19 @@ 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 boolean remove(Object key, Object value) {
Collection valuesForKey = getCollection(key);
if (valuesForKey == null) {
- return null;
+ return false;
}
boolean removed = valuesForKey.remove(value);
if (removed == false) {
- return null;
+ return false;
}
if (valuesForKey.isEmpty()) {
remove(key);
}
- return value;
+ return true;
}
/**
diff --git a/src/test/org/apache/commons/collections/TestMultiHashMap.java b/src/test/org/apache/commons/collections/TestMultiHashMap.java
index 722bec0..2268d85 100644
--- a/src/test/org/apache/commons/collections/TestMultiHashMap.java
+++ b/src/test/org/apache/commons/collections/TestMultiHashMap.java
@@ -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(false, map.remove("C", "CA"));
+ assertEquals(false, map.remove("A", "AD"));
+ assertEquals(true, map.remove("A", "AC"));
+ assertEquals(true, map.remove("A", "AB"));
+ assertEquals(true, map.remove("A", "AA"));
assertEquals(new MultiHashMap(), map);
}
diff --git a/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java b/src/test/org/apache/commons/collections/map/TestMultiKeyMap.java
index 6e528fb..9faabf7 100644
--- 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(true, multimap.remove(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(false, multimap.remove(key.getKey(0), key.getKey(1)));
assertEquals(false, multimap.containsKey(key.getKey(0), key.getKey(1)));
break;
case 3: