From f066b6d99ec17b771c2437e3e564f762a0bf759c Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 8 Oct 2015 23:04:53 -0700 Subject: [PATCH] Code clean up. --- src/main/kotlin/com/beust/kobalt/maven/Pom.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/maven/Pom.kt b/src/main/kotlin/com/beust/kobalt/maven/Pom.kt index deb7bbdd..0bfea321 100644 --- a/src/main/kotlin/com/beust/kobalt/maven/Pom.kt +++ b/src/main/kotlin/com/beust/kobalt/maven/Pom.kt @@ -12,8 +12,8 @@ import kotlin.dom.childElements public class Pom @javax.inject.Inject constructor(@Assisted val id: String, @Assisted documentFile: java.io.File) : KobaltLogger { - val XPATH_FACTORY = javax.xml.xpath.XPathFactory.newInstance(); - val XPATH = XPATH_FACTORY.newXPath(); + val XPATH_FACTORY = javax.xml.xpath.XPathFactory.newInstance() + val XPATH = XPATH_FACTORY.newXPath() var groupId: String? = null var artifactId: String? = null var version: String? = null @@ -70,22 +70,22 @@ public class Pom @javax.inject.Inject constructor(@Assisted val id: String, } val deps = DEPENDENCIES.evaluate(document, XPathConstants.NODESET) as NodeList - for (i in 0..deps.getLength() - 1) { + for (i in 0..deps.length - 1) { val d = deps.item(i) as NodeList var groupId: String? = null var artifactId: String? = null var version: String = "" var optional: Boolean? = false var scope: String? = null - for (j in 0..d.getLength() - 1) { + for (j in 0..d.length - 1) { val e = d.item(j) if (e is Element) { - when (e.getTagName()) { - "groupId" -> groupId = e.getTextContent () - "artifactId" -> artifactId = e.getTextContent() - "version" -> version = e.getTextContent() - "optional" -> optional = "true".equals(e.getTextContent(), true) - "scope" -> scope = e.getTextContent() + when (e.tagName) { + "groupId" -> groupId = e.textContent + "artifactId" -> artifactId = e.textContent + "version" -> version = e.textContent + "optional" -> optional = "true".equals(e.textContent, true) + "scope" -> scope = e.textContent } } }