From b02522fb2278f5581b777f3c8a1297649e66c2f2 Mon Sep 17 00:00:00 2001 From: skumar34 Date: Thu, 7 Nov 2024 21:54:18 +0530 Subject: [PATCH] [AMBARI-26185] Upgrade commons-collections to resolve CVEs --- ambari-agent/pom.xml | 5 +++-- ambari-agent/src/packages/tarball/all.xml | 2 +- ambari-project/pom.xml | 10 ++++----- ambari-server/pom.xml | 21 ++++++++++--------- .../server/actionmanager/ActionScheduler.java | 2 +- .../ambari/server/agent/HeartBeatHandler.java | 2 +- .../server/agent/HeartbeatProcessor.java | 2 +- .../agent/stomp/AgentConfigsHolder.java | 2 +- .../agent/stomp/AlertDefinitionsHolder.java | 2 +- .../agent/stomp/HostLevelParamsHolder.java | 2 +- .../server/agent/stomp/MetadataHolder.java | 4 ++-- .../server/agent/stomp/TopologyHolder.java | 2 +- .../agent/stomp/dto/TopologyCluster.java | 4 ++-- .../agent/stomp/dto/TopologyComponent.java | 4 ++-- .../ConfigurationRecommendationCommand.java | 2 +- .../commands/StackAdvisorCommand.java | 2 +- ...csHadoopSinkVersionCompatibilityCheck.java | 2 +- .../DatabaseConsistencyCheckHelper.java | 2 +- .../ambari/server/collections/Predicate.java | 4 ++-- .../collections/functors/AndPredicate.java | 8 +++---- .../functors/ContextTransformer.java | 2 +- .../DelegatedMultiplePredicateContainer.java | 8 +++---- .../DelegatedSinglePredicateContainer.java | 8 +++---- .../collections/functors/EqualsPredicate.java | 8 +++---- .../collections/functors/NotPredicate.java | 8 +++---- .../functors/OperationPredicate.java | 8 +++---- .../collections/functors/OrPredicate.java | 8 +++---- .../AmbariManagementControllerImpl.java | 4 ++-- .../controller/DeleteIdentityHandler.java | 2 +- .../server/controller/KerberosHelperImpl.java | 2 +- .../RootServiceResponseFactory.java | 4 ++-- .../internal/AbstractProviderModule.java | 4 ++-- .../ClusterStackVersionResourceProvider.java | 2 +- .../internal/ConfigGroupResourceProvider.java | 2 +- .../HostStackVersionResourceProvider.java | 2 +- .../RepositoryVersionResourceProvider.java | 2 +- ...omponentConfigurationResourceProvider.java | 2 +- .../internal/ServiceResourceProvider.java | 2 +- .../internal/UpgradeResourceProvider.java | 2 +- .../LogSearchDataRetrievalService.java | 2 +- .../logging/LoggingRequestHelperImpl.java | 2 +- .../publishers/AgentCommandsPublisher.java | 2 +- .../system/impl/AmbariMetricSinkImpl.java | 2 +- .../orm/dao/ConfigGroupHostMappingDAO.java | 4 ++-- .../server/orm/dao/HostConfigMappingDAO.java | 4 ++-- .../server/orm/dao/HostRoleCommandDAO.java | 2 +- .../server/orm/dao/KerberosKeytabDAO.java | 2 +- .../orm/dao/KerberosKeytabPrincipalDAO.java | 2 +- .../server/orm/dao/KerberosPrincipalDAO.java | 2 +- .../ambari/server/orm/dao/RequestDAO.java | 2 +- .../dao/ServiceComponentDesiredStateDAO.java | 2 +- .../server/orm/dao/ServiceConfigDAO.java | 4 ++-- .../ambari/server/orm/dao/StageDAO.java | 2 +- .../AmbariAuthToLocalUserDetailsService.java | 2 +- .../AmbariLdapAuthenticationProvider.java | 2 +- .../server/security/authorization/Users.java | 2 +- .../encryption/PropertiesEncryptor.java | 2 +- .../AbstractPrepareKerberosServerAction.java | 2 +- .../DestroyPrincipalsServerAction.java | 4 ++-- .../kerberos/IPAKerberosOperationHandler.java | 2 +- .../kerberos/KDCKerberosOperationHandler.java | 2 +- .../kerberos/MITKerberosOperationHandler.java | 2 +- .../PrepareDisableKerberosServerAction.java | 2 +- ...PrepareKerberosIdentitiesServerAction.java | 2 +- .../stageutils/KerberosKeytabController.java | 2 +- ...eleteUnsupportedServicesAndComponents.java | 2 +- .../upgrades/PreconfigureKerberosAction.java | 4 ++-- .../apache/ambari/server/stack/RepoUtil.java | 2 +- .../ambari/server/stack/StackContext.java | 2 +- .../stack/upgrade/ColocatedGrouping.java | 2 +- .../stack/upgrade/HostOrderGrouping.java | 2 +- .../server/stack/upgrade/UpgradePack.java | 2 +- .../ParallelClientGroupingBuilder.java | 2 +- .../upgrade/orchestrate/StageWrapper.java | 2 +- .../orchestrate/StageWrapperBuilder.java | 2 +- .../orchestrate/TaskWrapperBuilder.java | 2 +- .../upgrade/orchestrate/UpgradeContext.java | 2 +- .../upgrade/orchestrate/UpgradeHelper.java | 2 +- .../ambari/server/state/CheckHelper.java | 2 +- .../ambari/server/state/ConfigHelper.java | 4 ++-- .../server/state/ConfigMergeHelper.java | 2 +- .../ambari/server/state/DependencyInfo.java | 2 +- .../server/state/ServiceComponentImpl.java | 4 ++-- .../server/state/ServiceComponentSupport.java | 2 +- .../server/state/cluster/ClusterImpl.java | 4 ++-- .../kerberos/KerberosIdentityDescriptor.java | 2 +- .../server/state/stack/RepoVdfCallable.java | 2 +- .../state/stack/StackRoleCommandOrder.java | 2 +- .../topology/ClusterConfigurationRequest.java | 2 +- .../server/upgrade/UpgradeCatalog252.java | 2 +- .../server/upgrade/UpgradeCatalog270.java | 2 +- .../server/upgrade/UpgradeCatalog271.java | 2 +- .../ambari/server/view/ViewRegistry.java | 2 +- .../actionmanager/TestActionManager.java | 2 +- .../agent/stomp/AgentDataHolderTest.java | 2 +- .../server/api/AmbariErrorHandlerTest.java | 9 ++++---- .../services/DeleteResultMetaDataTest.java | 2 +- .../DatabaseConsistencyCheckHelperTest.java | 2 +- .../collections/PredicateUtilsTest.java | 2 +- ...mbariCustomCommandExecutionHelperTest.java | 2 +- .../AmbariManagementControllerTest.java | 4 ++-- .../ClientConfigResourceProviderTest.java | 1 - .../internal/DeleteStatusMetaDataTest.java | 2 +- .../internal/UpgradeResourceProviderTest.java | 2 +- .../ganglia/GangliaPropertyProviderTest.java | 4 ++-- .../PreconfigureKerberosActionTest.java | 2 +- .../ambari/server/state/ServiceTest.java | 2 +- .../server/state/cluster/ClusterImplTest.java | 2 +- .../kerberos/KerberosDescriptorTest.java | 2 +- ambari-utility/pom.xml | 9 ++++---- contrib/views/pom.xml | 6 +++--- 111 files changed, 173 insertions(+), 172 deletions(-) diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml index f1587d2bfaa..6df63da55f0 100644 --- a/ambari-agent/pom.xml +++ b/ambari-agent/pom.xml @@ -75,8 +75,9 @@ commons-cli - commons-collections - commons-collections + org.apache.commons + commons-collections4 + 4.4 commons-configuration diff --git a/ambari-agent/src/packages/tarball/all.xml b/ambari-agent/src/packages/tarball/all.xml index 62ab5be8709..50e5d4265e1 100644 --- a/ambari-agent/src/packages/tarball/all.xml +++ b/ambari-agent/src/packages/tarball/all.xml @@ -240,7 +240,7 @@ false commons-cli:commons-cli - commons-collections:commons-collections + org.apache.commons:commons-collections4 commons-configuration:commons-configuration commons-io:commons-io commons-lang:commons-lang diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index 5f343320378..b1b0f136296 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -109,9 +109,9 @@ 1.3.1 - commons-collections - commons-collections - 3.2.2 + org.apache.commons + commons-collections4 + 4.4 commons-beanutils @@ -119,8 +119,8 @@ 1.9.4 - commons-collections - commons-collections + org.apache.commons + commons-collections4 diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 69f1422794e..e8268d4d3a9 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1174,8 +1174,9 @@ ${project.version} - commons-collections - commons-collections + org.apache.commons + commons-collections4 + 4.4 commons-beanutils @@ -1633,8 +1634,8 @@ 2.3 - commons-collections - commons-collections + org.apache.commons + commons-collections4 @@ -1770,8 +1771,8 @@ ${hadoop.version} - commons-collections - commons-collections + org.apache.commons + commons-collections4 commons-beanutils @@ -1869,8 +1870,8 @@ provided - commons-collections - commons-collections + org.apache.commons + commons-collections4 commons-beanutils @@ -1909,8 +1910,8 @@ 2.0.0-M24 - commons-collections - commons-collections + org.apache.commons + commons-collections4 org.apache.directory.api diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java index 6c9252d37ec..17c6e94fd54 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java @@ -70,7 +70,7 @@ import org.apache.ambari.server.state.fsm.InvalidStateTransitionException; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpFailedEvent; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java index 3b1f572868f..4e79f0154e6 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java @@ -54,7 +54,7 @@ import org.apache.ambari.server.state.host.HostRegistrationRequestEvent; import org.apache.ambari.server.state.host.HostStatusUpdatesReceivedEvent; import org.apache.ambari.server.utils.VersionUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java index 1d17ff245b6..7af01b1a273 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java @@ -76,7 +76,7 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartedEvent; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStoppedEvent; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentConfigsHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentConfigsHolder.java index 5845f90da91..22eebe909e2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentConfigsHolder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentConfigsHolder.java @@ -29,7 +29,7 @@ import org.apache.ambari.server.state.ConfigHelper; import org.apache.ambari.server.state.Host; import org.apache.ambari.server.utils.ThreadPools; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AlertDefinitionsHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AlertDefinitionsHolder.java index 6f3723f3607..30faa16be46 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AlertDefinitionsHolder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AlertDefinitionsHolder.java @@ -45,7 +45,7 @@ import org.apache.ambari.server.state.alert.AlertDefinitionFactory; import org.apache.ambari.server.state.alert.AlertDefinitionHash; import org.apache.ambari.server.state.alert.AlertHelper; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java index ce96cbdb286..5c0efd5b42a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/HostLevelParamsHolder.java @@ -36,7 +36,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.Host; import org.apache.ambari.server.state.ServiceComponentHost; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import com.google.common.eventbus.Subscribe; import com.google.inject.Inject; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java index 8fd895163ed..f0fbf250260 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/MetadataHolder.java @@ -33,8 +33,8 @@ import org.apache.ambari.server.events.publishers.AmbariEventPublisher; import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import com.google.common.eventbus.Subscribe; import com.google.inject.Inject; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java index 4eb877ce672..4ee2088e4f4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/TopologyHolder.java @@ -43,7 +43,7 @@ import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponent; import org.apache.ambari.server.state.ServiceComponentHost; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyCluster.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyCluster.java index 272f1e189f1..10996081dbf 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyCluster.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyCluster.java @@ -23,8 +23,8 @@ import org.apache.ambari.server.NullHostNameException; import org.apache.ambari.server.events.UpdateEventType; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.SetUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.SetUtils; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyComponent.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyComponent.java index 1351e79e6a0..2e902f7fdeb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyComponent.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/TopologyComponent.java @@ -24,8 +24,8 @@ import java.util.TreeMap; import org.apache.ambari.server.state.State; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommand.java index 5bd7cae9e25..a643bac7b52 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommand.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommand.java @@ -33,7 +33,7 @@ import org.apache.ambari.server.api.services.stackadvisor.recommendations.RecommendationResponse.HostGroup; import org.apache.ambari.server.controller.internal.AmbariServerConfigurationHandler; import org.apache.ambari.server.state.ServiceInfo; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.codehaus.jackson.JsonNode; /** diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java index e7a8fba4901..2bada444856 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java @@ -52,7 +52,7 @@ import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.state.ServiceInfo; import org.apache.ambari.server.utils.DateUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.codehaus.jackson.JsonNode; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCompatibilityCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCompatibilityCheck.java index 4891ea7e937..0e484f76723 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCompatibilityCheck.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCompatibilityCheck.java @@ -50,7 +50,7 @@ import org.apache.ambari.spi.upgrade.UpgradeCheckResult; import org.apache.ambari.spi.upgrade.UpgradeCheckStatus; import org.apache.ambari.spi.upgrade.UpgradeCheckType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java index 81153ea7e74..5f2c4918170 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java @@ -72,7 +72,7 @@ import org.apache.ambari.server.state.UpgradeState; import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.utils.VersionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/Predicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/Predicate.java index f7e20ddcf2f..42c816700e1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/Predicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/Predicate.java @@ -23,10 +23,10 @@ import com.google.gson.Gson; /** - * {@link Predicate} wraps {@link org.apache.commons.collections.Predicate} to + * {@link Predicate} wraps {@link org.apache.commons.collections4.Predicate} to * provide additional functionality like serializing to and from a Map and JSON formatted data. */ -public abstract class Predicate implements org.apache.commons.collections.Predicate { +public abstract class Predicate implements org.apache.commons.collections4.Predicate { /** * The name of this predicate. For example "and", "or", etc... diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/AndPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/AndPredicate.java index 737e5407598..bc32e3d0d65 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/AndPredicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/AndPredicate.java @@ -23,11 +23,11 @@ import java.util.Map; import org.apache.ambari.server.collections.PredicateUtils; -import org.apache.commons.collections.Predicate; -import org.apache.commons.collections.functors.PredicateDecorator; +import org.apache.commons.collections4.Predicate; +import org.apache.commons.collections4.functors.PredicateDecorator; /** - * {@link AndPredicate} wraps {@link org.apache.commons.collections.functors.AndPredicate} to + * {@link AndPredicate} wraps {@link org.apache.commons.collections4.functors.AndPredicate} to * provide additional functionality like serializing to and from a Map and JSON formatted data. *

* See {@link DelegatedMultiplePredicateContainer} @@ -80,7 +80,7 @@ public static AndPredicate fromMap(Map map) { */ public AndPredicate(Predicate predicate1, Predicate predicate2) { super(NAME, - (PredicateDecorator) org.apache.commons.collections.functors.AndPredicate.getInstance(predicate1, predicate2)); + (PredicateDecorator) org.apache.commons.collections4.functors.AndPredicate.andPredicate(predicate1, predicate2)); } @Override diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/ContextTransformer.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/ContextTransformer.java index af20eafcf60..e4bf8cabc8b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/ContextTransformer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/ContextTransformer.java @@ -20,7 +20,7 @@ import java.util.Map; -import org.apache.commons.collections.Transformer; +import org.apache.commons.collections4.Transformer; /** * {@link ContextTransformer} is a {@link Transformer} implementation that traverses a {@link Map} diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedMultiplePredicateContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedMultiplePredicateContainer.java index 229f1ec6dc1..271c3dd3524 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedMultiplePredicateContainer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedMultiplePredicateContainer.java @@ -24,7 +24,7 @@ import java.util.Map; import org.apache.ambari.server.collections.Predicate; -import org.apache.commons.collections.functors.PredicateDecorator; +import org.apache.commons.collections4.functors.PredicateDecorator; /** * DelegatedMultiplePredicateContainer is an abstract class providing functionality related to @@ -60,7 +60,7 @@ public boolean evaluate(Object o) { } @Override - public org.apache.commons.collections.Predicate[] getPredicates() { + public org.apache.commons.collections4.Predicate[] getPredicates() { return delegate.getPredicates(); } @@ -95,10 +95,10 @@ private List> containedPredicatesToMaps() { List> list = new ArrayList<>(); if (delegate != null) { - org.apache.commons.collections.Predicate[] predicates = delegate.getPredicates(); + org.apache.commons.collections4.Predicate[] predicates = delegate.getPredicates(); if (predicates != null) { - for (org.apache.commons.collections.Predicate p : predicates) { + for (org.apache.commons.collections4.Predicate p : predicates) { if (p instanceof Predicate) { list.add(((Predicate) p).toMap()); } else { diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedSinglePredicateContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedSinglePredicateContainer.java index ed441519c88..dd0cf7f7506 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedSinglePredicateContainer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/DelegatedSinglePredicateContainer.java @@ -22,7 +22,7 @@ import java.util.Map; import org.apache.ambari.server.collections.Predicate; -import org.apache.commons.collections.functors.PredicateDecorator; +import org.apache.commons.collections4.functors.PredicateDecorator; /** * DelegatedSinglePredicateContainer is an abstract class providing functionality to managing a @@ -57,7 +57,7 @@ public boolean evaluate(Object o) { } @Override - public org.apache.commons.collections.Predicate[] getPredicates() { + public org.apache.commons.collections4.Predicate[] getPredicates() { return delegate.getPredicates(); } @@ -92,11 +92,11 @@ private Map containedPredicateToMap() { Map map = null; if (delegate != null) { - org.apache.commons.collections.Predicate[] predicates = delegate.getPredicates(); + org.apache.commons.collections4.Predicate[] predicates = delegate.getPredicates(); if ((predicates != null) && (predicates.length > 0)) { // Only process the 1st predicate. - org.apache.commons.collections.Predicate p = predicates[0]; + org.apache.commons.collections4.Predicate p = predicates[0]; if (p instanceof Predicate) { map = ((Predicate) p).toMap(); } else { diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/EqualsPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/EqualsPredicate.java index f1bba47093f..2749c06f953 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/EqualsPredicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/EqualsPredicate.java @@ -26,10 +26,10 @@ import java.util.Map; import org.apache.ambari.server.collections.Predicate; -import org.apache.commons.collections.functors.EqualPredicate; +import org.apache.commons.collections4.functors.EqualPredicate; /** - * {@link EqualsPredicate} wraps {@link org.apache.commons.collections.functors.EqualPredicate} to + * {@link EqualsPredicate} wraps {@link org.apache.commons.collections4.functors.EqualPredicate} to * provide additional functionality like serializing to and from a Map and JSON formatted data as well * as obtaining data using a {@link ContextTransformer} */ @@ -41,9 +41,9 @@ public class EqualsPredicate extends OperationPredicate { public static final String NAME = "equals"; /** - * The {@link org.apache.commons.collections.functors.EqualPredicate} to delegate operations to + * The {@link org.apache.commons.collections4.functors.EqualPredicate} to delegate operations to */ - private final org.apache.commons.collections.functors.EqualPredicate delegate; + private final org.apache.commons.collections4.functors.EqualPredicate delegate; /** * Creates a new {@link EqualsPredicate} using the given {@link Map} of data. diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/NotPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/NotPredicate.java index 72ad788004c..15b4ee672c7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/NotPredicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/NotPredicate.java @@ -21,11 +21,11 @@ import java.util.Map; import org.apache.ambari.server.collections.PredicateUtils; -import org.apache.commons.collections.Predicate; -import org.apache.commons.collections.functors.PredicateDecorator; +import org.apache.commons.collections4.Predicate; +import org.apache.commons.collections4.functors.PredicateDecorator; /** - * {@link NotPredicate} wraps {@link org.apache.commons.collections.functors.NotPredicate} to + * {@link NotPredicate} wraps {@link org.apache.commons.collections4.functors.NotPredicate} to * provide additional functionality like serializing to and from a Map and JSON formatted data. *

* See {@link DelegatedSinglePredicateContainer} @@ -64,7 +64,7 @@ public static NotPredicate fromMap(Map map) { */ public NotPredicate(Predicate predicate) { super(NAME, - (PredicateDecorator) org.apache.commons.collections.functors.NotPredicate.getInstance(predicate)); + (PredicateDecorator) org.apache.commons.collections4.functors.NotPredicate.notPredicate(predicate)); } @Override diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OperationPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OperationPredicate.java index c57f7c262e7..f52d2302710 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OperationPredicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OperationPredicate.java @@ -19,12 +19,12 @@ package org.apache.ambari.server.collections.functors; import org.apache.ambari.server.collections.Predicate; -import org.apache.commons.collections.Transformer; +import org.apache.commons.collections4.Transformer; /** * OperationPredicate is an abstract class providing functionality of transforming the input context * before executing the implementation-specific - * {@link org.apache.commons.collections.Predicate#evaluate(Object)} method. + * {@link org.apache.commons.collections4.Predicate#evaluate(Object)} method. */ abstract class OperationPredicate extends Predicate { /** @@ -66,7 +66,7 @@ public void setTransformer(ContextTransformer transformer) { * Gets the context key assigned to the {@link ContextTransformer}. *

* This key is used to identify which value from the context a passed to the - * {@link org.apache.commons.collections.Predicate#evaluate(Object)} method + * {@link org.apache.commons.collections4.Predicate#evaluate(Object)} method * * @return a key name */ @@ -105,7 +105,7 @@ public boolean equals(Object obj) { * * @param data the transformed data to use * @return the result of the evaluation (true, false) - * @see org.apache.commons.collections.Predicate#evaluate(Object) + * @see org.apache.commons.collections4.Predicate#evaluate(Object) */ protected abstract boolean evaluateTransformedData(Object data); diff --git a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OrPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OrPredicate.java index 4134c654fd4..5b2b4e10ba4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OrPredicate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/collections/functors/OrPredicate.java @@ -23,11 +23,11 @@ import java.util.Map; import org.apache.ambari.server.collections.PredicateUtils; -import org.apache.commons.collections.Predicate; -import org.apache.commons.collections.functors.PredicateDecorator; +import org.apache.commons.collections4.Predicate; +import org.apache.commons.collections4.functors.PredicateDecorator; /** - * {@link OrPredicate} wraps {@link org.apache.commons.collections.functors.OrPredicate} to + * {@link OrPredicate} wraps {@link org.apache.commons.collections4.functors.OrPredicate} to * provide additional functionality like serializing to and from a Map and JSON formatted data. *

* See {@link DelegatedMultiplePredicateContainer} @@ -80,7 +80,7 @@ public static OrPredicate fromMap(Map map) { */ public OrPredicate(Predicate predicate1, Predicate predicate2) { super(NAME, - (PredicateDecorator) org.apache.commons.collections.functors.OrPredicate.getInstance(predicate1, predicate2)); + (PredicateDecorator) org.apache.commons.collections4.functors.OrPredicate.orPredicate(predicate1, predicate2)); } @Override diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index c2cb5a483a1..7148cd2de37 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -251,8 +251,8 @@ import org.apache.ambari.server.utils.SecretReference; import org.apache.ambari.server.utils.StageUtils; import org.apache.ambari.server.utils.URLCredentialsHider; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/DeleteIdentityHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/DeleteIdentityHandler.java index 23abaceb678..c58a763a972 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/DeleteIdentityHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/DeleteIdentityHandler.java @@ -56,7 +56,7 @@ import org.apache.ambari.server.state.kerberos.KerberosDescriptor; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostServerActionEvent; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import com.google.gson.reflect.TypeToken; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java index 9a40938adaa..866a1cd7f3f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java @@ -135,7 +135,7 @@ import org.apache.ambari.server.state.kerberos.VariableReplacementHelper; import org.apache.ambari.server.state.svccomphost.ServiceComponentHostServerActionEvent; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.directory.server.kerberos.shared.keytab.Keytab; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java index 63d41fd7cf8..e4e43ceb0ab 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RootServiceResponseFactory.java @@ -30,8 +30,8 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; import org.apache.commons.lang.ArrayUtils; import com.google.inject.Inject; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java index 90c0616e081..2f170c9b40e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java @@ -68,8 +68,8 @@ import org.apache.ambari.server.state.Host; import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponentHost; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java index e1c91e979bd..8971fe3b99d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java @@ -83,7 +83,7 @@ import org.apache.ambari.server.utils.StageUtils; import org.apache.ambari.server.utils.VersionUtils; import org.apache.ambari.spi.RepositoryType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java index df3ba4cebef..8548e452147 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java @@ -62,7 +62,7 @@ import org.apache.ambari.server.state.Host; import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.state.configgroup.ConfigGroupFactory; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java index 04d98376ad6..dd415de7277 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java @@ -63,7 +63,7 @@ import org.apache.ambari.server.state.ServiceComponentHost; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java index 9fcda179444..f5ab7d84f22 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java @@ -66,7 +66,7 @@ import org.apache.ambari.server.state.repository.ManifestServiceInfo; import org.apache.ambari.server.state.repository.VersionDefinitionXml; import org.apache.ambari.server.utils.URLCredentialsHider; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java index 1c20bfd1f41..3f1bc622939 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java @@ -41,7 +41,7 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.apache.ambari.server.security.authorization.RoleAuthorization; import org.apache.ambari.server.utils.SecretReference; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import com.google.inject.Inject; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java index 7d0ec624a08..392ba7f35cd 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java @@ -81,7 +81,7 @@ import org.apache.ambari.server.topology.addservice.AddServiceRequest; import org.apache.ambari.server.utils.LoggingPreconditions; import org.apache.ambari.spi.RepositoryType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java index b13444b311c..86f8eb08534 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java @@ -113,7 +113,7 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostServerActionEvent; import org.apache.ambari.spi.upgrade.UpgradeAction; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.codehaus.jackson.annotate.JsonProperty; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java index 8c61c0f2db1..d7d99bfd398 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java @@ -30,7 +30,7 @@ import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.controller.AmbariManagementController; import org.apache.ambari.server.controller.AmbariServer; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java index 4c7d0312960..6520ff5cb17 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java @@ -51,7 +51,7 @@ import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Config; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.apache.http.client.utils.URIBuilder; import org.codehaus.jackson.map.AnnotationIntrospector; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java index 27f51150797..ed631220054 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java @@ -61,7 +61,7 @@ import org.apache.ambari.server.utils.ThreadPools; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java index 2a5b69e8166..f8e5be4ba98 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java @@ -49,7 +49,7 @@ import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponent; import org.apache.ambari.server.state.ServiceComponentHost; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink; import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java index 7deec43b43c..7a574df7c3a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java @@ -43,8 +43,8 @@ import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.state.configgroup.ConfigGroupFactory; import org.apache.ambari.server.state.host.HostFactory; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java index 3efc4f6a1ba..75329543e0a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostConfigMappingDAO.java @@ -35,8 +35,8 @@ import org.apache.ambari.server.orm.cache.HostConfigMappingImpl; import org.apache.ambari.server.orm.entities.HostConfigMappingEntity; import org.apache.ambari.server.orm.entities.HostEntity; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java index feac89696ca..1da7677049b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java @@ -65,7 +65,7 @@ import org.apache.ambari.server.orm.entities.StageEntity; import org.apache.ambari.server.orm.helpers.SQLConstants; import org.apache.ambari.server.orm.helpers.SQLOperations; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabDAO.java index 5b7927062e1..9bf4c40416f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabDAO.java @@ -30,7 +30,7 @@ import org.apache.ambari.server.orm.entities.KerberosKeytabEntity; import org.apache.ambari.server.orm.entities.KerberosKeytabPrincipalEntity; import org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosKeytab; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java index 7257acb26f4..2ea1e33f8b4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java @@ -39,7 +39,7 @@ import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity; import org.apache.ambari.server.orm.helpers.SQLConstants; import org.apache.ambari.server.orm.helpers.SQLOperations; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalDAO.java index 5db85909d4b..bb02f2cb9d1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalDAO.java @@ -28,7 +28,7 @@ import org.apache.ambari.server.orm.RequiresSession; import org.apache.ambari.server.orm.entities.KerberosKeytabPrincipalEntity; import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RequestDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RequestDAO.java index 42e5ca669fa..a7139fe3a56 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RequestDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/RequestDAO.java @@ -48,7 +48,7 @@ import org.apache.ambari.server.orm.helpers.SQLConstants; import org.apache.ambari.server.orm.helpers.SQLOperations; import org.apache.ambari.server.state.Clusters; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java index f5199742882..4114321ca9b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java @@ -34,7 +34,7 @@ import org.apache.ambari.server.orm.RequiresSession; import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity; import org.apache.ambari.server.orm.entities.ServiceComponentVersionEntity; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java index 978540a37c3..8516dfdda71 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java @@ -35,8 +35,8 @@ import org.apache.ambari.server.orm.entities.ServiceConfigEntity; import org.apache.ambari.server.orm.entities.StackEntity; import org.apache.ambari.server.state.StackId; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java index f0880261003..dbe149a8f27 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StageDAO.java @@ -47,7 +47,7 @@ import org.apache.ambari.server.orm.helpers.SQLConstants; import org.apache.ambari.server.orm.helpers.SQLOperations; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsService.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsService.java index b90a8ca9b14..3be7b118306 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsService.java @@ -35,7 +35,7 @@ import org.apache.ambari.server.security.authorization.User; import org.apache.ambari.server.security.authorization.UserAuthenticationType; import org.apache.ambari.server.security.authorization.Users; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.security.authentication.util.KerberosName; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java index 7c2f50a2f8f..5e0db4f7ebd 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java @@ -32,7 +32,7 @@ import org.apache.ambari.server.security.authentication.AmbariUserDetailsImpl; import org.apache.ambari.server.security.authentication.InvalidUsernamePasswordCombinationException; import org.apache.ambari.server.security.authentication.TooManyLoginFailuresException; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java index 69ad595e613..9e0650bb58d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java @@ -64,7 +64,7 @@ import org.apache.ambari.server.security.ldap.LdapGroupDto; import org.apache.ambari.server.security.ldap.LdapUserDto; import org.apache.ambari.server.security.ldap.LdapUserGroupMemberDto; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java index 655a5526e8d..1d65081d87a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/security/encryption/PropertiesEncryptor.java @@ -30,7 +30,7 @@ import org.apache.ambari.server.state.PropertyInfo; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.utils.TextEncoding; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; /** * A common base class for various encryptor implementations diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java index 240e95accaf..a8b0d99b94d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerAction.java @@ -48,7 +48,7 @@ import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor; import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java index 5daec26696d..9e4b09ef412 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java @@ -42,8 +42,8 @@ import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity; import org.apache.ambari.server.security.credential.PrincipalKeyCredential; import org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosPrincipal; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java index d9732e9dd86..add8610c738 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java @@ -24,7 +24,7 @@ import org.apache.ambari.server.security.credential.PrincipalKeyCredential; import org.apache.ambari.server.utils.ShellCommandUtil; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java index a708d7156e2..b13ef89d86b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java @@ -31,7 +31,7 @@ import org.apache.ambari.server.utils.HTTPUtils; import org.apache.ambari.server.utils.HostAndPort; import org.apache.ambari.server.utils.ShellCommandUtil; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.directory.server.kerberos.shared.keytab.Keytab; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java index 0bf7b3d6009..be5b6460a01 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandler.java @@ -29,7 +29,7 @@ import org.apache.ambari.server.security.credential.PrincipalKeyCredential; import org.apache.ambari.server.state.kerberos.VariableReplacementHelper; import org.apache.ambari.server.utils.ShellCommandUtil; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java index 6e139c90243..c9c7c904a99 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.state.ServiceComponentHost; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.kerberos.KerberosDescriptor; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java index d8f3b52903f..d2d13b62ecf 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java @@ -39,7 +39,7 @@ import org.apache.ambari.server.state.kerberos.KerberosDescriptor; import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor; import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/KerberosKeytabController.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/KerberosKeytabController.java index 037c796643a..08f9448ccf5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/KerberosKeytabController.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/KerberosKeytabController.java @@ -44,7 +44,7 @@ import org.apache.ambari.server.state.kerberos.KerberosDescriptor; import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/DeleteUnsupportedServicesAndComponents.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/DeleteUnsupportedServicesAndComponents.java index 708e656e5e6..f6318a0a092 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/DeleteUnsupportedServicesAndComponents.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/DeleteUnsupportedServicesAndComponents.java @@ -21,7 +21,7 @@ package org.apache.ambari.server.serveraction.upgrades; import static java.util.stream.Collectors.toList; -import static org.apache.commons.collections.CollectionUtils.union; +import static org.apache.commons.collections4.CollectionUtils.union; import java.util.HashSet; import java.util.List; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosAction.java index 6cbb41cab48..5df429d4a78 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosAction.java @@ -64,8 +64,8 @@ import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; import org.apache.ambari.server.state.kerberos.VariableReplacementHelper; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import com.google.inject.Inject; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java index a12b526f35c..88a65f45fb9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java @@ -34,7 +34,7 @@ import org.apache.ambari.server.orm.entities.RepoOsEntity; import org.apache.ambari.server.state.RepositoryInfo; import org.apache.ambari.server.state.stack.RepositoryXml; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java index fbf114da727..d944d023e09 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.state.stack.RepoUrlInfoCallable; import org.apache.ambari.server.state.stack.RepoUrlInfoCallable.RepoUrlInfoResult; import org.apache.ambari.server.state.stack.RepoVdfCallable; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ColocatedGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ColocatedGrouping.java index f90a489c844..9a2dfc5ed5d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ColocatedGrouping.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ColocatedGrouping.java @@ -44,7 +44,7 @@ import org.apache.ambari.server.stack.upgrade.orchestrate.UpgradeContext; import org.apache.ambari.server.utils.SetUtils; import org.apache.ambari.spi.upgrade.OrchestrationOptions; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderGrouping.java index 8381020e365..06d80e65958 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderGrouping.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderGrouping.java @@ -46,7 +46,7 @@ import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.ServiceComponentHost; import org.apache.ambari.server.state.StackId; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java index 92e219938b0..cb0eb2e8ea2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java @@ -41,7 +41,7 @@ import org.apache.ambari.server.stack.upgrade.Task.Type; import org.apache.ambari.server.state.StackId; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.builder.EqualsBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/ParallelClientGroupingBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/ParallelClientGroupingBuilder.java index 0ed9931ae6a..7b2f6c0f289 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/ParallelClientGroupingBuilder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/ParallelClientGroupingBuilder.java @@ -36,7 +36,7 @@ import org.apache.ambari.server.stack.upgrade.Task.Type; import org.apache.ambari.server.stack.upgrade.UpgradePack.ProcessingComponent; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; /** * Responsible for building the stages for {@link ParallelClientGrouping} diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapper.java index f82bbde1496..64ea9fa42f0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapper.java @@ -27,7 +27,7 @@ import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.stack.upgrade.Task; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapperBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapperBuilder.java index c3d586cb5dc..b2100f5078e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapperBuilder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapperBuilder.java @@ -32,7 +32,7 @@ import org.apache.ambari.server.stack.upgrade.Task; import org.apache.ambari.server.stack.upgrade.UpgradePack.ProcessingComponent; import org.apache.ambari.server.state.ConfigHelper; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; /** diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/TaskWrapperBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/TaskWrapperBuilder.java index ac0b514bf32..6c00cc470d5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/TaskWrapperBuilder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/TaskWrapperBuilder.java @@ -30,7 +30,7 @@ import org.apache.ambari.server.stack.upgrade.ExecuteTask; import org.apache.ambari.server.stack.upgrade.Task; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeContext.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeContext.java index 546ec304530..b6540028418 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeContext.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeContext.java @@ -92,7 +92,7 @@ import org.apache.ambari.spi.upgrade.UpgradeCheckStatus; import org.apache.ambari.spi.upgrade.UpgradeInformation; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeHelper.java index 508a6db8f03..414ee4dfa49 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeHelper.java @@ -90,7 +90,7 @@ import org.apache.ambari.server.state.UpgradeState; import org.apache.ambari.server.state.ValueAttributesInfo; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java index f52b2e5e8e3..69b1dc74bca 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java @@ -38,7 +38,7 @@ import org.apache.ambari.spi.upgrade.UpgradeCheckRequest; import org.apache.ambari.spi.upgrade.UpgradeCheckResult; import org.apache.ambari.spi.upgrade.UpgradeCheckStatus; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java index 4c0a9400951..71efb4edb60 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java @@ -58,8 +58,8 @@ import org.apache.ambari.server.state.PropertyInfo.PropertyType; import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.utils.SecretReference; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringEscapeUtils; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java index b04314b8d0b..a1a45ff66e1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java @@ -28,7 +28,7 @@ import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.StackAccessException; import org.apache.ambari.server.api.services.AmbariMetaInfo; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java index f8408d96615..1f2e618d645 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java @@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElements; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; /** * Represents stack component dependency information. diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java index 4cfa00d1093..aae5970fd43 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java @@ -54,8 +54,8 @@ import org.apache.ambari.server.orm.entities.ServiceComponentVersionEntity; import org.apache.ambari.server.orm.entities.StackEntity; import org.apache.ambari.server.state.cluster.ClusterImpl; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java index 9bb1ca422c5..ca88b3ef9b2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java @@ -21,7 +21,7 @@ package org.apache.ambari.server.state; import static java.util.stream.Collectors.toSet; -import static org.apache.commons.collections.CollectionUtils.union; +import static org.apache.commons.collections4.CollectionUtils.union; import java.util.Collection; import java.util.HashSet; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java index c9765086fe2..37970acbff8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java @@ -151,8 +151,8 @@ import org.apache.ambari.spi.ClusterInformation; import org.apache.ambari.spi.RepositoryType; import org.apache.ambari.spi.RepositoryVersion; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java index 200a0694315..ed0820d60ff 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java @@ -24,7 +24,7 @@ import org.apache.ambari.server.collections.Predicate; import org.apache.ambari.server.collections.PredicateUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import com.google.common.base.Optional; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepoVdfCallable.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepoVdfCallable.java index 81657a7f5b4..a6a0ee46826 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepoVdfCallable.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepoVdfCallable.java @@ -29,7 +29,7 @@ import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.StackInfo; import org.apache.ambari.server.state.repository.VersionDefinitionXml; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java index 93ae8101b55..293186891b5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -import org.apache.commons.collections.map.MultiValueMap; +import org.apache.commons.collections4.map.MultiValueMap; import org.slf4j.Logger; /** diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java index 65f31360f36..8d46f4bf2cb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java @@ -43,7 +43,7 @@ import org.apache.ambari.server.state.ConfigHelper; import org.apache.ambari.server.state.SecurityType; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java index 62e56fcc592..da20c8ea900 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java @@ -43,7 +43,7 @@ import org.apache.ambari.server.state.kerberos.KerberosDescriptor; import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory; import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java index 8031b0cd096..d053b73331e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java @@ -93,7 +93,7 @@ import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory; import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; import org.apache.ambari.server.topology.validators.HiveServiceValidator; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog271.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog271.java index c1e25448067..179113cb90d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog271.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog271.java @@ -47,7 +47,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.Config; import org.apache.ambari.server.state.ServiceComponent; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java index 8e573e4c09f..15ebb0121bc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java @@ -125,7 +125,7 @@ import org.apache.ambari.view.events.Listener; import org.apache.ambari.view.migration.ViewDataMigrationException; import org.apache.ambari.view.validation.Validator; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.log4j.PropertyConfigurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java index d73371eaf03..9ed33264bae 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java @@ -52,7 +52,7 @@ import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent; import org.apache.ambari.server.utils.CommandUtils; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.easymock.EasyMock; import org.junit.After; import org.junit.Before; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/stomp/AgentDataHolderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/stomp/AgentDataHolderTest.java index 284c8d0d4ba..a0c12a2cbca 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/agent/stomp/AgentDataHolderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/stomp/AgentDataHolderTest.java @@ -26,7 +26,7 @@ import org.apache.ambari.server.events.UpdateEventType; import org.apache.ambari.server.events.publishers.AmbariEventPublisher; import org.apache.ambari.server.security.encryption.Encryptor; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.junit.Test; public class AgentDataHolderTest { diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/AmbariErrorHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/AmbariErrorHandlerTest.java index ed00b0705f5..bab11922e24 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/AmbariErrorHandlerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/AmbariErrorHandlerTest.java @@ -23,7 +23,6 @@ import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.expectLastCall; import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; import java.io.IOException; @@ -79,9 +78,9 @@ public void testHandleInternalServerError() throws IOException { final UUID requestId = UUID.fromString("4db659b2-7902-477b-b8e6-c35261d3334a"); mockStatic(HttpConnection.class, UUID.class, LoggerFactory.class); - when(HttpConnection.getCurrentConnection()).thenReturn(httpConnection); - when(UUID.randomUUID()).thenReturn(requestId); - when(LoggerFactory.getLogger(AmbariErrorHandler.class)).thenReturn(logger); + expect(HttpConnection.getCurrentConnection()).thenReturn(httpConnection); + expect(UUID.randomUUID()).thenReturn(requestId); + expect(LoggerFactory.getLogger(AmbariErrorHandler.class)).thenReturn(logger); Throwable th = createNiceMock(Throwable.class); @@ -125,7 +124,7 @@ public void testHandleGeneralError() throws Exception { //given mockStatic(HttpConnection.class); - when(HttpConnection.getCurrentConnection()).thenReturn(httpConnection); + expect(HttpConnection.getCurrentConnection()).thenReturn(httpConnection); expect(httpConnection.getHttpChannel()).andReturn(httpChannel); expect(httpChannel.getRequest()).andReturn(request); diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java index 1a9586d3596..23c001d8c87 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java @@ -29,7 +29,7 @@ import org.apache.ambari.server.controller.spi.SystemException; import org.apache.ambari.server.controller.spi.UnsupportedPropertyException; import org.apache.ambari.server.security.authorization.AuthorizationException; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.junit.Test; import com.google.common.collect.Sets; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java index 190359d5bb1..43c15f7b2d9 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java @@ -70,7 +70,7 @@ import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.state.stack.OsFamily; import org.apache.ambari.server.testutils.PartialNiceMockBinder; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.easymock.EasyMockSupport; import org.junit.After; import org.junit.Assert; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java index b3da55b4c9d..12ae6cd38da 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/collections/PredicateUtilsTest.java @@ -104,7 +104,7 @@ private void verifyPredicate(Predicate predicate) { Assert.assertEquals(NotPredicate.NAME, predicate.getName()); Assert.assertTrue(predicate instanceof NotPredicate); - org.apache.commons.collections.Predicate[] predicates; + org.apache.commons.collections4.Predicate[] predicates; predicates = ((NotPredicate) predicate).getPredicates(); Assert.assertEquals(1, predicates.length); diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java index c37186df2de..d9b94910e3a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java @@ -81,7 +81,7 @@ import org.apache.ambari.server.state.ValueAttributesInfo; import org.apache.ambari.server.topology.TopologyManager; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.easymock.Capture; import org.easymock.EasyMock; import org.easymock.EasyMockRule; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java index eeeef4d9794..e0c80b34d4c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java @@ -147,7 +147,7 @@ import org.apache.ambari.server.topology.TopologyManager; import org.apache.ambari.server.utils.EventBusSynchronizer; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.easymock.Capture; import org.easymock.EasyMock; import org.junit.After; @@ -9084,7 +9084,7 @@ private void testRunSmokeTestFlag(Map mapRequestProps, assertTrue(smokeTestRequired); } - private class RolePredicate implements org.apache.commons.collections.Predicate { + private class RolePredicate implements org.apache.commons.collections4.Predicate { private String role; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java index ad4d0832127..0284fdd8e53 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java @@ -27,7 +27,6 @@ import static org.easymock.EasyMock.verify; import static org.junit.Assert.assertFalse; import static org.mockito.Mockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.whenNew; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaDataTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaDataTest.java index 5b1148a6846..30b8f4dc369 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaDataTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaDataTest.java @@ -18,7 +18,7 @@ package org.apache.ambari.server.controller.internal; -import static org.apache.commons.collections.CollectionUtils.isEqualCollection; +import static org.apache.commons.collections4.CollectionUtils.isEqualCollection; import static org.junit.Assert.assertTrue; import org.apache.ambari.server.ObjectNotFoundException; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java index 712469e540d..1ec7fab6dd4 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java @@ -119,7 +119,7 @@ import org.apache.ambari.server.view.ViewRegistry; import org.apache.ambari.spi.RepositoryType; import org.apache.ambari.spi.upgrade.UpgradeType; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.easymock.Capture; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProviderTest.java index 0d4d3f2af62..9730f36fcf4 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProviderTest.java @@ -57,8 +57,8 @@ import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.utils.CollectionPresentationUtils; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.Predicate; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URIBuilder; import org.junit.After; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java index ba7f7ff9fa2..a7697c56c12 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java @@ -137,7 +137,7 @@ import org.apache.ambari.server.topology.TopologyManager; import org.apache.ambari.server.topology.tasks.ConfigureClusterTaskFactory; import org.apache.ambari.server.utils.StageUtils; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.easymock.Capture; import org.easymock.EasyMockSupport; import org.easymock.IAnswer; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java index 8768d479205..9e4611ac76a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java @@ -45,7 +45,7 @@ import org.apache.ambari.server.orm.entities.ClusterServiceEntity; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; import org.apache.ambari.server.state.configgroup.ConfigGroup; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java index 53113675d87..88d981933e5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterImplTest.java @@ -52,7 +52,7 @@ import org.apache.ambari.server.state.ServiceComponentHost; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.configgroup.ConfigGroup; -import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections4.MapUtils; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java index 079096de5f7..e759999bd7d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java @@ -33,7 +33,7 @@ import java.util.TreeSet; import org.apache.ambari.server.AmbariException; -import org.apache.commons.collections.map.HashedMap; +import org.apache.commons.collections4.map.HashedMap; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/ambari-utility/pom.xml b/ambari-utility/pom.xml index 0b0f3ec17a4..cb1c4ce4be7 100644 --- a/ambari-utility/pom.xml +++ b/ambari-utility/pom.xml @@ -82,8 +82,9 @@ commons-beanutils - commons-collections - commons-collections + org.apache.commons + commons-collections4 + 4.4 junit @@ -103,8 +104,8 @@ commons-beanutils - commons-collections - commons-collections + org.apache.commons + commons-collections4 diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml index bfbc2ad0cf6..1a3b668080e 100644 --- a/contrib/views/pom.xml +++ b/contrib/views/pom.xml @@ -157,9 +157,9 @@ - commons-collections - commons-collections - 3.2.2 + org.apache.commons + commons-collections4 + 4.4 org.apache.httpcomponents