From abd011ef82883c7cb38f51218bff2c4b25540f57 Mon Sep 17 00:00:00 2001 From: Andrew Golovashevich Date: Wed, 26 Mar 2025 02:22:47 +0300 Subject: [PATCH] Updated libraries to able compile to java 8 --- build.gradle.kts | 9 +++++---- .../jdbc_resources_manager/PreparedStatementWrapper.kt | 4 +--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 694affc..12b5163 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,14 +31,15 @@ xomrk { jvm { withJava() - /*compilations.configureEach { + compilations.configureEach { compileJavaTaskProvider?.configure { + sourceCompatibility = "1.8" targetCompatibility = "1.8" } compileTaskProvider.configure { compilerOptions { jvmTarget = JvmTarget.JVM_1_8 } } - }*/ + } } sourceSets { @@ -47,8 +48,8 @@ xomrk { compileOnly("org.jetbrains:annotations:26.0.2") compileOnly("com.intellij:annotations:9.0.4") implementation("it.unimi.dsi:fastutil:6.3") - implementation("ru.landgrafhomyak.utility:highlevel-try-finally:0.4") - implementation("ru.landgrafhomyak.utility:reference-counter:0.1") + implementation("ru.landgrafhomyak.utility:highlevel-try-finally:0.5") + implementation("ru.landgrafhomyak.utility:reference-counter:0.2") } } } diff --git a/src/jvmMain/kotlin/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementWrapper.kt b/src/jvmMain/kotlin/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementWrapper.kt index a222629..45aae5b 100644 --- a/src/jvmMain/kotlin/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementWrapper.kt +++ b/src/jvmMain/kotlin/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementWrapper.kt @@ -31,18 +31,16 @@ internal abstract class PreparedStatementWrapper(@JvmField protected val _orig: private val _refcnt = CloseableReferenceCounter("This prepared statement was returned to pool to be used in future") private var _currentQuery: ResultSetWrapper? = null private var _closeOnCompletion: Boolean = false - private var _isClosed = false @Throws(SQLException::class) protected abstract fun _onClose() override fun close() { this._refcnt.close("Can't close prepared statement while it's in use") - this._isClosed = true this._onClose() } - override fun isClosed(): Boolean = this._isClosed + override fun isClosed(): Boolean = this._refcnt.isClosed override fun closeOnCompletion() = this._refcnt.withRef { this._closeOnCompletion = true }