import apache-commons-collections-3.2.2-10.module+el8+2598+06babf2e
This commit is contained in:
commit
640f244b44
1
.apache-commons-collections.metadata
Normal file
1
.apache-commons-collections.metadata
Normal file
@ -0,0 +1 @@
|
||||
52c16551286bd9749616b2c44a95193953858959 SOURCES/commons-collections-3.2.2-src.tar.gz
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/commons-collections-3.2.2-src.tar.gz
|
165
SOURCES/0001-Port-to-Java-8.patch
Normal file
165
SOURCES/0001-Port-to-Java-8.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From 066f654cd6a1b9d3bfd54565af1d618dada2deb4 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Simacek <msimacek@redhat.com>
|
||||
Date: Tue, 17 Nov 2015 01:02:55 +0100
|
||||
Subject: [PATCH] Port to Java 8
|
||||
|
||||
---
|
||||
src/java/org/apache/commons/collections/MultiHashMap.java | 8 ++++----
|
||||
src/java/org/apache/commons/collections/MultiMap.java | 4 ++--
|
||||
src/java/org/apache/commons/collections/map/MultiKeyMap.java | 8 +++++---
|
||||
src/java/org/apache/commons/collections/map/MultiValueMap.java | 8 ++++----
|
||||
src/test/org/apache/commons/collections/TestMultiHashMap.java | 10 +++++-----
|
||||
.../org/apache/commons/collections/map/TestMultiKeyMap.java | 4 ++--
|
||||
6 files changed, 22 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/src/java/org/apache/commons/collections/MultiHashMap.java b/src/java/org/apache/commons/collections/MultiHashMap.java
|
||||
index 7fec9af..bcb4a11 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 be9455b..4d9cc7d 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 9e3e02d..969d11e 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 f44999b..79938dc 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 eca833a..f47c6f9 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 b1ee3d0..66fcade 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:
|
||||
--
|
||||
2.5.0
|
||||
|
197
SPECS/apache-commons-collections.spec
Normal file
197
SPECS/apache-commons-collections.spec
Normal file
@ -0,0 +1,197 @@
|
||||
%global base_name collections
|
||||
%global short_name commons-%{base_name}
|
||||
|
||||
Name: apache-%{short_name}
|
||||
Version: 3.2.2
|
||||
Release: 10%{?dist}
|
||||
Summary: Provides new interfaces, implementations and utilities for Java Collections
|
||||
License: ASL 2.0
|
||||
URL: http://commons.apache.org/%{base_name}/
|
||||
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
|
||||
|
||||
Patch0: 0001-Port-to-Java-8.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: ant
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
||||
|
||||
%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: Testframework for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description testframework
|
||||
%{summary}.
|
||||
|
||||
%package javadoc
|
||||
Summary: Javadoc for %{name}
|
||||
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" -exec rm -f {} \;
|
||||
find . -name "*.class" -exec rm -f {} \;
|
||||
|
||||
%patch0 -p1
|
||||
|
||||
# Fix file eof
|
||||
sed -i 's/\r//' LICENSE.txt PROPOSAL.html README.txt NOTICE.txt
|
||||
|
||||
%mvn_package :%{short_name}-testframework testframework
|
||||
%mvn_file ':%{short_name}{,-testframework}' %{name}@1 %{short_name}@1
|
||||
|
||||
%build
|
||||
# 2017-09-18 mizdebsk: Temporarly disable tests, they stopped working
|
||||
# after Maven Surefire upgrade to 2.20, need to investigate why.
|
||||
%mvn_build -- -DskipTests
|
||||
|
||||
ant tf.javadoc -Dtf.build.docs=target/site/apidocs/
|
||||
|
||||
%mvn_artifact %{short_name}:%{short_name}-testframework:%{version} target/%{short_name}-testframework-%{version}.jar
|
||||
|
||||
%install
|
||||
%mvn_install
|
||||
|
||||
%files -f .mfiles
|
||||
%doc PROPOSAL.html README.txt
|
||||
%license LICENSE.txt NOTICE.txt
|
||||
|
||||
%files testframework -f .mfiles-testframework
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%license LICENSE.txt NOTICE.txt
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Thu Jul 12 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.2-9
|
||||
- Remove workaround for symlink->directory rpm bug
|
||||
|
||||
* Tue Apr 24 2018 Mat Booth <mat.booth@redhat.com> - 3.2.2-8
|
||||
- Allow testframework to still be built even with tests disabled, which is
|
||||
needed by other packages
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Mon Sep 18 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.2-6
|
||||
- Temporarly disable running tests
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Wed Mar 23 2016 Michael Simacek <msimacek@redhat.com> - 3.2.2-3
|
||||
- Add workaround for symlink->directory rpm bug
|
||||
|
||||
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Mon Nov 16 2015 Michael Simacek <msimacek@redhat.com> - 3.2.2-1
|
||||
- Update to upstream version 3.2.2
|
||||
- Merge two javadoc subpackages
|
||||
- Install with XMVn
|
||||
- Specfile cleanup
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-26
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Thu Oct 23 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-25
|
||||
- Remove requires on apache-commons-parent
|
||||
|
||||
* Fri Oct 17 2014 Timothy St. Clair <tstclair@redhat.com> - 3.2.1-24
|
||||
- Fix broken Java 8 build
|
||||
|
||||
* Tue Oct 14 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-23
|
||||
- Remove legacy Obsoletes/Provides for jakarta-commons
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-22
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed May 21 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-21
|
||||
- Use .mfiles generated during build
|
||||
|
||||
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.2.1-20
|
||||
- Use Requires: java-headless rebuild (#1067528)
|
||||
|
||||
* Mon Aug 12 2013 Mat Booth <fedora@matbooth.co.uk> - 3.2.1-19
|
||||
- Fix FTBFS rhbz #991965
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-18
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Mon Apr 29 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-17
|
||||
- Remove unneeded BR: maven-idea-plugin
|
||||
|
||||
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-16
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 3.2.1-15
|
||||
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
|
||||
- Replace maven BuildRequires with maven-local
|
||||
|
||||
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Wed Feb 08 2012 Jaromir Capik <jcapik@redhat.com> 3.2.1-13
|
||||
- saxon dependency removed - not needed
|
||||
- minor spec file changes according to the latest guidelines
|
||||
|
||||
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Jun 6 2011 Chris Spike <spike@fedoraproject.org> 3.2.1-11
|
||||
- Added *-testframework depmap entries.
|
||||
|
||||
* Wed Mar 16 2011 Alexander Kurtakov <akurtako@redhat.com> 3.2.1-10
|
||||
- Drop tomcat5 subpackage.
|
||||
|
||||
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Mon Nov 8 2010 Alexander Kurtakov <akurtako@redhat.com> 3.2.1-8
|
||||
- Add commons-collections:commons-collections depmap.
|
||||
|
||||
* Mon Oct 4 2010 Alexander Kurtakov <akurtako@redhat.com> 3.2.1-7
|
||||
- Fix pom name.
|
||||
- Use newer maven plugins names.
|
||||
|
||||
* Tue Aug 31 2010 Carl Green <carlgreen at gmail.com> - 3.2.1-6
|
||||
- Change package to own files in directories, not the directories
|
||||
|
||||
* Mon Aug 30 2010 Carl Green <carlgreen at gmail.com> - 3.2.1-5
|
||||
- Remove source and patches no longer needed for Maven
|
||||
- Fix non-standard groups and remove empty sections
|
||||
- Fix file permissions
|
||||
|
||||
* Sat Aug 28 2010 Carl Green <carlgreen at gmail.com> - 3.2.1-4
|
||||
- Renamed from jakarta-commons-collections
|
||||
- Updated to use maven2
|
||||
- Replaced saxon:group instruction with xsl:for-each-group in pom-maven2jpp-newdepmap.xsl
|
Loading…
Reference in New Issue
Block a user