Skip to content

Commit 9b2ccb8

Browse files
authored
Upgrade from Apache Commons Lang 2.6 to Commons Lang3 3.18.0 (#6511)
This commit migrates the codebase from the legacy commons-lang library to commons-lang3. Key changes include: - Updated dependency in build.gradle files from commons-lang:2.6 to commons-lang3:3.18.0 - Updated all import statements from org.apache.commons.lang to org.apache.commons.lang3 - Replaced StringEscapeUtils.escapeJavaScript() with escapeEcmaScript() in TimelineObserver (method renamed in lang3) - Replaced StrBuilder with standard Java StringBuilder in ConfigParser (StrBuilder moved to commons-text library) All modules compile successfully with the new dependency. Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent a30dbbb commit 9b2ccb8

File tree

15 files changed

+19
-20
lines changed

15 files changed

+19
-20
lines changed

modules/nextflow/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
api "ch.qos.logback:logback-core:1.5.20"
3939
api "org.codehaus.gpars:gpars:1.2.1"
4040
api("ch.artecat.grengine:grengine:3.0.2") { exclude group: 'org.codehaus.groovy' }
41-
api "commons-lang:commons-lang:2.6"
41+
api "org.apache.commons:commons-lang3:3.18.0"
4242
api "commons-codec:commons-codec:1.15"
4343
api "commons-io:commons-io:2.15.1"
4444
api "com.beust:jcommander:1.35"

modules/nextflow/src/main/groovy/nextflow/Session.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import nextflow.util.SysHelper
8989
import nextflow.util.ThreadPoolManager
9090
import nextflow.util.Threads
9191
import nextflow.util.VersionNumber
92-
import org.apache.commons.lang.exception.ExceptionUtils
92+
import org.apache.commons.lang3.exception.ExceptionUtils
9393
import sun.misc.Signal
9494
import sun.misc.SignalHandler
9595
/**

modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import nextflow.secret.SecretsLoader
4949
import nextflow.util.CustomPoolFactory
5050
import nextflow.util.Duration
5151
import nextflow.util.HistoryFile
52-
import org.apache.commons.lang.StringUtils
52+
import org.apache.commons.lang3.StringUtils
5353
import org.fusesource.jansi.AnsiConsole
5454
import org.yaml.snakeyaml.Yaml
5555
/**

modules/nextflow/src/main/groovy/nextflow/executor/AbstractGridExecutor.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import nextflow.processor.TaskRun
2929
import nextflow.util.Duration
3030
import nextflow.util.Escape
3131
import nextflow.util.Throttle
32-
import org.apache.commons.lang.StringUtils
32+
import org.apache.commons.lang3.StringUtils
3333
/**
3434
* Generic task processor executing a task through a grid facility
3535
*

modules/nextflow/src/main/groovy/nextflow/script/parser/v1/ScriptLoaderV1.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import nextflow.script.ScriptLoader
3636
import nextflow.script.ScriptMeta
3737
import nextflow.util.Duration
3838
import nextflow.util.MemoryUnit
39-
import org.apache.commons.lang.StringUtils
39+
import org.apache.commons.lang3.StringUtils
4040
import org.codehaus.groovy.control.CompilationFailedException
4141
import org.codehaus.groovy.control.CompilerConfiguration
4242
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer

modules/nextflow/src/main/groovy/nextflow/trace/TimelineObserver.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import nextflow.trace.config.TimelineConfig
3131
import nextflow.trace.event.TaskEvent
3232
import nextflow.util.Duration
3333
import nextflow.util.TestOnly
34-
import org.apache.commons.lang.StringEscapeUtils
34+
import org.apache.commons.lang3.StringEscapeUtils
3535
/**
3636
* Render pipeline timeline processes execution
3737
*
@@ -195,7 +195,7 @@ class TimelineObserver implements TraceObserverV2 {
195195
final indent = " ";
196196

197197
template << indent << indent << '{'
198-
template << "\"label\": \"${StringEscapeUtils.escapeJavaScript(name)}\", "
198+
template << "\"label\": \"${StringEscapeUtils.escapeEcmaScript(name)}\", "
199199
template << "\"cached\": ${record.cached}, "
200200
template << "\"index\": $index, "
201201
template << "\"times\": ["
@@ -204,7 +204,7 @@ class TimelineObserver implements TraceObserverV2 {
204204
template << "{\"starting_time\": $submit, \"ending_time\": $start}"
205205

206206
if( start && realtime ) {
207-
final label = StringEscapeUtils.escapeJavaScript(labelString(record))
207+
final label = StringEscapeUtils.escapeEcmaScript(labelString(record))
208208
final ending = start+realtime
209209
template << ", {\"starting_time\": $start, \"ending_time\": $ending, \"label\": \"$label\"}"
210210

modules/nextflow/src/main/groovy/nextflow/util/ClusterConfig.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package nextflow.util
1818

1919
import groovy.transform.PackageScope
2020
import groovy.util.logging.Slf4j
21-
import org.apache.commons.lang.StringUtils
21+
import org.apache.commons.lang3.StringUtils
2222
/**
2323
* Helper class retrieve cluster configuration properties
2424
*/

modules/nextflow/src/main/groovy/nextflow/util/LoggerHelper.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import nextflow.script.FunctionDef
7272
import nextflow.script.ScriptMeta
7373
import nextflow.script.WorkflowBinding
7474
import nextflow.script.WorkflowDef
75-
import org.apache.commons.lang.exception.ExceptionUtils
75+
import org.apache.commons.lang3.exception.ExceptionUtils
7676
import org.slf4j.Logger
7777
import org.slf4j.LoggerFactory
7878
import org.slf4j.Marker

modules/nf-commons/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
api "ch.qos.logback:logback-classic:1.5.20"
3030
api "org.apache.groovy:groovy:4.0.29"
3131
api "org.apache.groovy:groovy-nio:4.0.29"
32-
api "commons-lang:commons-lang:2.6"
32+
api "org.apache.commons:commons-lang3:3.18.0"
3333
api 'com.google.guava:guava:33.0.0-jre'
3434
api 'org.pf4j:pf4j:3.12.0'
3535
api 'org.pf4j:pf4j-update:2.3.0'

modules/nf-commons/src/main/nextflow/Global.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import nextflow.util.Duration
2424
import nextflow.util.IniFile
2525
import nextflow.util.MemoryUnit
2626
import nextflow.util.TestOnly
27-
import org.apache.commons.lang.StringUtils
28-
import org.apache.commons.lang.exception.ExceptionUtils
27+
import org.apache.commons.lang3.StringUtils
28+
import org.apache.commons.lang3.exception.ExceptionUtils
2929
/**
3030
* Hold global variables
3131
*

0 commit comments

Comments
 (0)