Skip to content

Commit e602c60

Browse files
authored
HADOOP-15760. Upgrade commons-collections to commons-collections4 (#7006)
This moves Hadoop to Apache commons-collections4. Apache commons-collections has been removed and is completely banned from the source code. Contributed by Nihal Jain
1 parent f90a703 commit e602c60

File tree

57 files changed

+101
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+101
-65
lines changed

LICENSE-binary

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ com.zaxxer:HikariCP:4.0.3
246246
commons-beanutils:commons-beanutils:1.9.4
247247
commons-cli:commons-cli:1.5.0
248248
commons-codec:commons-codec:1.15
249-
commons-collections:commons-collections:3.2.2
249+
org.apache.commons:commons-collections4:4.4
250250
commons-daemon:commons-daemon:1.0.13
251251
commons-io:commons-io:2.16.1
252252
commons-net:commons-net:3.9.0
@@ -299,7 +299,6 @@ net.java.dev.jna:jna:5.2.0
299299
net.minidev:accessors-smart:1.2
300300
org.apache.avro:avro:1.9.2
301301
org.apache.avro:avro:1.11.3
302-
org.apache.commons:commons-collections4:4.2
303302
org.apache.commons:commons-compress:1.26.1
304303
org.apache.commons:commons-configuration2:2.10.1
305304
org.apache.commons:commons-csv:1.9.0

hadoop-client-modules/hadoop-client-minicluster/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@
168168
<groupId>commons-collections</groupId>
169169
<artifactId>commons-collections</artifactId>
170170
</exclusion>
171+
<exclusion>
172+
<groupId>org.apache.commons</groupId>
173+
<artifactId>commons-collections4</artifactId>
174+
</exclusion>
171175
<exclusion>
172176
<groupId>commons-io</groupId>
173177
<artifactId>commons-io</artifactId>

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@
182182
<groupId>log4j</groupId>
183183
<artifactId>log4j</artifactId>
184184
</exclusion>
185+
<exclusion>
186+
<groupId>commons-collections</groupId>
187+
<artifactId>commons-collections</artifactId>
188+
</exclusion>
185189
</exclusions>
186190
</dependency>
187191
<dependency>

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
<scope>compile</scope>
8989
</dependency>
9090
<dependency>
91-
<groupId>commons-collections</groupId>
92-
<artifactId>commons-collections</artifactId>
91+
<groupId>org.apache.commons</groupId>
92+
<artifactId>commons-collections4</artifactId>
9393
<scope>compile</scope>
9494
</dependency>
9595
<dependency>
@@ -211,6 +211,12 @@
211211
<groupId>commons-beanutils</groupId>
212212
<artifactId>commons-beanutils</artifactId>
213213
<scope>compile</scope>
214+
<exclusions>
215+
<exclusion>
216+
<groupId>commons-collections</groupId>
217+
<artifactId>commons-collections</artifactId>
218+
</exclusion>
219+
</exclusions>
214220
</dependency>
215221
<dependency>
216222
<groupId>org.apache.commons</groupId>

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
import javax.xml.transform.dom.DOMSource;
8585
import javax.xml.transform.stream.StreamResult;
8686

87-
import org.apache.commons.collections.map.UnmodifiableMap;
87+
import org.apache.commons.collections4.map.UnmodifiableMap;
8888
import org.apache.hadoop.classification.InterfaceAudience;
8989
import org.apache.hadoop.classification.InterfaceStability;
9090
import org.apache.hadoop.classification.VisibleForTesting;
@@ -511,9 +511,9 @@ private static class DeprecationContext {
511511
}
512512
}
513513
this.deprecatedKeyMap =
514-
UnmodifiableMap.decorate(newDeprecatedKeyMap);
514+
UnmodifiableMap.unmodifiableMap(newDeprecatedKeyMap);
515515
this.reverseDeprecatedKeyMap =
516-
UnmodifiableMap.decorate(newReverseDeprecatedKeyMap);
516+
UnmodifiableMap.unmodifiableMap(newReverseDeprecatedKeyMap);
517517
}
518518

519519
Map<String, DeprecatedKeyInfo> getDeprecatedKeyMap() {

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import java.util.jar.Manifest;
5858
import java.util.zip.GZIPInputStream;
5959

60-
import org.apache.commons.collections.map.CaseInsensitiveMap;
60+
import org.apache.commons.collections4.map.CaseInsensitiveMap;
6161
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
6262
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
6363
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/JniBasedUnixGroupsMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.List;
2525
import java.util.Set;
2626

27-
import org.apache.commons.collections.CollectionUtils;
27+
import org.apache.commons.collections4.CollectionUtils;
2828
import org.apache.hadoop.classification.InterfaceAudience;
2929
import org.apache.hadoop.classification.InterfaceStability;
3030

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSUtilClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
package org.apache.hadoop.hdfs;
1919

20-
import org.apache.commons.collections.list.TreeList;
20+
import org.apache.commons.collections4.list.TreeList;
2121
import org.apache.hadoop.ipc.RpcNoSuchMethodException;
2222
import org.apache.hadoop.net.DomainNameResolver;
2323
import org.apache.hadoop.thirdparty.com.google.common.base.Joiner;

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Collections;
2525
import java.util.Map;
2626

27-
import org.apache.commons.collections.map.LRUMap;
27+
import org.apache.commons.collections4.map.LRUMap;
2828
import org.apache.hadoop.classification.InterfaceAudience;
2929
import org.apache.hadoop.hdfs.web.WebHdfsConstants;
3030
import org.apache.hadoop.io.Text;

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/shortcircuit/ShortCircuitCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import java.util.concurrent.locks.Condition;
3434
import java.util.concurrent.locks.ReentrantLock;
3535

36-
import org.apache.commons.collections.map.LinkedMap;
36+
import org.apache.commons.collections4.map.LinkedMap;
3737
import org.apache.commons.lang3.mutable.MutableBoolean;
3838
import org.apache.hadoop.classification.InterfaceAudience;
3939
import org.apache.hadoop.hdfs.ExtendedBlockId;

0 commit comments

Comments
 (0)