From 297f7af4af21da68285238169f319475d7b6f425 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Thu, 25 Aug 2022 20:12:00 +0200 Subject: [PATCH 1/2] [COLLECTIONS-835] Fix links in javadoc and documentations - fix broken links, - use direct links instead of redirects, - use HTTPS where possible. --- NOTICE.txt | 2 +- pom.xml | 2 +- src/changes/release-notes.vm | 2 +- .../commons/collections4/ListUtils.java | 2 +- .../org/apache/commons/collections4/Trie.java | 2 +- .../map/AbstractReferenceMap.java | 2 +- .../collections4/map/ReferenceMap.java | 2 +- .../sequence/SequencesComparator.java | 4 +- .../collections4/sequence/package-info.java | 2 +- .../collections4/trie/PatriciaTrie.java | 6 +-- src/site/xdoc/building.xml | 2 +- src/site/xdoc/compatibility.xml | 2 +- src/site/xdoc/index.xml | 4 +- src/site/xdoc/issue-tracking.xml | 4 +- src/site/xdoc/mail-lists.xml | 36 ++++++------- src/site/xdoc/pick.xml | 52 +++++++++---------- src/site/xdoc/security-reports.xml | 8 +-- .../collections4/map/AbstractMapTest.java | 4 +- 18 files changed, 67 insertions(+), 71 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 5443db4e0..9dbd7a662 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -2,4 +2,4 @@ Apache Commons Collections Copyright 2001-2022 The Apache Software Foundation This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). +The Apache Software Foundation (https://www.apache.org/). diff --git a/pom.xml b/pom.xml index 2c55f08d7..6b11f3568 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ jira - http://issues.apache.org/jira/browse/COLLECTIONS + https://issues.apache.org/jira/browse/COLLECTIONS diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm index 99def1c96..c831b400b 100644 --- a/src/changes/release-notes.vm +++ b/src/changes/release-notes.vm @@ -20,7 +20,7 @@ $introduction.replaceAll("(? - * Adapted from http://code.google.com/p/guava-libraries/ + * Adapted from https://github.com/google/guava * * @param the element type * @param list the list to return consecutive sublists of diff --git a/src/main/java/org/apache/commons/collections4/Trie.java b/src/main/java/org/apache/commons/collections4/Trie.java index 9183a7d5d..253dc5375 100644 --- a/src/main/java/org/apache/commons/collections4/Trie.java +++ b/src/main/java/org/apache/commons/collections4/Trie.java @@ -20,7 +20,7 @@ import java.util.SortedMap; /** * Defines the interface for a prefix tree, an ordered tree data structure. For - * more information, see Tries. + * more information, see Tries. * * @param the type of the keys in this map * @param the type of the values in this map diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java index a55825e00..81e9ce534 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java @@ -63,7 +63,7 @@ import org.apache.commons.collections4.keyvalue.DefaultMapEntry; * Different types of references can be specified for keys and values. * The keys can be configured to be weak but the values hard, * in which case this class will behave like a - * + * * {@code WeakHashMap}. However, you can also specify hard keys and * weak values, or any other combination. The default constructor uses * hard keys and soft values, providing a memory-sensitive cache. diff --git a/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java index 186999285..0cc8db7ee 100644 --- a/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java @@ -36,7 +36,7 @@ import java.io.Serializable; * Different types of references can be specified for keys and values. * The keys can be configured to be weak but the values hard, * in which case this class will behave like a - * + * * {@code WeakHashMap}. However, you can also specify hard keys and * weak values, or any other combination. The default constructor uses * hard keys and soft values, providing a memory-sensitive cache. diff --git a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java index deca2cfad..0e279edc7 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java +++ b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java @@ -43,7 +43,7 @@ import org.apache.commons.collections4.functors.DefaultEquator; *

* This class implements the comparison algorithm, which is the very efficient * algorithm from Eugene W. Myers - * + * * An O(ND) Difference Algorithm and Its Variations. This algorithm produces * the shortest possible * {@link EditScript edit script} @@ -159,7 +159,7 @@ public class SequencesComparator { * The snake is found using the MYERS Algorithm (this algorithms has * also been implemented in the GNU diff program). This algorithm is * explained in Eugene Myers article: - * + * * An O(ND) Difference Algorithm and Its Variations. * * @param start1 the begin of the first sequence to be compared diff --git a/src/main/java/org/apache/commons/collections4/sequence/package-info.java b/src/main/java/org/apache/commons/collections4/sequence/package-info.java index 7902f7985..43e91cd14 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/package-info.java +++ b/src/main/java/org/apache/commons/collections4/sequence/package-info.java @@ -42,7 +42,7 @@ *

* The package uses a very efficient comparison algorithm designed by * Eugene W. Myers and described in his paper: An O(ND) + * href="https://www.cis.upenn.edu/~bcpierce/courses/dd/papers/diff.ps">An O(ND) * Difference Algorithm and Its Variations. This algorithm produces * the shortest possible * {@link org.apache.commons.collections4.sequence.EditScript edit script} containing diff --git a/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java index 8d2487d5f..f6930f435 100644 --- a/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java +++ b/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java @@ -57,9 +57,9 @@ import org.apache.commons.collections4.trie.analyzer.StringKeyAnalyzer; * * @param the type of the values in this map * - * @see Radix Tree - * @see PATRICIA - * @see Crit-Bit Tree + * @see Radix Tree + * @see PATRICIA + * @see Crit-Bit Tree * @since 4.0 */ public class PatriciaTrie extends AbstractPatriciaTrie { diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml index 504debed4..b094982f7 100644 --- a/src/site/xdoc/building.xml +++ b/src/site/xdoc/building.xml @@ -24,7 +24,7 @@

- Commons Collections uses Maven 3 as its + Commons Collections uses Maven 3 as its primary build system.

diff --git a/src/site/xdoc/compatibility.xml b/src/site/xdoc/compatibility.xml index 913a06ff4..5a9fc6205 100644 --- a/src/site/xdoc/compatibility.xml +++ b/src/site/xdoc/compatibility.xml @@ -44,7 +44,7 @@ There are two types of compatibility discussed here, source and binary. Two versions are binary compatible when application code compiled against one version will run using the other version without recompilation. This is much more difficult to test for, and follows quite complicated rules from the - Java language. + Java language.

diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index a45fd79aa..f523ad5f4 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -24,7 +24,7 @@

-The Java Collections Framework +The Java Collections Framework was a major addition in JDK 1.2. It added many powerful data structures that accelerate development of most significant Java applications. Since that time it has become the recognised standard for collection handling in Java. @@ -76,7 +76,7 @@ The latest version is 4.4 - It is built for Java 8 and later, and the release notes are also available.

-For previous releases, see the Apache Archive +For previous releases, see the Apache Archive

diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml index 46b8c23d6..e1a2f0516 100644 --- a/src/site/xdoc/issue-tracking.xml +++ b/src/site/xdoc/issue-tracking.xml @@ -57,7 +57,7 @@ limitations under the License.

To use JIRA you may need to create an account (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically - created and you can use the Forgot Password + created and you can use the Forgot Password page to get a new password).

@@ -86,7 +86,7 @@ limitations under the License.

For more information on subversion and creating patches see the - Apache Contributors Guide. + Apache Contributors Guide.

diff --git a/src/site/xdoc/mail-lists.xml b/src/site/xdoc/mail-lists.xml index a4573e733..45704c998 100644 --- a/src/site/xdoc/mail-lists.xml +++ b/src/site/xdoc/mail-lists.xml @@ -49,7 +49,7 @@ limitations under the License.

Apache Commons Collections shares mailing lists with all the other - Commons Components. + Commons Components. To make it easier for people to only read messages related to components they are interested in, the convention in Commons is to prefix the subject line of messages with the component's name, for example: @@ -59,9 +59,9 @@ limitations under the License.

Questions related to the usage of Apache Commons Collections should be posted to the - User List. + User List.
- The Developer List + The Developer List is for questions and discussion related to the development of Apache Commons Collections.
Please do not cross-post; developers are also subscribed to the user list. @@ -105,9 +105,9 @@ limitations under the License. Subscribe Unsubscribe Post - mail-archives.apache.org - markmail.org
- www.mail-archive.com
+ mail-archives.apache.org + markmail.org
+ www.mail-archive.com
news.gmane.org @@ -123,9 +123,9 @@ limitations under the License. Subscribe Unsubscribe Post - mail-archives.apache.org - markmail.org
- www.mail-archive.com
+ mail-archives.apache.org + markmail.org
+ www.mail-archive.com
news.gmane.org @@ -141,9 +141,9 @@ limitations under the License. Subscribe Unsubscribe read only - mail-archives.apache.org - markmail.org
- www.mail-archive.com + mail-archives.apache.org + markmail.org
+ www.mail-archive.com @@ -158,9 +158,9 @@ limitations under the License. Subscribe Unsubscribe read only - mail-archives.apache.org - markmail.org
- www.mail-archive.com + mail-archives.apache.org + markmail.org
+ www.mail-archive.com @@ -191,10 +191,10 @@ limitations under the License. Subscribe Unsubscribe read only - mail-archives.apache.org - markmail.org
+ mail-archives.apache.org + markmail.org
old.nabble.com
- www.mail-archive.com
+ www.mail-archive.com
news.gmane.org diff --git a/src/site/xdoc/pick.xml b/src/site/xdoc/pick.xml index a9bc1fdf0..736af561e 100644 --- a/src/site/xdoc/pick.xml +++ b/src/site/xdoc/pick.xml @@ -89,19 +89,19 @@ For example you could convert a country code to text but not text to coun

BidiMap interface

-The BidiMap interface and implementations in Commons Collections allow you to lookup data in both directions. There are three implementations: +The BidiMap interface and implementations in Commons Collections allow you to lookup data in both directions. There are three implementations: - - + + - - + + - - + +
DualHashBidiMapUses two HashMap objects internally. This implementation is a useful general purpose BidiMap that can store any object. The objects are stored in any order, and the order may change over time.DualHashBidiMapUses two HashMap objects internally. This implementation is a useful general purpose BidiMap that can store any object. The objects are stored in any order, and the order may change over time.
DualTreeBidiMapUses two TreeMap objects internally which means that keys and values must implement Comparable, unless a comparator is supplied. If considering this class, the TreeBidiMap is usually a better choice. However, this is the only implementation of the SortedBidiMap interface.DualTreeBidiMapUses two TreeMap objects internally which means that keys and values must implement Comparable, unless a comparator is supplied. If considering this class, the TreeBidiMap is usually a better choice. However, this is the only implementation of the SortedBidiMap interface.
TreeBidiMapDedicated implementation that requires keys and values to implement Comparable, unless a comparator is supplied. This is an efficient implementation using a data structure that avoids duplicating data. The keys and values are held and viewed in sorted order, and the class implements the OrderedBidiMap interface.TreeBidiMapDedicated implementation that requires keys and values to implement Comparable, unless a comparator is supplied. This is an efficient implementation using a data structure that avoids duplicating data. The keys and values are held and viewed in sorted order, and the class implements the OrderedBidiMap interface.

@@ -112,66 +112,62 @@ The Map interface and implementations in both the JDK and Commons Collections allow you to lookup data from a key to a value. This is one of the most powerful interfaces in the JDK, however it is very difficult to implement. These are the available implementations: +The Map interface and implementations in both the JDK and Commons Collections allow you to lookup data from a key to a value. This is one of the most powerful interfaces in the JDK, however it is very difficult to implement. These are the available implementations: - + - - + + - - - - - + - - + + - + - + - + - + - + - + - + - + - + - +
HashMap (JDK)HashMap (JDK) This map is the most commonly used and fastest implementation. It is suitable for most situations and can store any object. Objects are stored in any order, and the order may change over time.
HashedMapThe Commons Collections hash map implementation which is very similar in design to HashMap, but also supports easy iteration via a MapIterator. This implementation is also designed to be subclassed. Use this map if you want to use the extra iterator, or to subclass. Otherwise, there is no advantage (or disadvantage) compared to the JDK HashMap.HashedMapThe Commons Collections hash map implementation which is very similar in design to HashMap, but also supports easy iteration via a MapIterator. This implementation is also designed to be subclassed. Use this map if you want to use the extra iterator, or to subclass. Otherwise, there is no advantage (or disadvantage) compared to the JDK HashMap.
IdentityMapThis map operates exactly as per HashedMap but compares keys and values using == not .equals().
IdentityHashMap (JDK)IdentityHashMap (JDK) This map operates exactly as per HashMap but compares keys and values using == not .equals().
TreeMap (JDK)This map ensures that the keys are always sorted, and iteration order is consistent. All keys must implement Comparable, unless a comparator is supplied. This map should be used if you need the map to be sorted.TreeMap (JDK)This map ensures that the keys are always sorted, and iteration order is consistent. All keys must implement Comparable, unless a comparator is supplied. This map should be used if you need the map to be sorted.
LinkedMapLinkedMap This map maintains the order that each object is added to the map. When the map is viewed via an iterator, the insertion order will be seen. This map should be used if you need to retain the insertion order.
LinkedHashMap (JDK)LinkedHashMap (JDK) This map, available from JDK 1.4, maintains the order that each object is added to the map. When the map is viewed via an iterator, the insertion order will be seen. Commons collections' LinkedMap provides the same functionality for JDK1.2 onwards and provides a MapIterator.
ListOrderedMapListOrderedMap This map decorates another map to maintains the order that each object is added to the map. The order is maintained using a list. This map should be used if you need to retain the insertion order but you also need the special features of another map.
LRUMapLRUMap This map places a maximum size limit on the map and removes the least recently used (LRU) key-value when it is full. This map should be used for caches where you want to limit the maximum memory size used, and are happy with the least recently used algorithm for removals.
ReferenceMapReferenceMap This map enables keys and values to be garbage collected whilst still held in the map. This can be useful for building memory sensitive caches. This map should be used for caches where you want to allow garbage collection from the map.
WeakHashMap (JDK)WeakHashMap (JDK) This map stores each key-value pair with a key that can be garbage collected. This can be useful for building memory sensitive caches. ReferenceMap provides the same functionality but with much more flexibility.
ReferenceIdentityMapReferenceIdentityMap This map operates exactly as per ReferenceMap but compares keys and values using == not .equals().
SingletonMapSingletonMap This map is restricted to storing one key-value pair. It may contain no more than and no less than one pair. It provides a MapIterator. This map should be used if you want to return one key-value pair and must use the Map interface.
Flat3MapFlat3Map This map is optimised to store one, two or three key-value pairs and outperforms HashMap at these sizes. For size four and above performance is about 5% slower than HashMap. This map also has good garbage collection characteristics when below size four. It provides a MapIterator. This map should be used if are 99% sure that the map will be size three or less.
StaticBucketMapStaticBucketMap This map is optimised to work well in a heavily loaded multi-threaded environment. It provides synchronization internally, locking on a per 'bucket' basis, where the buckets are fixed at construction time. You should use this class if you can predict the size of the map and you are working in a very intensive multi-threaded environment.
diff --git a/src/site/xdoc/security-reports.xml b/src/site/xdoc/security-reports.xml index 95fe038a3..2e2e8322b 100644 --- a/src/site/xdoc/security-reports.xml +++ b/src/site/xdoc/security-reports.xml @@ -90,16 +90,16 @@
  1. Vulnerability Report for Oracle Weblogic Server: - CVE-2015-4852
  2. + CVE-2015-4852
  3. Vulnerability Report for Red Hat JBoss products: - CVE-2015-7501 + CVE-2015-7501 (Red Hat Portal)
  4. Apache Commons statement to widespread Java object de-serialisation vulnerability
  5. -
  6. +
  7. Presentation @ AppSecCali2015 by Lawrence and Frohoff
  8. -
  9. Attack scenarios +
  10. Attack scenarios for various products by Stephen Breen
diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java index c96edf814..ea28f3d40 100644 --- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java @@ -1213,8 +1213,8 @@ public abstract class AbstractMapTest extends AbstractObjectTest { * "removeValue" method.) *

*

- * See bug - * 9573. + * See bug + * COLLECTIONS-92. *

*/ @Test From 463d2cc57bf3377c9b654607ceadc48f010aeb0d Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Wed, 19 Oct 2022 14:08:05 +1300 Subject: [PATCH 2/2] [COLLECTIONS-835] Add change log and credit --- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index b1ab068fc..096e732c8 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -325,6 +325,9 @@ Correct test of Collection toArray(Object[]) vs toArray() to optionally ignore array order. Ordering is not specified for some collections such as Bags. + + Fix links in javadoc and documentations #325. +