diff options
author | Filip Krzywka <filip.krzywka@nokia.com> | 2018-11-27 13:04:48 +0100 |
---|---|---|
committer | Filip Krzywka <filip.krzywka@nokia.com> | 2018-11-28 08:07:22 +0100 |
commit | 77f896523f2065b1da1be21545155a29edea5122 (patch) | |
tree | 4c310e94f4836d2324f1689ca44f226f158b7886 /hv-collector-core | |
parent | 4f683d3e17025131a297baa67300da679bb85141 (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-core')
3 files changed, 6 insertions, 7 deletions
diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt index 78afe9fd..8c16736d 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt @@ -36,6 +36,5 @@ object AdapterFactory { fun consulConfigurationProvider(configurationProviderParams: ConfigurationProviderParams): ConfigurationProvider = ConsulConfigurationProvider(httpAdapter(), configurationProviderParams) - fun httpAdapter(): HttpAdapter = HttpAdapter(HttpClient.create()) + private fun httpAdapter(): HttpAdapter = HttpAdapter(HttpClient.create()) } - diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt index 1672158e..bdce6f73 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt @@ -23,8 +23,6 @@ import io.netty.handler.codec.http.HttpStatusClass import org.slf4j.LoggerFactory import reactor.core.publisher.Mono import reactor.netty.http.client.HttpClient -import java.lang.IllegalStateException -import java.nio.charset.Charset /** * @author Jakub Dudycz <jakub.dudycz@nokia.com> @@ -40,8 +38,10 @@ open class HttpAdapter(private val httpClient: HttpClient) { .responseSingle { response, content -> if (response.status().codeClass() == HttpStatusClass.SUCCESS) content.asString() - else - Mono.error(IllegalStateException("$url ${response.status().code()} ${response.status().reasonPhrase()}")) + else { + val errorMessage = "$url ${response.status().code()} ${response.status().reasonPhrase()}" + Mono.error(IllegalStateException(errorMessage)) + } } .doOnError { logger.error("Failed to get resource on path: $url (${it.localizedMessage})") diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt index a42b982f..bab95c57 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt @@ -75,7 +75,7 @@ class RouteBuilder { } fun withFixedPartitioning(num: Int = 0) { - partitioning = { _ -> num } + partitioning = { num } } fun build() = Route(domain, targetTopic, partitioning) |