8000 upgrade dependencies by oshai · Pull Request #401 · jasync-sql/jasync-sql · GitHub
[go: up one dir, main page]

Skip to content

upgrade dependencies #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ subprojects {
withJavadocJar()
}

sourceSets.main {
java.srcDirs("src/main/java")
}

val varintName = when (project.name) {
"db-async-common" -> "jasync-common"
"pool-async" -> "jasync-pool"
Expand Down
4 changes: 2 additions & 2 deletions db-async-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ val LOGBACK_VERSION: String by project
val AWAITILITY_VERSION: String by project

dependencies {
compile(project(":pool-async"))
api(project(":pool-async"))
api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLIN_COROUTINES_VERSION")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLIN_COROUTINES_VERSION")
implementation("org.slf4j:slf4j-api:$SL4J_VERSION")
implementation("io.netty:netty-transport:$NETTY_VERSION")
implementation("io.netty:netty-handler:$NETTY_VERSION")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ abstract class ConcreteConnectionBase(
val p = CompletableFuture<A>()
f(this).onCompleteAsync(configuration.executionContext) { ty1 ->
sendQuery(if (ty1.isFailure) "ROLLBACK" else "COMMIT").onCompleteAsync(configuration.executionContext) { ty2 ->
if (ty2.isFailure && ty1.isSuccess)
if (ty 2851 2.isFailure && ty1.isSuccess) {
p.failed((ty2 as Failure).exception)
else
} else {
p.complete(ty1)
}
}
}
p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Configuration @JvmOverloads constructor(
val currentSchema: String? = null,
val socketPath: String? = null,
val credentialsProvider: CredentialsProvider? = null,
val rsaPublicKey: Path? = null,
val rsaPublicKey: Path? = null
) {
init {
if (socketPath != null && eventLoopGroup is NioEventLoopGroup) {
Expand Down Expand Up @@ -99,7 +99,7 @@ class Configuration @JvmOverloads constructor(
currentSchema: String? = null,
socketPath: String? = null,
credentialsProvider: CredentialsProvider? = null,
rsaPublicKey: Path? = null,
rsaPublicKey: Path? = null
): Configuration {
return Configuration(
username = username ?: this.username,
Expand All @@ -120,14 +120,14 @@ class Configuration @JvmOverloads constructor(
currentSchema = currentSchema ?: this.currentSchema,
socketPath = socketPath ?: this.socketPath,
credentialsProvider = credentialsProvider ?: this.credentialsProvider,
rsaPublicKey = rsaPublicKey ?: this.rsaPublicKey,
rsaPublicKey = rsaPublicKey ?: this.rsaPublicKey
)
}

@Deprecated(
"backward compatibility for https://github.com/jasync-sql/jasync-sql/issues/359",
ReplaceWith("copy()"),
DeprecationLevel.ERROR,
DeprecationLevel.ERROR
)
fun copy(
username: String? = null,
Expand All @@ -146,7 +146,7 @@ class Configuration @JvmOverloads constructor(
eventLoopGroup: EventLoopGroup? = null,
executionContext: Executor? = null,
currentSchema: String? = null,
socketPath: String? = null,
socketPath: String? = null
): Configuration {
return Configuration(
username = username ?: this.username,
Expand All @@ -167,7 +167,7 @@ class Configuration @JvmOverloads constructor(
currentSchema = currentSchema ?: this.currentSchema,
socketPath = socketPath ?: this.socketPath,
credentialsProvider = this.credentialsProvider,
rsaPublicKey = this.rsaPublicKey,
rsaPublicKey = this.rsaPublicKey
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ConnectionPoolConfiguration @JvmOverloads constructor(
val currentSchema: String? = null,
val socketPath: String? = null,
val credentialsProvider: CredentialsProvider? = null,
val minIdleConnections: Int? = null,
val minIdleConnections: Int? = null
) {
init {
require(port > 0) { "port should be positive: $port" }
Expand Down Expand Up @@ -130,7 +130,7 @@ class ConnectionPoolConfiguration @JvmOverloads constructor(
testTimeout = connectionTestTimeout,
queryTimeout = queryTimeout,
coroutineDispatcher = coroutineDispatcher,
minIdleObjects = minIdleConnections,
minIdleObjects = minIdleConnections
)

override fun toString() = """ConnectionPoolConfiguration(host=$host, port=REDACTED,
Expand All @@ -151,7 +151,8 @@ class ConnectionPoolConfiguration @JvmOverloads constructor(
|interceptors=$interceptors,
|maxConnectionTtl=$maxConnectionTtl
|minIdleConnections=$minIdleConnections)""${'"'}.trimMargin()
|)""".trimMargin()
|)
""".trimMargin()

@JvmOverloads
fun copy(
Expand Down Expand Up @@ -180,7 +181,7 @@ class ConnectionPoolConfiguration @JvmOverloads constructor(
currentSchema: String? = null,
socketPath: String? = null,
credentialsProvider: CredentialsProvider? = null,
minIdleConnections: Int? = null,
minIdleConnections: Int? = null
): ConnectionPoolConfiguration {
return ConnectionPoolConfiguration(
username = username ?: this.username,
Expand Down Expand Up @@ -341,6 +342,6 @@ data class ConnectionPoolConfigurationBuilder @JvmOverloads constructor(
currentSchema = currentSchema,
socketPath = socketPath,
credentialsProvider = credentialsProvider,
minIdleConnections = minIdleConnections,
minIdleConnections = minIdleConnections
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ package com.github.jasync.sql.db.exceptions
@Suppress("RedundantVisibilityModifier")
public class InsufficientParametersException(expected: Int, given: List<Any?>) : DatabaseException(
"The query contains %s parameters but you gave it %s (%s)".format(
expected, given.size, given.joinToString(",")
expected,
given.size,
given.joinToString(",")
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class ConnectionPool<T : ConcreteConnection>(
values: List<Any?>,
release: Boolean
): CompletableFuture<QueryResult> {

return wrapPreparedStatementWithInterceptors(
PreparedStatementParams(query, values, release),
configuration.interceptors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ abstract class AbstractURIParser {
protected fun unwrapIpv6address(server: String): String {
return if (server.startsWith("<")) {
server.substring(1, server.length - 1)
} else server
} else {
server
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConnectionPoolConfigurationTest {
maximumMessageSize = 17,
applicationName = "applicationName",
maxConnectionTtl = 18,
minIdleConnections = 5,
minIdleConnections = 5
).build()
assertThat(configuration.host).isEqualTo("host")
assertThat(configuration.connectionConfiguration.host).isEqualTo("host")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class HexCodecSpec {

@Test
fun `correctly generate a byte array from the PG output`() {

val input = "\\x53617920"
val bytes = byteArrayOf(83, 97, 121, 32)
assertEquals(HexCodec.decode(input, 2).toList(), bytes.toList())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class VersionSpec {

@Test
fun `correctly compare between major different versions 1`() {

val version1 = parseVersion("8.2.0")
val version2 = parseVersion("9.2.0")

Expand All @@ -32,7 +31,6 @@ class VersionSpec {

@Test
fun `correctly compare between major different versions 2`() {

val version1 = parseVersion("8.2.0")
val version2 = parseVersion("8.2.0")

Expand All @@ -41,7 +39,6 @@ class VersionSpec {

@Test
fun `correctly compare between major different versions 3`() {

val version1 = parseVersion("8.2.8")
val version2 = parseVersion("8.2.87")

Expand All @@ -50,7 +47,6 @@ class VersionSpec {

@Test
fun `correctly compare two different versions`() {

val version1 = parseVersion("9.1.2")
val version2 = parseVersion("9.2.0")

Expand Down
17 changes: 9 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
KOTLIN_VERSION=1.6.21
KTLINT_VERSION=11.0.0
KOTLIN_VERSION=1.8.21
KTLINT_VERSION=11.3.1
JACOCO_VERSION=0.8.8
KOTLIN_COROUTINES_VERSION=1.6.1
KOTLIN_COROUTINES_VERSION=1.7.1
SL4J_VERSION=1.7.25
JODA_VERSION=2.11.2
JODA_CONVERT_VERSION=2.2.2
NETTY_VERSION=4.1.86.Final
JODA_VERSION=2.12.5
JODA_CONVERT_VERSION=2.2.3
NETTY_VERSION=4.1.93.Final
KOTLIN_LOGGING_VERSION=2.1.21
SCRAM_CLIENT_VERSION=2.1
R2DBC_SPI_VERSION=1.0.0.RELEASE
REACTOR_CORE_VERSION=3.4.23
REACTOR_CORE_VERSION=3.5.7
REACTOR_KOTLIN_EXTENSION=1.2.2
JUNIT_VERSION=4.13.2
ASSERTJ_VERSION=3.23.1
MOCKK_VERSION=1.9
LOGBACK_VERSION=1.1.8
TEST_CONTAINERS_VERSION=1.17.6
MYSQL_CONNECTOR_VERSION=5.1.47
AWAITILITY_VERSION=3.1.5
THREETEN_EXTRA=1.6.0
THREETEN_EXTRA=1.7.2
JTS_VERSION=1.19.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
16 changes: 8 additions & 8 deletions mysql-async/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ val MYSQL_CONNECTOR_VERSION: String by project
val AWAITILITY_VERSION: String by project

dependencies {
compile(project(":pool-async"))
compile(project(":db-async-common"))
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLIN_COROUTINES_VERSION")
compile("org.slf4j:slf4j-api:$SL4J_VERSION")
compile("io.netty:netty-transport:$NETTY_VERSION")
compile("io.netty:netty-handler:$NETTY_VERSION")
api(project(":pool-async"))
api(project(":db-async-common"))
api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLIN_COROUTINES_VERSION")
api("org.slf4j:slf4j-api:$SL4J_VERSION")
api("io.netty:netty-transport:$NETTY_VERSION")
api("io.netty:netty-handler:$NETTY_VERSION")
testImplementation("io.netty:netty-transport-native-epoll:$NETTY_VERSION:linux-x86_64")
compile("io.github.microutils:kotlin-logging:$KOTLIN_LOGGING_VERSION")
api("io.github.microutils:kotlin-logging:$KOTLIN_LOGGING_VERSION")
testImplementation("junit:junit:$JUNIT_VERSION")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$KOTLIN_VERSION")
testImplementation("org.assertj:assertj-core:$ASSERTJ_VERSION")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class MySQLConnection @JvmOverloads constructor(
password = configuration.password,
appName = configuration.applicationName,
sslConfiguration = configuration.ssl,
rsaPublicKey = configuration.rsaPublicKey,
rsaPublicKey = configuration.rsaPublicKey
)

if (!switchToSsl) {
Expand Down Expand Up @@ -394,8 +394,11 @@ class MySQLConnection @JvmOverloads constructor(
sendQuery(query)
}.mapTry { queryResult, throwable ->
// Cancellation exception will be ignored so that the following transaction clean up can be executed
if (throwable is CancellationException) QueryResult(rowsAffected = 0L, statusMessage = null)
else queryResult
if (throwable is CancellationException) {
QueryResult(rowsAffected = 0L, statusMessage = null)
} else {
queryResult
}
}
}

Expand Down Expand Up @@ -503,8 +506,9 @@ class MySQLConnection @JvmOverloads constructor(
private fun queryPromise(): Optional<CompletableFuture<QueryResult>> = queryPromiseReference.get()

private fun setQueryPromise(promise: CompletableFuture<QueryResult>) {
if (!this.queryPromiseReference.compareAndSet(Optional.empty(), Optional.of(promise)))
if (!this.queryPromiseReference.compareAndSet(Optional.empty(), Optional.of(promise))) {
throw ConnectionStillRunningQueryException(this.id, true)
}
}

private fun clearQueryPromise(): Optional<CompletableFuture<QueryResult>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ private val logger = KotlinLogging.logger {}
class BinaryRowDecoder {

fun decode(buffer: ByteBuf, columns: List<ColumnDefinitionMessage>): Array<Any?> {

logger.trace { "columns are ${buffer.readableBytes()} - $columns" }
logger.trace { "decoding row\n${BufferDumper.dumpAsHex(buffer)}" }
PrintUtils.printArray("bitmap", buffer)
Expand All @@ -31,7 +30,6 @@ class BinaryRowDecoder {
val result = if ((nullBitMask[nullMaskPos].toInt() and bit) != 0) {
null
} else {

val column = columns[it]

logger.trace { "${buffer.readableBytes()}" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class BinaryRowEncoder(charset: Charset) {
)

fun encoderFor(v: Any): BinaryEncoder {

return this.encoders.getOrElse(v::class.java) {
return when (v) {
is CharSequence -> this.stringEncoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import java.time.Duration

object TimeDecoder : BinaryDecoder {
override fun decode(buffer: ByteBuf): Duration {

val unsignedByte = buffer.readUnsignedByte()
return when (unsignedByte) {
0.toShort() -> 0.seconds
8.toShort() -> {

val isNegative = buffer.readUnsignedByte() == 1.toShort()

val duration = buffer.readUnsignedInt().days +
Expand All @@ -32,7 +30,6 @@ object TimeDecoder : BinaryDecoder {
}
}
12.toShort() -> {

val isNegative = buffer.readUnsignedByte() == 1.toShort()

val duration = buffer.readUnsignedInt().days +
Expand Down
Loading
0