diff --git a/build.gradle.kts b/build.gradle.kts index 2c1fd190..8b1c5997 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,10 @@ allprojects { } kotlin { - compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8) + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.add("-Werror") + } } tasks { diff --git a/kotlin-mbedtls-netty/src/jmh/kotlin/benchmark/netty/NettyBenchmark.kt b/kotlin-mbedtls-netty/src/jmh/kotlin/benchmark/netty/NettyBenchmark.kt index fe46632a..aeb7037a 100644 --- a/kotlin-mbedtls-netty/src/jmh/kotlin/benchmark/netty/NettyBenchmark.kt +++ b/kotlin-mbedtls-netty/src/jmh/kotlin/benchmark/netty/NettyBenchmark.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) + * Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) * SPDX-License-Identifier: Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ open class NettyBenchmark { "direct" -> PooledByteBufAllocator(true) "unpooled" -> UnpooledByteBufAllocator(false) "heap" -> PooledByteBufAllocator(false) - "heap-8kb" -> PooledByteBufAllocator(false, 2, 2, 8192, 1) + "heap-8kb" -> PooledByteBufAllocator(false, 2, 2, 8192, 1, 256, 64, false) // Note: max order is set to 2 so that allocated single byte[] is 8kB, with default one it is 4MB and slows down drastically performance else -> throw IllegalArgumentException() diff --git a/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/CompletableQueue.kt b/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/CompletableQueue.kt index 47fbd22e..dafa9b86 100644 --- a/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/CompletableQueue.kt +++ b/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/CompletableQueue.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) + * Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) * SPDX-License-Identifier: Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ internal class CompletableQueue { @Synchronized fun add(obj: T) { - if (!queue.isEmpty() && !queue.first.isDone) { + if (!queue.isEmpty() && !queue.first().isDone) { queue.removeFirst().complete(obj) } else { queue.addLast(CompletableFuture.completedFuture(obj)) @@ -33,7 +33,7 @@ internal class CompletableQueue { @Synchronized fun poll(): CompletableFuture { - if (!queue.isEmpty() && queue.first.isDone) { + if (!queue.isEmpty() && queue.first().isDone) { return queue.removeFirst() } val promise = CompletableFuture() diff --git a/kotlin-mbedtls/src/main/kotlin/org/opencoap/ssl/transport/DtlsTransmitter.kt b/kotlin-mbedtls/src/main/kotlin/org/opencoap/ssl/transport/DtlsTransmitter.kt index 4740d6c3..8a48ae5f 100644 --- a/kotlin-mbedtls/src/main/kotlin/org/opencoap/ssl/transport/DtlsTransmitter.kt +++ b/kotlin-mbedtls/src/main/kotlin/org/opencoap/ssl/transport/DtlsTransmitter.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) + * Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls) * SPDX-License-Identifier: Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -162,7 +162,6 @@ class DtlsTransmitter private constructor( } @JvmStatic - @JvmOverloads fun create(dest: InetSocketAddress, sslSession: SslSession, cnnTransmitter: Transport): DtlsTransmitter { return DtlsTransmitter(dest, cnnTransmitter, sslSession, newSingleExecutor()) }