This is an automated email from the ASF dual-hosted git repository. asalamon74 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/oozie.git
The following commit(s) were added to refs/heads/master by this push: new 491e73e OOZIE-3446 Migrate from commons-lang 2.x to commons-lang 3.x (nobigo via asalamon74) 491e73e is described below commit 491e73ee9f941dfb25dfe92121fb033295ef42ee Author: Andras Salamon <asalamo...@apache.org> AuthorDate: Thu Mar 14 13:09:02 2019 +0100 OOZIE-3446 Migrate from commons-lang 2.x to commons-lang 3.x (nobigo via asalamon74) --- core/pom.xml | 6 ------ .../java/org/apache/oozie/CoordinatorEngine.java | 2 +- .../java/org/apache/oozie/action/ActionExecutor.java | 2 +- .../apache/oozie/action/hadoop/JHSCredentials.java | 2 +- .../oozie/command/coord/CoordChangeXCommand.java | 2 +- .../oozie/command/coord/CoordCommandUtils.java | 2 +- .../coord/CoordMaterializeTransitionXCommand.java | 2 +- .../coord/CoordPushDependencyCheckXCommand.java | 2 +- .../oozie/command/coord/CoordSLAAlertsXCommand.java | 2 +- .../oozie/command/coord/CoordUpdateXCommand.java | 2 +- .../org/apache/oozie/coord/CoordELFunctions.java | 2 +- .../main/java/org/apache/oozie/coord/CoordUtils.java | 2 +- .../dependency/AbstractCoordInputDependency.java | 2 +- .../dependency/CoordInputDependencyFactory.java | 2 +- .../input/dependency/CoordOldInputDependency.java | 2 +- .../input/dependency/CoordPullInputDependency.java | 2 +- .../dependency/CoordUnResolvedInputDependency.java | 2 +- .../coord/input/logic/CoordInputLogicBuilder.java | 2 +- .../logic/CoordInputLogicEvaluatorPhaseTwo.java | 2 +- .../input/logic/CoordInputLogicEvaluatorResult.java | 2 +- .../input/logic/CoordInputLogicEvaluatorUtil.java | 2 +- .../oozie/coord/input/logic/InputLogicParser.java | 2 +- .../apache/oozie/dependency/DependencyChecker.java | 2 +- .../executor/jpa/WorkflowsJobGetJPAExecutor.java | 6 +++--- .../oozie/service/AbandonedCoordCheckerService.java | 2 +- .../apache/oozie/service/AuthorizationService.java | 2 +- .../apache/oozie/service/ConfigurationService.java | 2 +- .../apache/oozie/service/HadoopAccessorService.java | 2 +- .../java/org/apache/oozie/service/JPAService.java | 2 +- .../apache/oozie/service/JobsConcurrencyService.java | 2 +- .../org/apache/oozie/service/ShareLibService.java | 2 +- .../apache/oozie/service/XLogStreamingService.java | 6 +++--- .../apache/oozie/service/ZKXLogStreamingService.java | 14 +++++++------- .../org/apache/oozie/servlet/BaseAdminServlet.java | 2 +- .../org/apache/oozie/servlet/JsonRestServlet.java | 4 ++-- .../java/org/apache/oozie/servlet/V1JobsServlet.java | 2 +- .../java/org/apache/oozie/servlet/V2JobServlet.java | 2 +- .../org/apache/oozie/store/StoreStatusFilter.java | 6 +++--- .../java/org/apache/oozie/util/ClasspathUtils.java | 4 ++-- .../org/apache/oozie/util/ELConstantsFunctions.java | 2 +- core/src/main/java/org/apache/oozie/util/Pair.java | 2 +- .../java/org/apache/oozie/util/ParamChecker.java | 2 +- .../apache/oozie/util/TimestampedMessageParser.java | 4 ++-- .../main/java/org/apache/oozie/util/XLogFilter.java | 4 ++-- .../java/org/apache/oozie/util/XLogStreamer.java | 8 ++++---- .../org/apache/oozie/util/XLogUserFilterParam.java | 2 +- .../oozie/workflow/lite/LiteWorkflowAppParser.java | 2 +- .../java/org/apache/oozie/TestCoordinatorEngine.java | 2 +- .../org/apache/oozie/TestLocalOozieClientCoord.java | 2 +- .../apache/oozie/command/TestSLAAlertXCommand.java | 8 ++++---- .../command/coord/TestAbandonedCoordChecker.java | 2 +- .../oozie/command/coord/TestCoordSubmitXCommand.java | 20 ++++++++++---------- .../apache/oozie/command/wf/TestSubmitXCommand.java | 2 +- .../executor/jpa/TestWorkflowsJobGetJPAExecutor.java | 2 +- .../oozie/service/TestAuthorizationService.java | 2 +- .../oozie/util/TestStringSerializationUtil.java | 2 +- .../oozie/util/db/TestOperationRetryHandler.java | 2 +- .../oozie/workflow/lite/TestLiteWorkflowApp.java | 2 +- .../oozie/workflow/lite/TestLiteWorkflowLib.java | 2 +- pom.xml | 9 ++------- release-log.txt | 1 + sharelib/oozie/pom.xml | 6 ++++++ .../org/apache/oozie/action/hadoop/LauncherMain.java | 2 +- sharelib/pig/pom.xml | 2 +- .../java/org/apache/oozie/action/hadoop/PigMain.java | 2 +- sharelib/spark/pom.xml | 4 ++-- .../oozie/action/hadoop/SparkArgsExtractor.java | 2 +- .../oozie/action/hadoop/SparkOptionsSplitter.java | 2 +- .../oozie/tools/diag/DiagBundleCollectorDriver.java | 2 +- .../oozie/tools/diag/OozieLauncherLogFetcher.java | 2 +- 70 files changed, 107 insertions(+), 111 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 6521967..eeb43cf 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -116,7 +116,6 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <scope>test</scope> </dependency> <dependency> @@ -221,11 +220,6 @@ </dependency> <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - - <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <scope>compile</scope> diff --git a/core/src/main/java/org/apache/oozie/CoordinatorEngine.java b/core/src/main/java/org/apache/oozie/CoordinatorEngine.java index 0aa56d1..07bab12 100644 --- a/core/src/main/java/org/apache/oozie/CoordinatorEngine.java +++ b/core/src/main/java/org/apache/oozie/CoordinatorEngine.java @@ -35,7 +35,7 @@ import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.client.CoordinatorAction; import org.apache.oozie.client.CoordinatorJob; diff --git a/core/src/main/java/org/apache/oozie/action/ActionExecutor.java b/core/src/main/java/org/apache/oozie/action/ActionExecutor.java index 02af319..8a585b3 100644 --- a/core/src/main/java/org/apache/oozie/action/ActionExecutor.java +++ b/core/src/main/java/org/apache/oozie/action/ActionExecutor.java @@ -19,7 +19,7 @@ package org.apache.oozie.action; import com.google.common.base.Charsets; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.Configuration; diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/JHSCredentials.java b/core/src/main/java/org/apache/oozie/action/hadoop/JHSCredentials.java index 7410190..34262d8 100644 --- a/core/src/main/java/org/apache/oozie/action/hadoop/JHSCredentials.java +++ b/core/src/main/java/org/apache/oozie/action/hadoop/JHSCredentials.java @@ -18,7 +18,7 @@ package org.apache.oozie.action.hadoop; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.v2.api.HSClientProtocol; diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java index 00ceb9d..1192f8c 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.CoordinatorJobBean; import org.apache.oozie.ErrorCode; diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java b/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java index 7d73815..7632839 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordCommandUtils.java @@ -64,7 +64,7 @@ import org.jdom.Attribute; import org.jdom.Element; import org.jdom.JDOMException; import org.quartz.CronExpression; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorJobBean; public class CoordCommandUtils { diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java index 7e0a2bf..2a6498d 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java @@ -18,7 +18,7 @@ package org.apache.oozie.command.coord; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.AppType; import org.apache.oozie.CoordinatorActionBean; diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java index 41b78af..d7a143a 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java @@ -24,7 +24,7 @@ import java.net.URI; import java.util.Date; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.CoordinatorJobBean; diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordSLAAlertsXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordSLAAlertsXCommand.java index 96be7ad..ff6605a 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordSLAAlertsXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordSLAAlertsXCommand.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.CoordinatorJobBean; diff --git a/core/src/main/java/org/apache/oozie/command/coord/CoordUpdateXCommand.java b/core/src/main/java/org/apache/oozie/command/coord/CoordUpdateXCommand.java index 758c5c2..8ab0a8a 100644 --- a/core/src/main/java/org/apache/oozie/command/coord/CoordUpdateXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/coord/CoordUpdateXCommand.java @@ -24,7 +24,7 @@ import java.io.StringReader; import java.util.Date; import com.google.common.base.Charsets; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.CoordinatorJobBean; import org.apache.oozie.ErrorCode; diff --git a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java index e54ec0a..e38f3d6 100644 --- a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java +++ b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java @@ -22,7 +22,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.ErrorCode; import org.apache.oozie.client.OozieClient; diff --git a/core/src/main/java/org/apache/oozie/coord/CoordUtils.java b/core/src/main/java/org/apache/oozie/coord/CoordUtils.java index e476188..1d97acc 100644 --- a/core/src/main/java/org/apache/oozie/coord/CoordUtils.java +++ b/core/src/main/java/org/apache/oozie/coord/CoordUtils.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.HashMap; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.CoordinatorEngine; diff --git a/core/src/main/java/org/apache/oozie/coord/input/dependency/AbstractCoordInputDependency.java b/core/src/main/java/org/apache/oozie/coord/input/dependency/AbstractCoordInputDependency.java index 79355eb..013417e 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/dependency/AbstractCoordInputDependency.java +++ b/core/src/main/java/org/apache/oozie/coord/input/dependency/AbstractCoordInputDependency.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.io.Writable; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.command.CommandException; diff --git a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordInputDependencyFactory.java b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordInputDependencyFactory.java index ea15467..0a6572a 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordInputDependencyFactory.java +++ b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordInputDependencyFactory.java @@ -20,7 +20,7 @@ package org.apache.oozie.coord.input.dependency; import java.io.UnsupportedEncodingException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.StringBlob; import org.apache.oozie.util.WritableUtils; import org.apache.oozie.util.XLog; diff --git a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordOldInputDependency.java b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordOldInputDependency.java index af298b9..b25131e 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordOldInputDependency.java +++ b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordOldInputDependency.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.AccessControlException; import org.apache.oozie.CoordinatorActionBean; diff --git a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordPullInputDependency.java b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordPullInputDependency.java index 358f6f9..9174a48 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordPullInputDependency.java +++ b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordPullInputDependency.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.command.CommandException; import org.apache.oozie.command.coord.CoordCommandUtils; diff --git a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordUnResolvedInputDependency.java b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordUnResolvedInputDependency.java index 096b588..90539b1 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordUnResolvedInputDependency.java +++ b/core/src/main/java/org/apache/oozie/coord/input/dependency/CoordUnResolvedInputDependency.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.io.Writable; import org.apache.oozie.coord.CoordELFunctions; import org.apache.oozie.util.WritableUtils; diff --git a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicBuilder.java b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicBuilder.java index 2326cd7..8153c8d 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicBuilder.java +++ b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicBuilder.java @@ -20,7 +20,7 @@ package org.apache.oozie.coord.input.logic; import java.io.IOException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; public class CoordInputLogicBuilder { diff --git a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorPhaseTwo.java b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorPhaseTwo.java index 16fc400..2f62668 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorPhaseTwo.java +++ b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorPhaseTwo.java @@ -24,7 +24,7 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.coord.CoordELConstants; import org.apache.oozie.coord.CoordELEvaluator; diff --git a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorResult.java b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorResult.java index 2f3f034..50bf80e 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorResult.java +++ b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorResult.java @@ -18,7 +18,7 @@ package org.apache.oozie.coord.input.logic; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.coord.CoordELFunctions; public class CoordInputLogicEvaluatorResult { diff --git a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorUtil.java b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorUtil.java index d38bc0f..8552e24 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorUtil.java +++ b/core/src/main/java/org/apache/oozie/coord/input/logic/CoordInputLogicEvaluatorUtil.java @@ -24,7 +24,7 @@ import org.apache.commons.jexl2.Expression; import org.apache.commons.jexl2.JexlContext; import org.apache.commons.jexl2.JexlEngine; import org.apache.commons.jexl2.NamespaceResolver; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.ErrorCode; import org.apache.oozie.command.CommandException; diff --git a/core/src/main/java/org/apache/oozie/coord/input/logic/InputLogicParser.java b/core/src/main/java/org/apache/oozie/coord/input/logic/InputLogicParser.java index f1f6b41..1571f31 100644 --- a/core/src/main/java/org/apache/oozie/coord/input/logic/InputLogicParser.java +++ b/core/src/main/java/org/apache/oozie/coord/input/logic/InputLogicParser.java @@ -20,7 +20,7 @@ package org.apache.oozie.coord.input.logic; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.jdom.Element; import org.jdom.Namespace; diff --git a/core/src/main/java/org/apache/oozie/dependency/DependencyChecker.java b/core/src/main/java/org/apache/oozie/dependency/DependencyChecker.java index 1fcb393..2e29afb 100644 --- a/core/src/main/java/org/apache/oozie/dependency/DependencyChecker.java +++ b/core/src/main/java/org/apache/oozie/dependency/DependencyChecker.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.ErrorCode; import org.apache.oozie.client.OozieClient; diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowsJobGetJPAExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowsJobGetJPAExecutor.java index 45a893d..795baab 100644 --- a/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowsJobGetJPAExecutor.java +++ b/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowsJobGetJPAExecutor.java @@ -342,21 +342,21 @@ public class WorkflowsJobGetJPAExecutor implements JPAExecutor<WorkflowsInfo> { if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addDays(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addDays(new Date(), offset); break; case 'h': offset = Integer.parseInt(time.substring(0, time.length() - 1)); if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addHours(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addHours(new Date(), offset); break; case 'm': offset = Integer.parseInt(time.substring(0, time.length() - 1)); if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addMinutes(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), offset); break; case 'Z': createdTime = DateUtils.parseDateUTC(time); diff --git a/core/src/main/java/org/apache/oozie/service/AbandonedCoordCheckerService.java b/core/src/main/java/org/apache/oozie/service/AbandonedCoordCheckerService.java index 0ff23e6..c350f8e 100644 --- a/core/src/main/java/org/apache/oozie/service/AbandonedCoordCheckerService.java +++ b/core/src/main/java/org/apache/oozie/service/AbandonedCoordCheckerService.java @@ -21,7 +21,7 @@ import java.sql.Timestamp; import java.util.Date; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.CoordinatorJobBean; import org.apache.oozie.action.email.EmailActionExecutor; import org.apache.oozie.command.CommandException; diff --git a/core/src/main/java/org/apache/oozie/service/AuthorizationService.java b/core/src/main/java/org/apache/oozie/service/AuthorizationService.java index 2c19aa2..98fcc76 100644 --- a/core/src/main/java/org/apache/oozie/service/AuthorizationService.java +++ b/core/src/main/java/org/apache/oozie/service/AuthorizationService.java @@ -33,7 +33,7 @@ import java.util.LinkedHashSet; import com.google.common.base.Charsets; import com.google.common.collect.Sets; import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; diff --git a/core/src/main/java/org/apache/oozie/service/ConfigurationService.java b/core/src/main/java/org/apache/oozie/service/ConfigurationService.java index 8345da7..4da8233 100644 --- a/core/src/main/java/org/apache/oozie/service/ConfigurationService.java +++ b/core/src/main/java/org/apache/oozie/service/ConfigurationService.java @@ -20,7 +20,7 @@ package org.apache.oozie.service; import com.google.common.base.Strings; import com.google.common.annotations.VisibleForTesting; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.ErrorCode; import org.apache.oozie.util.ConfigUtils; diff --git a/core/src/main/java/org/apache/oozie/service/HadoopAccessorService.java b/core/src/main/java/org/apache/oozie/service/HadoopAccessorService.java index 5cab847..0b53a36 100644 --- a/core/src/main/java/org/apache/oozie/service/HadoopAccessorService.java +++ b/core/src/main/java/org/apache/oozie/service/HadoopAccessorService.java @@ -21,7 +21,7 @@ package org.apache.oozie.service; import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.Master; diff --git a/core/src/main/java/org/apache/oozie/service/JPAService.java b/core/src/main/java/org/apache/oozie/service/JPAService.java index 4abc262..5c621b2 100644 --- a/core/src/main/java/org/apache/oozie/service/JPAService.java +++ b/core/src/main/java/org/apache/oozie/service/JPAService.java @@ -34,7 +34,7 @@ import javax.persistence.Query; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.BundleActionBean; import org.apache.oozie.BundleJobBean; diff --git a/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java b/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java index da2b9aa..2334f7e 100644 --- a/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java +++ b/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.util.ConfigUtils; import org.apache.oozie.util.Instrumentable; import org.apache.oozie.util.Instrumentation; diff --git a/core/src/main/java/org/apache/oozie/service/ShareLibService.java b/core/src/main/java/org/apache/oozie/service/ShareLibService.java index fc2c29b..134c6ee 100644 --- a/core/src/main/java/org/apache/oozie/service/ShareLibService.java +++ b/core/src/main/java/org/apache/oozie/service/ShareLibService.java @@ -44,7 +44,7 @@ import java.util.Properties; import java.util.Set; import java.util.TimeZone; import java.util.Map.Entry; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; diff --git a/core/src/main/java/org/apache/oozie/service/XLogStreamingService.java b/core/src/main/java/org/apache/oozie/service/XLogStreamingService.java index f841425..49945ad 100644 --- a/core/src/main/java/org/apache/oozie/service/XLogStreamingService.java +++ b/core/src/main/java/org/apache/oozie/service/XLogStreamingService.java @@ -18,8 +18,8 @@ package org.apache.oozie.service; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.util.Instrumentable; import org.apache.oozie.util.Instrumentation; import org.apache.oozie.util.XLogStreamer; @@ -93,7 +93,7 @@ public class XLogStreamingService implements Service, Instrumentable { protected void streamLog(XLogStreamer logStreamer, Date startTime, Date endTime, Writer writer, boolean appendDebug) throws IOException { if (!logStreamer.isLogEnabled()) { - writer.write(StringEscapeUtils.escapeHtml(logStreamer.getLogDisableMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logStreamer.getLogDisableMessage())); return; } logStreamer.streamLog(writer, startTime, endTime, appendDebug); diff --git a/core/src/main/java/org/apache/oozie/service/ZKXLogStreamingService.java b/core/src/main/java/org/apache/oozie/service/ZKXLogStreamingService.java index 9aa3276..2b780d3 100644 --- a/core/src/main/java/org/apache/oozie/service/ZKXLogStreamingService.java +++ b/core/src/main/java/org/apache/oozie/service/ZKXLogStreamingService.java @@ -27,8 +27,8 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.curator.x.discovery.ServiceInstance; import org.apache.oozie.ErrorCode; import org.apache.oozie.client.OozieClient; @@ -104,7 +104,7 @@ public class ZKXLogStreamingService extends XLogStreamingService implements Serv public void streamLog(XLogStreamer logStreamer, Date startTime, Date endTime, Writer writer) throws IOException { if (!logStreamer.isLogEnabled()) { - writer.write(StringEscapeUtils.escapeHtml(logStreamer.getLogDisableMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logStreamer.getLogDisableMessage())); return; } // If ALL_SERVERS_PARAM is set to false, then only stream our log @@ -188,11 +188,11 @@ public class ZKXLogStreamingService extends XLogStreamingService implements Serv //If log param debug is set, we need to write start date and end date to outputstream. if(!StringUtils.isEmpty(logStreamer.getXLogFilter().getTruncatedMessage())){ - writer.write(StringEscapeUtils.escapeHtml(logStreamer.getXLogFilter().getTruncatedMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logStreamer.getXLogFilter().getTruncatedMessage())); } if (logStreamer.getXLogFilter().isDebugMode()) { - writer.write(StringEscapeUtils.escapeHtml(logStreamer.getXLogFilter().getDebugMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logStreamer.getXLogFilter().getDebugMessage())); } // Add a message about any servers we couldn't contact if (!badOozies.isEmpty()) { @@ -227,7 +227,7 @@ public class ZKXLogStreamingService extends XLogStreamingService implements Serv // The first entry will be the earliest based on the timestamp (also removes it) from the map TimestampedMessageParser earliestParser = timestampMap.pollFirstEntry().getValue(); // Write the message from that parser at that timestamp - writer.write(StringEscapeUtils.escapeHtml(earliestParser.getLastMessage())); + writer.write(StringEscapeUtils.escapeHtml4(earliestParser.getLastMessage())); if (logStreamer.shouldFlushOutput(earliestParser.getLastMessage().length())) { writer.flush(); } @@ -241,7 +241,7 @@ public class ZKXLogStreamingService extends XLogStreamingService implements Serv if (timestampMap.size() == 1) { TimestampedMessageParser parser = timestampMap.values().iterator().next(); // don't forget the last message read by the parser - writer.write(StringEscapeUtils.escapeHtml(parser.getLastMessage())); + writer.write(StringEscapeUtils.escapeHtml4(parser.getLastMessage())); parser.processRemaining(writer, logStreamer); } } diff --git a/core/src/main/java/org/apache/oozie/servlet/BaseAdminServlet.java b/core/src/main/java/org/apache/oozie/servlet/BaseAdminServlet.java index 3fcf4a4..0b873bc 100644 --- a/core/src/main/java/org/apache/oozie/servlet/BaseAdminServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/BaseAdminServlet.java @@ -29,7 +29,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.fs.Path; import org.apache.oozie.BuildInfo; import org.apache.oozie.ErrorCode; diff --git a/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java b/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java index 17dc686..016b694 100644 --- a/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/JsonRestServlet.java @@ -18,7 +18,7 @@ package org.apache.oozie.servlet; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.oozie.client.OozieClient.SYSTEM_MODE; import org.apache.oozie.client.rest.JsonBean; import org.apache.oozie.client.rest.RestConstants; @@ -402,7 +402,7 @@ public abstract class JsonRestServlet extends HttpServlet { throws IOException { response.setHeader(RestConstants.OOZIE_ERROR_CODE, error); response.setHeader(RestConstants.OOZIE_ERROR_MESSAGE, message); - response.sendError(statusCode, StringEscapeUtils.escapeHtml(message)); + response.sendError(statusCode, StringEscapeUtils.escapeHtml4(message)); } protected void sendJsonResponse(HttpServletResponse response, int statusCode, JSONStreamAware json) diff --git a/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java b/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java index 931864d..3a702aa 100644 --- a/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java @@ -35,7 +35,7 @@ import javax.servlet.http.HttpServletResponse; import com.google.common.base.Strings; import com.google.common.collect.Lists; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; diff --git a/core/src/main/java/org/apache/oozie/servlet/V2JobServlet.java b/core/src/main/java/org/apache/oozie/servlet/V2JobServlet.java index d05b4c0..1426883 100644 --- a/core/src/main/java/org/apache/oozie/servlet/V2JobServlet.java +++ b/core/src/main/java/org/apache/oozie/servlet/V2JobServlet.java @@ -26,7 +26,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.BaseEngine; import org.apache.oozie.BaseEngineException; diff --git a/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java b/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java index cba75df..74c65e8 100644 --- a/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java +++ b/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java @@ -343,21 +343,21 @@ public class StoreStatusFilter { if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addDays(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addDays(new Date(), offset); break; case 'h': offset = Integer.parseInt(time.substring(0, time.length() - 1)); if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addHours(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addHours(new Date(), offset); break; case 'm': offset = Integer.parseInt(time.substring(0, time.length() - 1)); if(offset > 0) { throw new IllegalArgumentException("offset must be minus from currentTime."); } - createdTime = org.apache.commons.lang.time.DateUtils.addMinutes(new Date(), offset); + createdTime = org.apache.commons.lang3.time.DateUtils.addMinutes(new Date(), offset); break; case 'Z': createdTime = DateUtils.parseDateUTC(time); diff --git a/core/src/main/java/org/apache/oozie/util/ClasspathUtils.java b/core/src/main/java/org/apache/oozie/util/ClasspathUtils.java index bfe2f3e..fc404b4 100644 --- a/core/src/main/java/org/apache/oozie/util/ClasspathUtils.java +++ b/core/src/main/java/org/apache/oozie/util/ClasspathUtils.java @@ -150,7 +150,7 @@ public class ClasspathUtils { String appClassPath = conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH); - if (org.apache.commons.lang.StringUtils.isEmpty(appClassPath)) { + if (org.apache.commons.lang3.StringUtils.isEmpty(appClassPath)) { addPathToYarnClasspathInConfig(conf, pathStr, StringUtils.join(File.pathSeparator, YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)); } else { @@ -164,6 +164,6 @@ public class ClasspathUtils { } private static String normalizedLocalFsPath(Path libPath) { - return org.apache.commons.lang.StringUtils.replace(libPath.toString(), FSUtils.FILE_SCHEME_PREFIX, ""); + return org.apache.commons.lang3.StringUtils.replace(libPath.toString(), FSUtils.FILE_SCHEME_PREFIX, ""); } } diff --git a/core/src/main/java/org/apache/oozie/util/ELConstantsFunctions.java b/core/src/main/java/org/apache/oozie/util/ELConstantsFunctions.java index 731b489..35ef75c 100644 --- a/core/src/main/java/org/apache/oozie/util/ELConstantsFunctions.java +++ b/core/src/main/java/org/apache/oozie/util/ELConstantsFunctions.java @@ -158,7 +158,7 @@ public class ELConstantsFunctions { * @return the trimmed version of the given string or the empty string if the given string was <code>null</code> */ public static String trim(String input) { - return org.apache.commons.lang.StringUtils.trimToEmpty(input); + return org.apache.commons.lang3.StringUtils.trimToEmpty(input); } /** diff --git a/core/src/main/java/org/apache/oozie/util/Pair.java b/core/src/main/java/org/apache/oozie/util/Pair.java index 4ece0d3..f943a7b 100644 --- a/core/src/main/java/org/apache/oozie/util/Pair.java +++ b/core/src/main/java/org/apache/oozie/util/Pair.java @@ -18,7 +18,7 @@ package org.apache.oozie.util; -import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang3.ObjectUtils; /** * Utility class for holding a pair of data diff --git a/core/src/main/java/org/apache/oozie/util/ParamChecker.java b/core/src/main/java/org/apache/oozie/util/ParamChecker.java index e445dd8..e86971f 100644 --- a/core/src/main/java/org/apache/oozie/util/ParamChecker.java +++ b/core/src/main/java/org/apache/oozie/util/ParamChecker.java @@ -22,7 +22,7 @@ import java.util.Date; import java.util.List; import java.util.TimeZone; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.quartz.CronExpression; import java.text.ParseException; diff --git a/core/src/main/java/org/apache/oozie/util/TimestampedMessageParser.java b/core/src/main/java/org/apache/oozie/util/TimestampedMessageParser.java index 5c71ea1..f0d0579 100644 --- a/core/src/main/java/org/apache/oozie/util/TimestampedMessageParser.java +++ b/core/src/main/java/org/apache/oozie/util/TimestampedMessageParser.java @@ -24,7 +24,7 @@ import java.io.Writer; import java.util.ArrayList; import java.util.regex.Pattern; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.oozie.service.Services; import org.apache.oozie.service.XLogStreamingService; import org.apache.oozie.util.LogLine.MATCHED_PATTERN; @@ -205,7 +205,7 @@ public class TimestampedMessageParser { */ public void processRemaining(Writer writer, XLogStreamer logStreamer) throws IOException { while (increment()) { - writer.write(StringEscapeUtils.escapeHtml(lastMessage)); + writer.write(StringEscapeUtils.escapeHtml4(lastMessage)); if (logStreamer.shouldFlushOutput(lastMessage.length())) { writer.flush(); } diff --git a/core/src/main/java/org/apache/oozie/util/XLogFilter.java b/core/src/main/java/org/apache/oozie/util/XLogFilter.java index a5897bf..494cfd5 100644 --- a/core/src/main/java/org/apache/oozie/util/XLogFilter.java +++ b/core/src/main/java/org/apache/oozie/util/XLogFilter.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.service.ConfigurationService; import org.apache.oozie.util.LogLine.MATCHED_PATTERN; @@ -428,7 +428,7 @@ public class XLogFilter { * @throws IOException Signals that an I/O exception has occurred. */ public Date adjustOffset(Date date, int offset) throws IOException { - return org.apache.commons.lang.time.DateUtils.addMinutes(date, offset); + return org.apache.commons.lang3.time.DateUtils.addMinutes(date, offset); } public void setFilterPattern(Pattern filterPattern) { diff --git a/core/src/main/java/org/apache/oozie/util/XLogStreamer.java b/core/src/main/java/org/apache/oozie/util/XLogStreamer.java index 6edfa22..90e3f35 100644 --- a/core/src/main/java/org/apache/oozie/util/XLogStreamer.java +++ b/core/src/main/java/org/apache/oozie/util/XLogStreamer.java @@ -30,8 +30,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.BufferedReader; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.client.rest.RestConstants; import org.apache.oozie.command.CommandException; import org.apache.oozie.service.ConfigurationService; @@ -115,10 +115,10 @@ public class XLogStreamer { try { if (appendDebug) { if (!StringUtils.isEmpty(logFilter.getTruncatedMessage())) { - writer.write(StringEscapeUtils.escapeHtml(logFilter.getTruncatedMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logFilter.getTruncatedMessage())); } if (logFilter.isDebugMode()) { - writer.write(StringEscapeUtils.escapeHtml(logFilter.getDebugMessage())); + writer.write(StringEscapeUtils.escapeHtml4(logFilter.getDebugMessage())); } } // Process the entire logs from the reader using the logFilter diff --git a/core/src/main/java/org/apache/oozie/util/XLogUserFilterParam.java b/core/src/main/java/org/apache/oozie/util/XLogUserFilterParam.java index 3bc948e..603a8c7 100644 --- a/core/src/main/java/org/apache/oozie/util/XLogUserFilterParam.java +++ b/core/src/main/java/org/apache/oozie/util/XLogUserFilterParam.java @@ -26,7 +26,7 @@ import java.util.Date; import java.util.HashSet; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.ErrorCode; import org.apache.oozie.client.rest.RestConstants; import org.apache.oozie.command.CommandException; diff --git a/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java b/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java index d116867..ae0cc76 100644 --- a/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java +++ b/core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowAppParser.java @@ -19,7 +19,7 @@ package org.apache.oozie.workflow.lite; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Writable; import org.apache.oozie.ErrorCode; diff --git a/core/src/test/java/org/apache/oozie/TestCoordinatorEngine.java b/core/src/test/java/org/apache/oozie/TestCoordinatorEngine.java index 5070f95..7d23c61 100644 --- a/core/src/test/java/org/apache/oozie/TestCoordinatorEngine.java +++ b/core/src/test/java/org/apache/oozie/TestCoordinatorEngine.java @@ -18,7 +18,7 @@ package org.apache.oozie; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.client.CoordinatorAction; import org.apache.oozie.client.CoordinatorJob; diff --git a/core/src/test/java/org/apache/oozie/TestLocalOozieClientCoord.java b/core/src/test/java/org/apache/oozie/TestLocalOozieClientCoord.java index d1a1763..fda714e 100644 --- a/core/src/test/java/org/apache/oozie/TestLocalOozieClientCoord.java +++ b/core/src/test/java/org/apache/oozie/TestLocalOozieClientCoord.java @@ -28,7 +28,7 @@ import java.util.List; import java.util.NoSuchElementException; import java.util.Properties; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.oozie.client.CoordinatorJob; import org.apache.oozie.client.Job; import org.apache.oozie.client.OozieClient; diff --git a/core/src/test/java/org/apache/oozie/command/TestSLAAlertXCommand.java b/core/src/test/java/org/apache/oozie/command/TestSLAAlertXCommand.java index ce59885..31c994f 100644 --- a/core/src/test/java/org/apache/oozie/command/TestSLAAlertXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/TestSLAAlertXCommand.java @@ -221,19 +221,19 @@ public class TestSLAAlertXCommand extends XDataTestCase { Date nominalTime1 = DateUtils.parseDateUTC(data); addRecordToCoordActionTable(coord1.getId(), 1, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 1, nominalTime1); - Date nominalTime2 = org.apache.commons.lang.time.DateUtils.addDays(nominalTime1, 1); + Date nominalTime2 = org.apache.commons.lang3.time.DateUtils.addDays(nominalTime1, 1); addRecordToCoordActionTable(coord1.getId(), 2, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 1, nominalTime2); - Date nominalTime3 = org.apache.commons.lang.time.DateUtils.addDays(nominalTime1, 2); + Date nominalTime3 = org.apache.commons.lang3.time.DateUtils.addDays(nominalTime1, 2); addRecordToCoordActionTable(coord1.getId(), 3, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 1, nominalTime3); - Date nominalTime4 = org.apache.commons.lang.time.DateUtils.addDays(nominalTime1, 3); + Date nominalTime4 = org.apache.commons.lang3.time.DateUtils.addDays(nominalTime1, 3); addRecordToCoordActionTable(coord1.getId(), 4, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 1, nominalTime4); - Date nominalTime5 = org.apache.commons.lang.time.DateUtils.addDays(nominalTime1, 4); + Date nominalTime5 = org.apache.commons.lang3.time.DateUtils.addDays(nominalTime1, 4); addRecordToCoordActionTable(coord1.getId(), 5, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 1, nominalTime5); diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestAbandonedCoordChecker.java b/core/src/test/java/org/apache/oozie/command/coord/TestAbandonedCoordChecker.java index 2af6db6..b9d5980 100644 --- a/core/src/test/java/org/apache/oozie/command/coord/TestAbandonedCoordChecker.java +++ b/core/src/test/java/org/apache/oozie/command/coord/TestAbandonedCoordChecker.java @@ -20,7 +20,7 @@ package org.apache.oozie.command.coord; import java.util.Date; -import org.apache.commons.lang.time.DateUtils; +import org.apache.commons.lang3.time.DateUtils; import org.apache.oozie.CoordinatorJobBean; import org.apache.oozie.client.CoordinatorAction; import org.apache.oozie.client.CoordinatorJob; diff --git a/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java b/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java index 6e52a8e..f2d8433 100644 --- a/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/coord/TestCoordSubmitXCommand.java @@ -1408,7 +1408,7 @@ public class TestCoordSubmitXCommand extends XDataTestCase { IOUtils.copyCharStream(reader, writer); conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); conf.set("start", DateUtils.formatDateOozieTZ(new Date())); - conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), 1))); + conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), 1))); conf.set("frequency", "coord:days(1)"); conf.set(OozieClient.USER_NAME, getTestUser()); reader = IOUtils.getResourceAsReader("wf-credentials.xml", -1); @@ -1462,8 +1462,8 @@ public class TestCoordSubmitXCommand extends XDataTestCase { appPathFile = new File(getTestCaseDir(), "coordinator.xml"); conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); conf.set("wfAppPath", appPathFile.getPath()); - conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), -1))); - conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), 1))); + conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), -1))); + conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), 1))); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set("nominal_time", DateUtils.formatDateOozieTZ(otherNominalTime)); @@ -1477,15 +1477,15 @@ public class TestCoordSubmitXCommand extends XDataTestCase { conf = new XConfiguration(); conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); conf.set("wfAppPath", appPathFile.getPath()); - conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), -1))); - conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), 1))); + conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), -1))); + conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), 1))); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set("nominal_time", - DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), -1))); + DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), -1))); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set("nominal_time", - DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), -1))); + DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), -1))); coordId = new CoordSubmitXCommand(conf).call(); new CoordMaterializeTransitionXCommand(coordId, 3600).call(); slaCalc = calc.get(coordId + "@" + 1); @@ -1496,7 +1496,7 @@ public class TestCoordSubmitXCommand extends XDataTestCase { conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); conf.set("wfAppPath", appPathFile.getPath()); conf.set("start", DateUtils.formatDateOozieTZ(new Date())); - conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), 1))); + conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), 1))); conf.set(OozieClient.USER_NAME, getTestUser()); conf.set("nominal_time", DateUtils.formatDateOozieTZ(new Date())); @@ -1518,8 +1518,8 @@ public class TestCoordSubmitXCommand extends XDataTestCase { Writer writer = new FileWriter(appPathFile); IOUtils.copyCharStream(reader, writer); conf.set(OozieClient.COORDINATOR_APP_PATH, appPathFile.toURI().toString()); - conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1))); - conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang.time.DateUtils.addMonths(new Date(), 1))); + conf.set("start", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addDays(new Date(), -1))); + conf.set("end", DateUtils.formatDateOozieTZ(org.apache.commons.lang3.time.DateUtils.addMonths(new Date(), 1))); conf.set(OozieClient.USER_NAME, getTestUser()); reader = IOUtils.getResourceAsReader("wf-credentials.xml", -1); appPathFile = new File(getTestCaseDir(), "workflow.xml"); diff --git a/core/src/test/java/org/apache/oozie/command/wf/TestSubmitXCommand.java b/core/src/test/java/org/apache/oozie/command/wf/TestSubmitXCommand.java index e71a662..2bc0baa 100644 --- a/core/src/test/java/org/apache/oozie/command/wf/TestSubmitXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/wf/TestSubmitXCommand.java @@ -27,7 +27,7 @@ import java.io.PrintWriter; import java.io.StringReader; import java.net.URI; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.ErrorCode; import org.apache.oozie.WorkflowActionBean; diff --git a/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowsJobGetJPAExecutor.java b/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowsJobGetJPAExecutor.java index 992f566..ca7b303 100644 --- a/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowsJobGetJPAExecutor.java +++ b/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowsJobGetJPAExecutor.java @@ -246,7 +246,7 @@ public class TestWorkflowsJobGetJPAExecutor extends XDataTestCase { Date createdTime2 = DateUtils.parseDateUTC("2012-02-01T10:00Z"); Date createdTime3 = DateUtils.parseDateUTC("2012-03-01T10:00Z"); Date createdTime4 = DateUtils.parseDateUTC("2012-04-01T10:00Z"); - Date createdTime5 = org.apache.commons.lang.time.DateUtils.addHours(new Date(), -5); + Date createdTime5 = org.apache.commons.lang3.time.DateUtils.addHours(new Date(), -5); WorkflowJobBean wrkJob = addRecordToWfJobTable(WorkflowJob.Status.PREP, WorkflowInstance.Status.PREP); wrkJob.setCreatedTime(createdTime1); WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW, wrkJob); diff --git a/core/src/test/java/org/apache/oozie/service/TestAuthorizationService.java b/core/src/test/java/org/apache/oozie/service/TestAuthorizationService.java index be5242e..36e4808 100644 --- a/core/src/test/java/org/apache/oozie/service/TestAuthorizationService.java +++ b/core/src/test/java/org/apache/oozie/service/TestAuthorizationService.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; diff --git a/core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java b/core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java index 76864ff..e355c5a 100644 --- a/core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java +++ b/core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java @@ -17,7 +17,7 @@ */ package org.apache.oozie.util; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.junit.Test; import java.io.ByteArrayInputStream; diff --git a/core/src/test/java/org/apache/oozie/util/db/TestOperationRetryHandler.java b/core/src/test/java/org/apache/oozie/util/db/TestOperationRetryHandler.java index ae94199..c61b1e5 100644 --- a/core/src/test/java/org/apache/oozie/util/db/TestOperationRetryHandler.java +++ b/core/src/test/java/org/apache/oozie/util/db/TestOperationRetryHandler.java @@ -26,7 +26,7 @@ import static org.mockito.Mockito.mock; import java.util.concurrent.Callable; -import org.apache.commons.lang.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableInt; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; diff --git a/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java b/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java index 2026439..aea2554 100644 --- a/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java +++ b/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java @@ -18,7 +18,7 @@ package org.apache.oozie.workflow.lite; import com.google.common.base.Strings; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.oozie.service.LiteWorkflowStoreService; import org.apache.oozie.service.Services; import org.apache.oozie.test.XTestCase; diff --git a/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowLib.java b/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowLib.java index a479de0..4ea02ee 100644 --- a/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowLib.java +++ b/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowLib.java @@ -19,7 +19,7 @@ package org.apache.oozie.workflow.lite; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.oozie.service.Services; import org.apache.oozie.workflow.WorkflowException; import org.apache.oozie.workflow.WorkflowInstance; diff --git a/pom.xml b/pom.xml index e07bbf4..3385129 100644 --- a/pom.xml +++ b/pom.xml @@ -115,6 +115,7 @@ <jackson.version>2.6.5</jackson.version> <log4j.version>1.2.17</log4j.version> <activemq.version>5.15.3</activemq.version> + <commons.lang3.version>3.3.2</commons.lang3.version> <httpcore.version>4.3.3</httpcore.version> <httpclient.version>4.3.6</httpclient.version> <kyro.version>2.22</kyro.version> @@ -810,12 +811,6 @@ </dependency> <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> - </dependency> - - <dependency> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-jdbc</artifactId> <version>${openjpa.version}</version> @@ -1366,7 +1361,7 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.3.2</version> + <version>${commons.lang3.version}</version> </dependency> <dependency> diff --git a/release-log.txt b/release-log.txt index 8a60154..dcf12d6 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 5.2.0 release (trunk - unreleased) +OOZIE-3446 Migrate from commons-lang 2.x to commons-lang 3.x (nobigo via asalamon74) OOZIE-3312 Add support for HSTS (kmarton via asalamon74) OOZIE-3207 Update ASF root pom version (asalamon74 via kmarton) OOZIE-1624 Exclusion pattern for sharelib JARs (puru, matijhs via asalamon74, andras.piros) diff --git a/sharelib/oozie/pom.xml b/sharelib/oozie/pom.xml index cc97bdb..fc411d5 100644 --- a/sharelib/oozie/pom.xml +++ b/sharelib/oozie/pom.xml @@ -45,6 +45,12 @@ </dependency> <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minicluster</artifactId> </dependency> diff --git a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java index 5658ea5..c57c1ff 100644 --- a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java +++ b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java @@ -51,7 +51,7 @@ import org.apache.hadoop.util.Shell; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.ApplicationsRequestScope; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsRequest; diff --git a/sharelib/pig/pom.xml b/sharelib/pig/pom.xml index afa8ab8..e953b22 100644 --- a/sharelib/pig/pom.xml +++ b/sharelib/pig/pom.xml @@ -50,6 +50,7 @@ <artifactId>jline</artifactId> <scope>compile</scope> </dependency> + <dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> @@ -84,7 +85,6 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <scope>test</scope> </dependency> <dependency> diff --git a/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java b/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java index a4ead77..101260b 100644 --- a/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java +++ b/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java @@ -26,7 +26,7 @@ import org.apache.pig.tools.pigstats.PigStats; import com.google.common.annotations.VisibleForTesting; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; diff --git a/sharelib/spark/pom.xml b/sharelib/spark/pom.xml index 496f2e7..9eec4bf 100644 --- a/sharelib/spark/pom.xml +++ b/sharelib/spark/pom.xml @@ -55,8 +55,8 @@ </exclusions> </dependency> <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> <scope>compile</scope> </dependency> <dependency> diff --git a/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkArgsExtractor.java b/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkArgsExtractor.java index 42f920b..ff1f1bb 100644 --- a/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkArgsExtractor.java +++ b/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkArgsExtractor.java @@ -21,7 +21,7 @@ package org.apache.oozie.action.hadoop; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.filecache.DistributedCache; import org.apache.hadoop.fs.Path; diff --git a/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkOptionsSplitter.java b/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkOptionsSplitter.java index 5ccd37f..b67ddf9 100644 --- a/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkOptionsSplitter.java +++ b/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkOptionsSplitter.java @@ -19,7 +19,7 @@ package org.apache.oozie.action.hadoop; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; diff --git a/tools/src/main/java/org/apache/oozie/tools/diag/DiagBundleCollectorDriver.java b/tools/src/main/java/org/apache/oozie/tools/diag/DiagBundleCollectorDriver.java index de8e8b1..dfab206 100644 --- a/tools/src/main/java/org/apache/oozie/tools/diag/DiagBundleCollectorDriver.java +++ b/tools/src/main/java/org/apache/oozie/tools/diag/DiagBundleCollectorDriver.java @@ -21,7 +21,7 @@ package org.apache.oozie.tools.diag; import com.google.common.io.Files; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.time.FastDateFormat; +import org.apache.commons.lang3.time.FastDateFormat; import org.apache.hadoop.conf.Configuration; import org.apache.oozie.client.OozieClient; import org.apache.oozie.client.OozieClientException; diff --git a/tools/src/main/java/org/apache/oozie/tools/diag/OozieLauncherLogFetcher.java b/tools/src/main/java/org/apache/oozie/tools/diag/OozieLauncherLogFetcher.java index d12e963..2afe442 100644 --- a/tools/src/main/java/org/apache/oozie/tools/diag/OozieLauncherLogFetcher.java +++ b/tools/src/main/java/org/apache/oozie/tools/diag/OozieLauncherLogFetcher.java @@ -18,7 +18,7 @@ package org.apache.oozie.tools.diag; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileContext; import org.apache.hadoop.fs.FileStatus;