From ff74318a1df0be4f5ef11b1111164b9a1008d67c Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Wed, 15 Jan 2025 20:26:59 +0100 Subject: [PATCH] Minor [ci fast] Signed-off-by: Paolo Di Tommaso --- .../groovy/nextflow/extension/BufferOp.groovy | 16 ++++++++-------- .../groovy/nextflow/extension/CombineOp.groovy | 2 +- .../groovy/nextflow/extension/DistinctOp.groovy | 4 ++-- .../groovy/nextflow/extension/FilterOp.groovy | 6 +++--- .../groovy/nextflow/extension/FirstOp.groovy | 6 +++--- .../groovy/nextflow/extension/FlatMapOp.groovy | 14 +++++++------- .../main/groovy/nextflow/extension/op/Op.groovy | 10 +++++----- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/BufferOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/BufferOp.groovy index bfa5f41bd2..0a18688962 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/BufferOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/BufferOp.groovy @@ -164,16 +164,16 @@ class BufferOp { final listener = new DataflowEventAdapter() { @Override - Object controlMessageArrived(final DataflowProcessor processor, final DataflowReadChannel channel, final int index, final Object message) { + Object controlMessageArrived(final DataflowProcessor dp, final DataflowReadChannel channel, final int index, final Object message) { if( message instanceof PoisonPill && remainder && buffer.size() ) { - Op.bind(processor,target, buffer) + Op.bind(dp, target, buffer) } return message } @Override - void afterStop(DataflowProcessor processor) { - Op.bind(processor, target, Channel.STOP) + void afterStop(DataflowProcessor dp) { + Op.bind(dp, target, Channel.STOP) } @Override @@ -196,17 +196,17 @@ class BufferOp { isOpen = true buffer << it } - final proc = getDelegate() as DataflowProcessor + final dp = getDelegate() as DataflowProcessor if( closeCriteria.call(it) ) { - Op.bind(proc, target, buffer) + Op.bind(dp, target, buffer) buffer = [] // when a *startingCriteria* is defined, close the open frame flag isOpen = (startingCriteria == null) } if( stopOnFirst ) { if( remainder && buffer ) - Op.bind(proc, target, buffer) - proc.terminate() + Op.bind(dp, target, buffer) + dp.terminate() } } diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/CombineOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/CombineOp.groovy index 139da19690..3977711e12 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/CombineOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/CombineOp.groovy @@ -111,7 +111,7 @@ class CombineOp { } opts.onComplete = { DataflowProcessor dp -> - if( stopCount.decrementAndGet()==0) { + if( stopCount.decrementAndGet()==0 ) { Op.bind(dp, target, Channel.STOP) }} diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/DistinctOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/DistinctOp.groovy index fde51bc16b..00df03a9d1 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/DistinctOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/DistinctOp.groovy @@ -61,11 +61,11 @@ class DistinctOp { def previous = null final code = { - final proc = getDelegate() as DataflowProcessor + final dp = getDelegate() as DataflowProcessor final key = comparator.call(it) if( key != previous ) { previous = key - Op.bind(proc, target, it) + Op.bind(dp, target, it) } } diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/FilterOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/FilterOp.groovy index e3250216bc..df5bec5842 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/FilterOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/FilterOp.groovy @@ -68,12 +68,12 @@ class FilterOp { final result = criteria instanceof Closure ? DefaultTypeTransformation.castToBoolean(criteria.call(it)) : discriminator.invoke(criteria, (Object)it) - final proc = getDelegate() as DataflowProcessor + final dp = getDelegate() as DataflowProcessor if( result ) { - Op.bind(proc, target, it) + Op.bind(dp, target, it) } if( stopOnFirst ) { - Op.bind(proc, target, Channel.STOP) + Op.bind(dp, target, Channel.STOP) } }) diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/FirstOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/FirstOp.groovy index dfb9cfd729..22805ad527 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/FirstOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/FirstOp.groovy @@ -78,12 +78,12 @@ class FirstOp { } final code = { - final proc = getDelegate() as DataflowProcessor + final dp = getDelegate() as DataflowProcessor final accept = discriminator.invoke(criteria, it) if( accept ) - Op.bind(proc, target, it) + Op.bind(dp, target, it) if( accept || stopOnFirst ) - proc.terminate() + dp.terminate() } new Op() diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/FlatMapOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/FlatMapOp.groovy index 79d4f1fe75..86959732de 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/FlatMapOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/FlatMapOp.groovy @@ -65,31 +65,31 @@ class FlatMapOp { .withListener(stopErrorListener(source,target)) .withCode { Object item -> final result = mapper != null ? mapper.call(item) : item - final proc = getDelegate() as DataflowProcessor + final dp = getDelegate() as DataflowProcessor switch( result ) { case Collection: - result.each { it -> Op.bind(proc, target,it) } + result.each { it -> Op.bind(dp, target,it) } break case (Object[]): - result.each { it -> Op.bind(proc, target,it) } + result.each { it -> Op.bind(dp, target,it) } break case Map: - result.each { it -> Op.bind(proc, target,it) } + result.each { it -> Op.bind(dp, target,it) } break case Map.Entry: - Op.bind(proc, target, (result as Map.Entry).key ) - Op.bind(proc, target, (result as Map.Entry).value ) + Op.bind(dp, target, (result as Map.Entry).key ) + Op.bind(dp, target, (result as Map.Entry).value ) break case Channel.VOID: break default: - Op.bind(proc, target, result) + Op.bind(dp, target, result) } } .apply() diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/op/Op.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/op/Op.groovy index f7ada40b30..6001b26099 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/op/Op.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/op/Op.groovy @@ -61,16 +61,16 @@ class Op { obj instanceof Tracker.Msg ? obj : Tracker.Msg.of(obj) } - static void bind(DataflowProcessor operator, DataflowWriteChannel channel, Object msg) { + static void bind(DataflowProcessor dp, DataflowWriteChannel channel, Object msg) { try { if( msg instanceof PoisonPill ) { channel.bind(msg) - allContexts.remove(operator) + allContexts.remove(dp) } else { - final ctx = allContexts.get(operator) + final ctx = allContexts.get(dp) if( !ctx ) - throw new IllegalStateException("Cannot find any context for operator=$operator") + throw new IllegalStateException("Cannot find any context for operator=$dp") final run = ctx.getOperatorRun() Prov.getTracker().bindOutput(run, channel, msg) } @@ -81,7 +81,7 @@ class Op { } } - static bind(OperatorRun run, DataflowWriteChannel channel, Object msg) { + static void bind(OperatorRun run, DataflowWriteChannel channel, Object msg) { Prov.getTracker().bindOutput(run, channel, msg) }