From d4ea37bd81cf4305bc36fbbec98b4f4dc95780f4 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Wed, 14 Oct 2015 23:10:18 -0700 Subject: [PATCH] Warnings. --- .../com/beust/kobalt/internal/DynamicGraph.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt b/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt index 7ef6d37d..eaceb07d 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt @@ -4,7 +4,6 @@ import com.beust.kobalt.misc.NamedThreadFactory import com.beust.kobalt.misc.ToString import com.beust.kobalt.misc.log import com.google.common.collect.ArrayListMultimap -import java.util.* import java.util.concurrent.* open class TaskResult2(success: Boolean, val value: T) : TaskResult(success) { @@ -46,7 +45,7 @@ public class DynamicGraphExecutor(val graph: DynamicGraph, synchronized(graph) { val freeNodes = graph.freeNodes freeNodes.forEach { graph.setStatus(it, DynamicGraph.Status.RUNNING)} - log(3, "submitting free nodes ${freeNodes}") + log(3, "submitting free nodes $freeNodes") val callables : List> = factory.createWorkers(freeNodes) callables.forEach { completion.submit(it) } var n = callables.size() @@ -56,7 +55,7 @@ public class DynamicGraphExecutor(val graph: DynamicGraph, try { val future = completion.take() val taskResult = future.get(2, TimeUnit.SECONDS) - log(3, "Received task result ${taskResult}") + log(3, "Received task result $taskResult") n-- graph.setStatus(taskResult.value, if (taskResult.success) { @@ -78,8 +77,6 @@ public class DynamicGraphExecutor(val graph: DynamicGraph, * Representation of the graph of methods. */ public class DynamicGraph { - private val DEBUG = false - private val nodesReady = linkedSetOf() private val nodesRunning = linkedSetOf() private val nodesFinished = linkedSetOf() @@ -92,7 +89,7 @@ public class DynamicGraph { * Define a comparator for the nodes of this graph, which will be used * to order the free nodes when they are asked. */ - public val comparator : Comparator? = null +// public val comparator : Comparator? = null enum class Status { READY, RUNNING, FINISHED, ERROR, SKIPPED @@ -146,7 +143,7 @@ public class DynamicGraph { // } // } - log(3, "freeNodes: ${result}") + log(3, "freeNodes: $result") return result } @@ -176,7 +173,7 @@ public class DynamicGraph { private fun setSkipStatus(node: T, status: Status) { dependingOn.get(node).forEach { if (! nodesSkipped.contains(it)) { - log(3, "Node skipped: ${it}") + log(3, "Node skipped: $it") nodesSkipped.add(it) nodesReady.remove(it) setSkipStatus(it, status) @@ -194,7 +191,7 @@ public class DynamicGraph { Status.RUNNING -> nodesRunning.add(node) Status.FINISHED -> nodesFinished.add(node) Status.ERROR -> { - log(3, "Node in error: ${node}") + log(3, "Node in error: $node") nodesReady.remove(node) nodesInError.add(node) setSkipStatus(node, status)