diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2019-10-06 19:08:14 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2019-10-06 19:08:14 +0000 |
commit | c937a4ccc9f8c084344ae2b95fda9e50dfe7ab03 (patch) | |
tree | d1f15965fd21b7db5e3b21c1d8dc8442e6e2f50e /java/apache-commons-collections | |
parent | bbc7901e66f498ae60a9b87b783813dc5fb0edf2 (diff) |
Notes
Diffstat (limited to 'java/apache-commons-collections')
-rw-r--r-- | java/apache-commons-collections/Makefile | 43 | ||||
-rw-r--r-- | java/apache-commons-collections/distinfo | 3 | ||||
-rw-r--r-- | java/apache-commons-collections/files/patch-jdk8 | 136 | ||||
-rw-r--r-- | java/apache-commons-collections/pkg-descr | 11 |
4 files changed, 193 insertions, 0 deletions
diff --git a/java/apache-commons-collections/Makefile b/java/apache-commons-collections/Makefile new file mode 100644 index 000000000000..16ab1601e58f --- /dev/null +++ b/java/apache-commons-collections/Makefile @@ -0,0 +1,43 @@ +# Created by: Ernst de Haan <znerd@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= commons-collections +PORTVERSION= 3.2.1 +CATEGORIES= java devel +MASTER_SITES= APACHE_COMMONS_SOURCE +PKGNAMEPREFIX= apache- +DISTNAME= ${PORTNAME}-${PORTVERSION}-src + +MAINTAINER= makc@FreeBSD.org +COMMENT= Classes that extend/augment the Java Collections Framework + +LICENSE= APACHE20 + +USES= dos2unix + +USE_JAVA= yes +JAVA_VERSION= 8+ +USE_ANT= yes +DOS2UNIX_GLOB= Multi*.java Test*.java + +ALL_TARGET= jar +PLIST_FILES= %%JAVAJARDIR%%/${PORTNAME}.jar +OTHERDOCS= DEVELOPERS-GUIDE.html LICENSE.txt PROPOSAL.html README.txt RELEASE-NOTES.html +PORTDOCS= apidocs ${OTHERDOCS} + +OPTIONS_DEFINE= DOCS + +DOCS_ALL_TARGET= javadoc + +do-install: + @${MKDIR} ${STAGEDIR}${JAVAJARDIR} + ${INSTALL_DATA} ${WRKSRC}/build/${PORTNAME}-${PORTVERSION}.jar \ + ${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + (cd ${WRKSRC}/build/docs && \ + ${COPYTREE_SHARE} apidocs ${STAGEDIR}${DOCSDIR}) + ${INSTALL_DATA} ${OTHERDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> diff --git a/java/apache-commons-collections/distinfo b/java/apache-commons-collections/distinfo new file mode 100644 index 000000000000..ef7c4127095b --- /dev/null +++ b/java/apache-commons-collections/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1570206793 +SHA256 (commons-collections-3.2.1-src.tar.gz) = 9a4a800cb7ecdaf3b6f608cd608682b88b506f1b1c4b727d15471ae3329fc63d +SIZE (commons-collections-3.2.1-src.tar.gz) = 609930 diff --git a/java/apache-commons-collections/files/patch-jdk8 b/java/apache-commons-collections/files/patch-jdk8 new file mode 100644 index 000000000000..b59963086a39 --- /dev/null +++ b/java/apache-commons-collections/files/patch-jdk8 @@ -0,0 +1,136 @@ +--- src/java/org/apache/commons/collections/MultiHashMap.java.orig 2019-10-04 16:36:43 UTC ++++ src/java/org/apache/commons/collections/MultiHashMap.java +@@ -331,21 +331,21 @@ public class MultiHashMap extends HashMap implements M + * @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; + } + + /** +--- src/java/org/apache/commons/collections/MultiMap.java.orig 2019-10-04 16:36:43 UTC ++++ 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. +--- src/java/org/apache/commons/collections/map/MultiKeyMap.java.orig 2019-10-04 16:36:43 UTC ++++ 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; + } + + /** +--- src/java/org/apache/commons/collections/map/MultiValueMap.java.orig 2019-10-04 16:36:43 UTC ++++ src/java/org/apache/commons/collections/map/MultiValueMap.java +@@ -153,19 +153,19 @@ public class MultiValueMap extends AbstractMapDecorato + * @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; + } + + /** +--- src/test/org/apache/commons/collections/TestMultiHashMap.java.orig 2019-10-04 16:36:43 UTC ++++ 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); + } + +--- src/test/org/apache/commons/collections/map/TestMultiKeyMap.java.orig 2019-10-04 16:36:43 UTC ++++ src/test/org/apache/commons/collections/map/TestMultiKeyMap.java +@@ -315,10 +315,10 @@ public class TestMultiKeyMap extends AbstractTestItera + 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: diff --git a/java/apache-commons-collections/pkg-descr b/java/apache-commons-collections/pkg-descr new file mode 100644 index 000000000000..82612041d587 --- /dev/null +++ b/java/apache-commons-collections/pkg-descr @@ -0,0 +1,11 @@ +A suite of classes that extend or augment the Java Collections Framework. + +Commons-Collections seek to build upon the JDK classes by providing new interfaces, implementations and utilities. There are many features, +including: + +Special-purpose implementations of Lists and Maps for fast access Adapter +classes from Java1-style containers (arrays, enumerations) to Java 2-style +collections. Methods to test or create typical set-theory properties of +collections such as union, intersection, and closure. + +WWW: http://commons.apache.org/proper/commons-collections/ |