From 5901c26a8aef70f9a37b823c57744d517dbd0cbd Mon Sep 17 00:00:00 2001 From: Tyler Ouyang Date: Mon, 29 Jul 2024 11:25:31 -0700 Subject: [PATCH] Migrate to apache commons lang3 (#1673) * Migrate from lang2 to lang3 * Fix deprecated calls --- deploy-service/common/pom.xml | 7 ++-- .../alerts/AutoRollbackAction.java | 2 +- .../alerts/PinterestExternalAlertFactory.java | 2 +- .../deployservice/bean/AgentBean.java | 8 ++-- .../deployservice/bean/AgentCountBean.java | 6 +-- .../deployservice/bean/AgentErrorBean.java | 6 +-- .../deployservice/bean/AlarmBean.java | 8 ++-- .../deployservice/bean/BuildBean.java | 2 +- .../deployservice/bean/CommitBean.java | 6 +-- .../deployservice/bean/ConfigHistoryBean.java | 2 +- .../deployservice/bean/DataBean.java | 6 +-- .../deployservice/bean/DeployBean.java | 6 +-- .../bean/DeployConstraintBean.java | 2 +- .../deployservice/bean/DeployFilterBean.java | 6 +-- .../deployservice/bean/DeployGoalBean.java | 6 +-- .../bean/DeployProgressBean.java | 6 +-- .../bean/DeployQueryResultBean.java | 6 +-- .../deployservice/bean/EnvWebHookBean.java | 6 +-- .../deployservice/bean/EnvironBean.java | 6 +-- .../deployservice/bean/GroupRolesBean.java | 2 +- .../deployservice/bean/HostAgentBean.java | 6 +-- .../deployservice/bean/HostBean.java | 2 +- .../deployservice/bean/HostTagBean.java | 2 +- .../deployservice/bean/HostTagInfo.java | 2 +- .../deployservice/bean/HotfixBean.java | 2 +- .../deployservice/bean/MetricsConfigBean.java | 6 +-- .../deployservice/bean/MetricsSpecBean.java | 6 +-- .../deployservice/bean/PindeployBean.java | 6 +-- .../deployservice/bean/PingReportBean.java | 6 +-- .../deployservice/bean/PingRequestBean.java | 2 +- .../deployservice/bean/PingResponseBean.java | 6 +-- .../deployservice/bean/PromoteBean.java | 2 +- .../deployservice/bean/RatingBean.java | 6 +-- .../deployservice/bean/ScheduleBean.java | 8 ++-- .../pinterest/deployservice/bean/TagBean.java | 2 +- .../deployservice/bean/TokenRolesBean.java | 2 +- .../deployservice/bean/UserRolesBean.java | 2 +- .../deployservice/bean/WebHookBean.java | 2 +- .../buildtags/BuildTagsManagerImpl.java | 6 +-- .../common/AlarmDataFactory.java | 6 +-- .../deployservice/common/ChangeFeedJob.java | 6 +-- .../deployservice/common/HTTPClient.java | 6 +-- .../common/MetricsDataFactory.java | 6 +-- .../deployservice/common/NotificationJob.java | 6 +-- .../common/WebhookDataFactory.java | 7 ++-- .../deployservice/db/DBBuildDAOImpl.java | 2 +- .../deployservice/db/DBDeployDAOImpl.java | 2 +- .../deployservice/db/DBEnvironDAOImpl.java | 2 +- .../deployservice/db/DBScheduleDAOImpl.java | 8 ++-- .../deployservice/db/DeployQueryFilter.java | 6 +-- .../email/SMTPMailManagerImpl.java | 6 +-- .../deployservice/handler/CommonHandler.java | 2 +- .../deployservice/handler/DataHandler.java | 6 +-- .../deployservice/handler/DeployHandler.java | 2 +- .../deployservice/handler/EnvironHandler.java | 2 +- .../deployservice/handler/GoalAnalyst.java | 20 +++++----- .../deployservice/handler/PingHandler.java | 38 +++++++++---------- .../deployservice/handler/WebhookJob.java | 4 +- .../deployservice/scm/PhabricatorManager.java | 2 +- .../scm/SourceControlManagerProxy.java | 2 +- .../pinterest/deployservice/db/DBDAOTest.java | 2 +- .../config/ZKMysqlDataSourceFactory.java | 2 +- .../teletraan/resource/EnvAlerts.java | 6 +-- .../teletraan/worker/AutoPromoter.java | 2 +- .../worker/HotfixStateTransitioner.java | 2 +- 65 files changed, 164 insertions(+), 168 deletions(-) diff --git a/deploy-service/common/pom.xml b/deploy-service/common/pom.xml index 07a440211c..7110d00915 100644 --- a/deploy-service/common/pom.xml +++ b/deploy-service/common/pom.xml @@ -84,9 +84,8 @@ 4.5.0-M1 - commons-lang - commons-lang - 2.6 + org.apache.commons + commons-text org.apache.commons @@ -210,4 +209,4 @@ quartz - \ No newline at end of file + diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/AutoRollbackAction.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/AutoRollbackAction.java index 9211cdaed3..8aad962408 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/AutoRollbackAction.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/AutoRollbackAction.java @@ -3,7 +3,7 @@ import com.pinterest.deployservice.bean.DeployBean; import com.pinterest.deployservice.bean.EnvironBean; -import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.joda.time.DateTime; import org.joda.time.Interval; import org.slf4j.Logger; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/PinterestExternalAlertFactory.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/PinterestExternalAlertFactory.java index 0bf21a1c82..18235bb344 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/PinterestExternalAlertFactory.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/alerts/PinterestExternalAlertFactory.java @@ -2,7 +2,7 @@ import com.pinterest.deployservice.bean.ExternalAlert; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentBean.java index 8b4622e2bd..c860285b72 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync @@ -45,7 +45,7 @@ public class AgentBean implements Updatable { @JsonProperty("hostId") private String host_id; - + @JsonProperty("hostName") private String host_name; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentCountBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentCountBean.java index f4908fca61..d83cae629a 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentCountBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentCountBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentErrorBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentErrorBean.java index c938ce630b..922bd53c89 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentErrorBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AgentErrorBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AlarmBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AlarmBean.java index 8ff3312a89..e10d6f9a47 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AlarmBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/AlarmBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class AlarmBean { private String name; @@ -50,4 +50,4 @@ public void setMetricsUrl(String metricsUrl) { public String toString() { return ReflectionToStringBuilder.toString(this); } -} \ No newline at end of file +} diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/BuildBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/BuildBean.java index 3f74174181..1e406c0f4c 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/BuildBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/BuildBean.java @@ -17,7 +17,7 @@ import javax.validation.constraints.NotEmpty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/CommitBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/CommitBean.java index 0593a35f07..c58856e1cd 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/CommitBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/CommitBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class CommitBean { private String sha; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ConfigHistoryBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ConfigHistoryBean.java index 13396ebb69..7d4421b394 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ConfigHistoryBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ConfigHistoryBean.java @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * CREATE TABLE config_history ( diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DataBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DataBean.java index f806bf5742..758ad5fc7e 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DataBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DataBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployBean.java index 7158f2c30b..bd19c57411 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployConstraintBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployConstraintBean.java index e061c28c58..ba9ca60db7 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployConstraintBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployConstraintBean.java @@ -1,7 +1,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployFilterBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployFilterBean.java index 027f0c3257..a425e84bb6 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployFilterBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployFilterBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployGoalBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployGoalBean.java index bf8264b4df..14d6028402 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployGoalBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployGoalBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.Map; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployProgressBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployProgressBean.java index 5d514bdafc..6902a0606b 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployProgressBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployProgressBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployQueryResultBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployQueryResultBean.java index a7c8a1fb91..cb57fa139d 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployQueryResultBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/DeployQueryResultBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.HashMap; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvWebHookBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvWebHookBean.java index 8f596ae87a..d8cf7c88bc 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvWebHookBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvWebHookBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvironBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvironBean.java index 3829113dfb..bee28100c0 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvironBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/EnvironBean.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.text.StringEscapeUtils; import org.hibernate.validator.constraints.Range; import java.io.Serializable; @@ -273,7 +273,7 @@ public String getDescription() { public void setDescription(String description) { // Escape user input which could contain injected Javascript - this.description = StringEscapeUtils.escapeHtml(description); + this.description = StringEscapeUtils.escapeHtml4(description); } public String getBuild_name() { diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/GroupRolesBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/GroupRolesBean.java index 653310342d..cb7dc8e446 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/GroupRolesBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/GroupRolesBean.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.pinterest.teletraan.universal.security.bean.AuthZResource; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostAgentBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostAgentBean.java index c135f799c7..e9f14c9bae 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostAgentBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostAgentBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostBean.java index aa1a553648..3e4c13d0bb 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostBean.java @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagBean.java index fe12a82ec7..0f232a6293 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagBean.java @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagInfo.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagInfo.java index d3b504d422..bbbf2b51c8 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagInfo.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HostTagInfo.java @@ -1,7 +1,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class HostTagInfo { diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HotfixBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HotfixBean.java index f46f147a82..fa7852b969 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HotfixBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/HotfixBean.java @@ -17,7 +17,7 @@ import javax.validation.constraints.NotEmpty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsConfigBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsConfigBean.java index 196f7ab0e5..4699914860 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsConfigBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsConfigBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsSpecBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsSpecBean.java index 970506853a..76b7799677 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsSpecBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/MetricsSpecBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class MetricsSpecBean { private Double min; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PindeployBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PindeployBean.java index 604eb65912..8c33f74538 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PindeployBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PindeployBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingReportBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingReportBean.java index 5f11197509..2eab32e83e 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingReportBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingReportBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.util.Map; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingRequestBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingRequestBean.java index 4c78350e6b..a0cb722268 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingRequestBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingRequestBean.java @@ -20,7 +20,7 @@ import javax.validation.constraints.NotEmpty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class PingRequestBean { @NotEmpty diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingResponseBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingResponseBean.java index 0e82bd9da6..3870cd0fa6 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingResponseBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PingResponseBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.bean; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class PingResponseBean { private OpCode opCode; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PromoteBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PromoteBean.java index 869b21fd9a..6ae3d3e440 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PromoteBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/PromoteBean.java @@ -21,7 +21,7 @@ import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.StringUtils; import org.quartz.CronExpression; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/RatingBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/RatingBean.java index 0e5a33bff4..d33bcae619 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/RatingBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/RatingBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * create table user_ratings ( diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ScheduleBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ScheduleBean.java index 1b95e76496..a119720175 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ScheduleBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/ScheduleBean.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.bean; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; /** * Keep the bean and table in sync @@ -37,7 +37,7 @@ public class ScheduleBean implements Updatable { @JsonProperty("id") private String id; - + @JsonProperty("totalSessions") private Integer total_sessions; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TagBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TagBean.java index c6f42d19d3..20a38e0b14 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TagBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TagBean.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import java.beans.Transient; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TokenRolesBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TokenRolesBean.java index f57579c19e..32d323fb9b 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TokenRolesBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/TokenRolesBean.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.pinterest.teletraan.universal.security.bean.AuthZResource; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import javax.annotation.Nonnull; import javax.validation.constraints.NotEmpty; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/UserRolesBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/UserRolesBean.java index 06dd3d6428..2b59262179 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/UserRolesBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/UserRolesBean.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.pinterest.teletraan.universal.security.bean.AuthZResource; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/WebHookBean.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/WebHookBean.java index 83bc83c801..67386bb2a5 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/WebHookBean.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/bean/WebHookBean.java @@ -17,7 +17,7 @@ import javax.validation.constraints.NotEmpty; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class WebHookBean { @NotEmpty diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/buildtags/BuildTagsManagerImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/buildtags/BuildTagsManagerImpl.java index f6e18a1775..7d615c3231 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/buildtags/BuildTagsManagerImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/buildtags/BuildTagsManagerImpl.java @@ -27,8 +27,8 @@ import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,7 +59,7 @@ public List load(String buildName) { // no checked exception } catch (Exception ex){ LOG.error(ExceptionUtils.getRootCauseMessage(ex)); - LOG.error(ExceptionUtils.getFullStackTrace(ex)); + LOG.error(ExceptionUtils.getStackTrace(ex)); } return new ArrayList(); } diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/AlarmDataFactory.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/AlarmDataFactory.java index 2643d50020..86ba999235 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/AlarmDataFactory.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/AlarmDataFactory.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.pinterest.deployservice.bean.AlarmBean; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.Collections; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/ChangeFeedJob.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/ChangeFeedJob.java index f4e28927cf..2ebdaba118 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/ChangeFeedJob.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/ChangeFeedJob.java @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.common; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.reflect.Field; @@ -162,7 +162,7 @@ public Void call() { if (oriObj == null || curObj == null) { return null; } - + String configChange = getConfigChangeMessage(oriObj, curObj); if ((configChange == null) || StringUtils.isEmpty(configChange)) { return null; @@ -183,4 +183,4 @@ public Void call() { public String getPayload() { return payload; } -} \ No newline at end of file +} diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/HTTPClient.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/HTTPClient.java index 2b9a96d90a..06f7a84a2c 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/HTTPClient.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/HTTPClient.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.common; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/MetricsDataFactory.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/MetricsDataFactory.java index 11abd4779e..7100e1ed77 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/MetricsDataFactory.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/MetricsDataFactory.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,7 @@ import com.google.gson.JsonParser; import com.pinterest.deployservice.bean.MetricsConfigBean; import com.pinterest.deployservice.bean.MetricsSpecBean; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/NotificationJob.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/NotificationJob.java index 50bf0b2e04..230f4d30eb 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/NotificationJob.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/NotificationJob.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +17,7 @@ import com.pinterest.deployservice.handler.CommonHandler; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/WebhookDataFactory.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/WebhookDataFactory.java index 639f07611c..4748350bc5 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/common/WebhookDataFactory.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/common/WebhookDataFactory.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,7 +21,7 @@ import com.google.gson.JsonParser; import com.pinterest.deployservice.bean.EnvWebHookBean; import com.pinterest.deployservice.bean.WebHookBean; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -135,4 +135,3 @@ public EnvWebHookBean fromJson(String json) { return EnvWebHookBean; } } - diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBBuildDAOImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBBuildDAOImpl.java index e26c4d53b8..01f7e89ca1 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBBuildDAOImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBBuildDAOImpl.java @@ -27,7 +27,7 @@ import org.apache.commons.dbutils.ResultSetHandler; import org.apache.commons.dbutils.handlers.BeanHandler; import org.apache.commons.dbutils.handlers.BeanListHandler; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.joda.time.Interval; public class DBBuildDAOImpl implements BuildDAO { diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBDeployDAOImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBDeployDAOImpl.java index ea5f22d4f9..ef0aab7a88 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBDeployDAOImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBDeployDAOImpl.java @@ -29,7 +29,7 @@ import org.apache.commons.dbutils.handlers.BeanHandler; import org.apache.commons.dbutils.handlers.BeanListHandler; import org.apache.commons.dbutils.handlers.ScalarHandler; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.joda.time.Interval; import java.sql.Connection; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBEnvironDAOImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBEnvironDAOImpl.java index 9ae25c55ad..69598ce397 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBEnvironDAOImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBEnvironDAOImpl.java @@ -32,7 +32,7 @@ import org.apache.commons.dbutils.ResultSetHandler; import org.apache.commons.dbutils.handlers.BeanHandler; import org.apache.commons.dbutils.handlers.BeanListHandler; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; public class DBEnvironDAOImpl implements EnvironDAO { private static final String INSERT_ENV_TEMPLATE = diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBScheduleDAOImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBScheduleDAOImpl.java index 7fcd4c2bca..3c398f6fec 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBScheduleDAOImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DBScheduleDAOImpl.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,7 +24,7 @@ import org.apache.commons.dbutils.ResultSetHandler; import org.apache.commons.dbutils.handlers.BeanHandler; import org.apache.commons.dbutils.handlers.BeanListHandler; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.sql.Connection; import java.util.List; @@ -37,7 +37,7 @@ public class DBScheduleDAOImpl implements ScheduleDAO { "INSERT INTO schedules SET %s"; private static final String UPDATE_SCHEDULE = "UPDATE schedules SET %s WHERE id=?"; - private static final String DELETE_SCHEDULE = + private static final String DELETE_SCHEDULE = "DELETE FROM schedules WHERE id=?"; private static final String GET_SCHEDULE_BY_ID = "SELECT * FROM schedules WHERE id=?"; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DeployQueryFilter.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DeployQueryFilter.java index bb251f914b..c97f038009 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DeployQueryFilter.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/db/DeployQueryFilter.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ package com.pinterest.deployservice.db; import com.pinterest.deployservice.bean.DeployFilterBean; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/email/SMTPMailManagerImpl.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/email/SMTPMailManagerImpl.java index 8d918fc8b8..c13a465ee6 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/email/SMTPMailManagerImpl.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/email/SMTPMailManagerImpl.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ package com.pinterest.deployservice.email; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.LoggerFactory; import javax.mail.*; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java index 6b0e625bc7..ccedc70445 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java @@ -27,7 +27,7 @@ import com.pinterest.teletraan.universal.events.AppEventPublisher; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DataHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DataHandler.java index d0842f6794..fdbec2669c 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DataHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DataHandler.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,7 +21,7 @@ import com.pinterest.deployservice.common.PersistableJSONFactory; import com.pinterest.deployservice.dao.DataDAO; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.Collections; import java.util.Map; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DeployHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DeployHandler.java index 49148fbc56..0d9bcbcd44 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DeployHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/DeployHandler.java @@ -59,7 +59,7 @@ import com.google.common.base.Joiner; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.joda.time.Interval; import org.joda.time.format.ISODateTimeFormat; import org.slf4j.Logger; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/EnvironHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/EnvironHandler.java index fa1836d99b..6a2544029b 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/EnvironHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/EnvironHandler.java @@ -28,7 +28,7 @@ import javax.ws.rs.ForbiddenException; import javax.ws.rs.NotFoundException; import javax.ws.rs.WebApplicationException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/GoalAnalyst.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/GoalAnalyst.java index 18f860c301..08d106ac7f 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/GoalAnalyst.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/GoalAnalyst.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -320,17 +320,17 @@ AgentState proposeNewAgentState(PingReportBean report, AgentBean agent) { } boolean shouldUpdateAgentRecord(AgentBean origBean, AgentBean updateBean) { - + if (origBean == null || updateBean == null) { return true; } - if (origBean.getHost_id() != null && origBean.getHost_id().equals(host_id) && + if (origBean.getHost_id() != null && origBean.getHost_id().equals(host_id) && origBean.getDeploy_id() != null && origBean.getDeploy_id().equals(updateBean.getDeploy_id()) && - origBean.getEnv_id() != null && origBean.getEnv_id().equals(updateBean.getEnv_id()) && + origBean.getEnv_id() != null && origBean.getEnv_id().equals(updateBean.getEnv_id()) && origBean.getFail_count() != null && origBean.getFail_count().equals(updateBean.getFail_count()) && - origBean.getStatus() != null && origBean.getStatus().equals(updateBean.getStatus()) && + origBean.getStatus() != null && origBean.getStatus().equals(updateBean.getStatus()) && origBean.getLast_err_no() != null && origBean.getLast_err_no().equals(updateBean.getLast_err_no()) && - origBean.getState() != null && origBean.getState().equals(updateBean.getState()) && + origBean.getState() != null && origBean.getState().equals(updateBean.getState()) && origBean.getDeploy_stage() != null && origBean.getDeploy_stage().equals(updateBean.getDeploy_stage()) && origBean.getContainer_health_status() != null && origBean.getContainer_health_status().equals(updateBean.getContainer_health_status())) { LOG.debug("Skip updating agent record for env_id {}, deploy_id {} on host {}", @@ -570,8 +570,8 @@ void process(String envId, EnvironBean env, PingReportBean report, AgentBean age hostTagBean.setCreate_date(System.currentTimeMillis()); hostTagDAO.insertOrUpdate(hostTagBean); LOG.info("Update host tags from Deployd: update host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue); - } - } + } + } } /** diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/PingHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/PingHandler.java index 5506fb97ec..5d5e954a83 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/PingHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/PingHandler.java @@ -30,7 +30,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -140,7 +140,7 @@ public PingHandler(ServiceContext serviceContext) { agentCountCacheTtl = serviceContext.getAgentCountCacheTtl(); maxParallelThreshold = serviceContext.getMaxParallelThreshold(); accountAllowList = serviceContext.getAccountAllowList(); - + if (serviceContext.isBuildCacheEnabled()) { buildCache = CacheBuilder.from(serviceContext.getBuildCacheSpec().replace(";", ",")) .build(new CacheLoader() { @@ -180,13 +180,13 @@ void updateHosts(String hostName, String hostIp, String hostId, Set grou groupsToAdd.add(group); } } - + // if it is the main account, don't update it to avoid huge updates for existing hosts // only update sub account id for existing hosts if (groupsToAdd.size() > 0 || accountId != null && !accountId.equals(PINTEREST_MAIN_AWS_ACCOUNT) && !accountId.equals(recordedAccountId)) { hostDAO.insertOrUpdate(hostName, hostIp, hostId, HostState.ACTIVE.toString(), groups, accountId); } - + // Remove if not reported for (String recordedGroup : recordedGroups) { if (!groups.contains(recordedGroup)) { @@ -210,10 +210,10 @@ void updateHostStatus(String hostId, String hostName, String hostIp, String agen hostAgentBean.setIp(hostIp); hostAgentBean.setLast_update(current_time); hostAgentBean.setAgent_Version(agentVersion); - hostAgentBean.setAuto_scaling_group(asg); - + hostAgentBean.setAuto_scaling_group(asg); + if (!isExisting) { - hostAgentDAO.insert(hostAgentBean); + hostAgentDAO.insert(hostAgentBean); } else { hostAgentDAO.update(hostId, hostAgentBean); } @@ -274,7 +274,7 @@ boolean isAgentCountValid(String envId, AgentCountBean agentCountBean) { return true; } - + /** * Check if we can start deploy on host for certain env. We should not allow * more than parallelThreshold hosts in install in the same time @@ -356,8 +356,8 @@ boolean canDeploy(EnvironBean envBean, String host, AgentBean agentBean) throws long now = System.currentTimeMillis(); agentCountBean.setLast_refresh(now); } - /* Typically, should update agentCount and agent in transaction, - * however, treating agentCount as cache w/ ttl and + /* Typically, should update agentCount and agent in transaction, + * however, treating agentCount as cache w/ ttl and * make sure we update count first and then agent state. */ LOG.debug("updating count for envId {}, existing_count {}, active_count {}, last_refresh {}, ttl {} ms", @@ -586,20 +586,20 @@ private EnvType populateStageType(PingRequestBean pingRequest) throws Exception EnvironBean envBean = populateEnviron(pingRequest.getAutoscalingGroup()); if (envBean != null && envBean.getStage_type() != EnvType.DEFAULT) { - return envBean.getStage_type(); + return envBean.getStage_type(); } - + // Search for stage type from groups like CMP,group Set groups = pingRequest.getGroups(); for (String group: groups) { envBean = populateEnviron(group); if (envBean != null && envBean.getStage_type() != EnvType.DEFAULT) { return envBean.getStage_type(); - } + } } return EnvType.PRODUCTION; } - + // Creates composite deploy group. size is limited by group_name size in hosts table. // TODO: Consider storing host <-> shard mapping separately. private Set shardGroups(PingRequestBean pingRequest) throws Exception { @@ -654,9 +654,9 @@ public PingResult ping(PingRequestBean pingRequest, boolean rate_limited) throws Map tags = mapper.readValue(ec2Tags, Map.class); for (Map.Entry entry : tags.entrySet()) { LOG.debug("key: {}, val: {}", entry.getKey(), entry.getValue()); - } + } } - + //update agent version for host String agentVersion = pingRequest.getAgentVersion() != null ? pingRequest.getAgentVersion() : "UNKNOWN"; @@ -697,9 +697,9 @@ public PingResult ping(PingRequestBean pingRequest, boolean rate_limited) throws if (installCandidate.needWait) { LOG.debug("Checking if host {}, updateBean = {}, rate_limited = {}, system_priority = {} can deploy", hostName, updateBean, rate_limited, env.getSystem_priority()); - // Request has hit LWM rate-limit. we already updated heartbeat. + // Request has hit LWM rate-limit. we already updated heartbeat. // Next, see if we can handle light-weight deploys, instead of completly discarding request. - // Idea is, + // Idea is, // 1. we want to continue in-progress deploy. // 2. delay starting new deploy on the host(canDeploy call below is expensive for services with system priority). // 3. allow any light weight deploys. @@ -719,7 +719,7 @@ public PingResult ping(PingRequestBean pingRequest, boolean rate_limited) throws break; } else { LOG.debug("Host {} needs to wait for env {}. Try next env", - hostName, updateBean.getEnv_id()); + hostName, updateBean.getEnv_id()); } } else { LOG.debug("Host {} is in the middle of deploy, no need to wait, updateBean = {}", diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/WebhookJob.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/WebhookJob.java index b08cd3fdde..e099752526 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/WebhookJob.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/WebhookJob.java @@ -21,7 +21,7 @@ import com.pinterest.deployservice.common.HTTPClient; import com.google.common.base.Splitter; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -109,5 +109,3 @@ public Void call() { return null; } } - - diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/PhabricatorManager.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/PhabricatorManager.java index 73fb464fde..cdbfaac77c 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/PhabricatorManager.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/PhabricatorManager.java @@ -21,7 +21,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/SourceControlManagerProxy.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/SourceControlManagerProxy.java index b47f17d078..a83eabae5b 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/SourceControlManagerProxy.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/scm/SourceControlManagerProxy.java @@ -6,7 +6,7 @@ import com.pinterest.deployservice.bean.CommitBean; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/deploy-service/common/src/test/java/com/pinterest/deployservice/db/DBDAOTest.java b/deploy-service/common/src/test/java/com/pinterest/deployservice/db/DBDAOTest.java index 1f16534c7c..1bd50f6810 100644 --- a/deploy-service/common/src/test/java/com/pinterest/deployservice/db/DBDAOTest.java +++ b/deploy-service/common/src/test/java/com/pinterest/deployservice/db/DBDAOTest.java @@ -68,7 +68,7 @@ import com.pinterest.deployservice.fixture.EnvironBeanFixture; import com.pinterest.teletraan.universal.security.bean.AuthZResource; import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.EqualsBuilder; import org.joda.time.DateTime; import org.joda.time.Interval; import org.junit.jupiter.api.AfterEach; diff --git a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/config/ZKMysqlDataSourceFactory.java b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/config/ZKMysqlDataSourceFactory.java index d416a1a0f2..d1511eca49 100644 --- a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/config/ZKMysqlDataSourceFactory.java +++ b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/config/ZKMysqlDataSourceFactory.java @@ -26,7 +26,7 @@ import org.apache.commons.codec.digest.DigestUtils; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; @JsonTypeName("zkmysql") public class ZKMysqlDataSourceFactory implements DataSourceFactory { diff --git a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvAlerts.java b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvAlerts.java index 56b20e797a..26df459e7f 100644 --- a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvAlerts.java +++ b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvAlerts.java @@ -37,8 +37,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -166,7 +166,7 @@ public Response alertsTriggered(@PathParam("envName") String envName, userName)); } catch (Exception ex) { LOG.error("Failed to perform action {}", ExceptionUtils.getRootCauseMessage(ex)); - LOG.error(ExceptionUtils.getFullStackTrace(ex)); + LOG.error(ExceptionUtils.getStackTrace(ex)); } } diff --git a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/AutoPromoter.java b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/AutoPromoter.java index 45ccf80d29..57b272f663 100644 --- a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/AutoPromoter.java +++ b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/AutoPromoter.java @@ -32,7 +32,7 @@ import io.micrometer.core.instrument.Counter; import com.google.common.base.Preconditions; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.format.ISODateTimeFormat; diff --git a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/HotfixStateTransitioner.java b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/HotfixStateTransitioner.java index 26a4a4c1ba..e9be3c034f 100644 --- a/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/HotfixStateTransitioner.java +++ b/deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/worker/HotfixStateTransitioner.java @@ -24,7 +24,7 @@ import com.pinterest.deployservice.handler.CommonHandler; import com.pinterest.teletraan.universal.metrics.ErrorBudgetCounterFactory; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory;