aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-utils
diff options
context:
space:
mode:
authorFilip Krzywka <filip.krzywka@nokia.com>2018-11-27 13:04:48 +0100
committerFilip Krzywka <filip.krzywka@nokia.com>2018-11-28 08:07:22 +0100
commit77f896523f2065b1da1be21545155a29edea5122 (patch)
tree4c310e94f4836d2324f1689ca44f226f158b7886 /hv-collector-utils
parent4f683d3e17025131a297baa67300da679bb85141 (diff)
Bump checkstyle version
- changed plugin invocation due to backwards incompatible changes made in detekt's RC9 version - disabled few rules that we actually don't follow in our code and we seem to be fine with it - turned on UnusedPrivateMember as it actually is a code smell/debt - supressed warnings in where it was plausible (according to common sense) - fixed warnings wherever possible Change-Id: I7be97f471ff46786ef1fca3432b759e7820ac681 Issue-ID: DCAEGEN2-996 Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
Diffstat (limited to 'hv-collector-utils')
-rw-r--r--hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt2
-rw-r--r--hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/logging/Logger.kt10
-rw-r--r--hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt1
3 files changed, 2 insertions, 11 deletions
diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt
index da5ff918..b14f1be5 100644
--- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt
+++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt
@@ -23,11 +23,9 @@ import arrow.core.Either
import arrow.core.Option
import arrow.core.Try
import arrow.core.flatMap
-import arrow.core.getOrElse
import org.apache.commons.cli.CommandLine
import org.apache.commons.cli.CommandLineParser
import org.apache.commons.cli.Options
-import org.onap.dcae.collectors.veshv.utils.arrow.fromNullablesChain
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/logging/Logger.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/logging/Logger.kt
index 536fe93c..e8b9f439 100644
--- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/logging/Logger.kt
+++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/logging/Logger.kt
@@ -19,9 +19,10 @@
*/
package org.onap.dcae.collectors.veshv.utils.logging
-import org.slf4j.LoggerFactory
import kotlin.reflect.KClass
+import org.slf4j.LoggerFactory
+@Suppress("TooManyFunctions")
class Logger(val logger: org.slf4j.Logger) {
constructor(clazz: KClass<out Any>) : this(LoggerFactory.getLogger(clazz.java))
constructor(name: String) : this(LoggerFactory.getLogger(name))
@@ -39,7 +40,6 @@ class Logger(val logger: org.slf4j.Logger) {
}
}
-
//
// DEBUG
//
@@ -64,7 +64,6 @@ class Logger(val logger: org.slf4j.Logger) {
}
}
-
//
// INFO
//
@@ -72,7 +71,6 @@ class Logger(val logger: org.slf4j.Logger) {
logger.info(message)
}
-
fun info(messageProvider: () -> String) {
if (logger.isInfoEnabled) {
logger.info(messageProvider())
@@ -83,14 +81,12 @@ class Logger(val logger: org.slf4j.Logger) {
logger.info(message, t)
}
-
fun info(t: Throwable, messageProvider: () -> String) {
if (logger.isInfoEnabled) {
logger.info(messageProvider(), t)
}
}
-
//
// WARN
//
@@ -115,7 +111,6 @@ class Logger(val logger: org.slf4j.Logger) {
}
}
-
//
// ERROR
//
@@ -124,7 +119,6 @@ class Logger(val logger: org.slf4j.Logger) {
logger.error(message)
}
-
fun error(message: String, t: Throwable) {
logger.error(message, t)
}
diff --git a/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt b/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
index 462aabe5..c27fb8c8 100644
--- a/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
+++ b/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
@@ -19,7 +19,6 @@
*/
package org.onap.dcae.collectors.veshv.utils.logging
-import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.verifyNoMoreInteractions