From 25ea79e5bc9e354f4769f5b3ec71c0f3270da2e6 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Fri, 25 Oct 2024 14:00:23 +0530 Subject: [PATCH 1/4] Migrate to Java 21 --- .../workflows/build-timestamped-master.yml | 2 +- .../workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/fossa_scan.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- README.md | 2 +- ballerina/Ballerina.toml | 12 ++--- ballerina/Dependencies.toml | 43 +++++++-------- build-config/resources/Ballerina.toml | 12 ++--- build-config/spotbugs-exclude.xml | 12 +++++ compiler-plugin-tests/build.gradle | 9 ++-- compiler-plugin/build.gradle | 7 ++- gradle.properties | 42 +++++++-------- native/build.gradle | 9 ++-- .../sql/datasource/SQLWorkerThreadPool.java | 54 ------------------- .../stdlib/sql/nativeimpl/CallProcessor.java | 13 ++--- .../sql/nativeimpl/ExecuteProcessor.java | 24 ++------- .../stdlib/sql/nativeimpl/QueryProcessor.java | 26 +++------ test-utils/build.gradle | 7 ++- 21 files changed, 108 insertions(+), 178 deletions(-) delete mode 100644 native/src/main/java/io/ballerina/stdlib/sql/datasource/SQLWorkerThreadPool.java diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index 2d154ffc..f202d1aa 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -14,5 +14,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 65d785ad..341a7a88 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 11922b55..ebe213e7 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/fossa_scan.yml b/.github/workflows/fossa_scan.yml index 651f73a6..a2862efe 100644 --- a/.github/workflows/fossa_scan.yml +++ b/.github/workflows/fossa_scan.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: fossas/fossa-action@main + - uses: fossas/fossa-action@java21 env: packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5e6adfe3..2478fd39 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 secrets: inherit with: package-name: sql diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c717ff55..f85a9816 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,7 +10,7 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 secrets: inherit with: additional-windows-test-flags: "-x test" diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index c02c8ff4..41e8f6ad 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 secrets: inherit diff --git a/README.md b/README.md index e79392d9..4cf972ff 100644 --- a/README.md +++ b/README.md @@ -429,7 +429,7 @@ This repository only contains the source code for the package. ### Set up the prerequisites -1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations). +1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations). * [Oracle](https://www.oracle.com/java/technologies/downloads/) * [OpenJDK](https://adoptium.net/) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index e283ceee..7e0a9a99 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -7,27 +7,27 @@ keywords = ["database", "client", "network", "SQL", "RDBMS"] repository = "https://github.com/ballerina-platform/module-ballerina-sql" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.10.0-20241019-091600-89e54c08" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "sql-native" version = "1.14.2" path = "../native/build/libs/sql-native-1.14.2-SNAPSHOT.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "../test-utils/build/libs/sql-test-utils-1.14.2-SNAPSHOT.jar" scope = "testOnly" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "com.zaxxer" artifactId = "HikariCP" version = "3.3.1" path = "./lib/HikariCP-3.3.1.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "./lib/hsqldb-2.7.1.jar" scope = "testOnly" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 91958039..eebd5468 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.10.0-20241019-091600-89e54c08" [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -23,19 +23,18 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -44,7 +43,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.7.3" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -54,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -69,7 +68,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.13.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -98,7 +97,7 @@ dependencies = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.6.2" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -118,7 +117,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.13.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, @@ -127,8 +126,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -245,7 +243,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -257,7 +255,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -269,21 +267,20 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.3.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -292,7 +289,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -322,7 +319,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -346,7 +343,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -357,7 +354,7 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.4.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -366,7 +363,7 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.8.0" +version = "1.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 63cfb32d..84bcbef0 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -7,27 +7,27 @@ keywords = ["database", "client", "network", "SQL", "RDBMS"] repository = "https://github.com/ballerina-platform/module-ballerina-sql" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.10.0-20241019-091600-89e54c08" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "sql-native" version = "@toml.version@" path = "../native/build/libs/sql-native-@project.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "../test-utils/build/libs/sql-test-utils-@project.version@.jar" scope = "testOnly" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "com.zaxxer" artifactId = "HikariCP" version = "@hikkaricp.lib.version@" path = "./lib/HikariCP-@hikkaricp.lib.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "./lib/hsqldb-@hsql.connector.version@.jar" scope = "testOnly" diff --git a/build-config/spotbugs-exclude.xml b/build-config/spotbugs-exclude.xml index 9e424c12..5970bd25 100644 --- a/build-config/spotbugs-exclude.xml +++ b/build-config/spotbugs-exclude.xml @@ -87,4 +87,16 @@ + + + + + + + + + + + + diff --git a/compiler-plugin-tests/build.gradle b/compiler-plugin-tests/build.gradle index cd9216c5..012f45ee 100644 --- a/compiler-plugin-tests/build.gradle +++ b/compiler-plugin-tests/build.gradle @@ -48,7 +48,7 @@ tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } -sourceCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 jacoco { toolVersion = "0.8.10" @@ -83,9 +83,12 @@ jacocoTestReport { } spotbugsTest { + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW ignoreFailures = true - effort = "max" - reportLevel = "low" reportsDir = file("$project.buildDir/reports/spotbugs") def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml") if (excludeFile.exists()) { diff --git a/compiler-plugin/build.gradle b/compiler-plugin/build.gradle index 3c5e610a..dfd6ccaf 100644 --- a/compiler-plugin/build.gradle +++ b/compiler-plugin/build.gradle @@ -47,8 +47,11 @@ checkstyle { checkstyleMain.dependsOn(":checkstyle:downloadCheckstyleRuleFiles") spotbugsMain { - effort "max" - reportLevel "low" + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW reportsDir = file("$project.buildDir/reports/spotbugs") reports { html.enabled true diff --git a/gradle.properties b/gradle.properties index 8d15e091..6ad5dcc9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,52 +7,52 @@ hsqlDriverVersion=2.7.1 h2Version=1.4.200 atomikosLibVersion=5.0.8 checkstyleToolVersion=10.12.1 -githubSpotbugsVersion=5.0.14 +githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0 researchgateReleaseVersion=2.8.0 testngVersion=7.6.1 ballerinaGradlePluginVersion=2.0.1 -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.10.0-20241019-091600-89e54c08 # Direct Dependencies # Level 01 -stdlibIoVersion=1.6.1 -stdlibTimeVersion=2.4.0 +stdlibIoVersion=1.6.2-20240928-084100-656404f +stdlibTimeVersion=2.5.1-20240930-120200-e59222b # Level 02 -stdlibLogVersion=2.10.0 -stdlibOsVersion=1.8.0 +stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 +stdlibOsVersion=1.8.1-20241001-120600-dd1626e # Level 03 -stdlibFileVersion=1.10.0 +stdlibFileVersion=1.10.1-20241007-160900-03f7b64 # Ballerinax Observer -observeVersion=1.3.0 -observeInternalVersion=1.3.0 +observeVersion=1.3.1-20241007-161000-645452d +observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 # Transitive Dependencies # Level 01 -stdlibConstraintVersion=1.5.0 -stdlibUrlVersion=2.4.0 +stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 +stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 # Level 02 -stdlibCryptoVersion=2.7.2 -stdlibTaskVersion=2.5.0 +stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab +stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 # Level 03 -stdlibCacheVersion=3.8.0 -stdlibMimeVersion=2.10.0 -stdlibUuidVersion=1.8.0 +stdlibCacheVersion=3.8.1-20241007-154900-63f4403 +stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 +stdlibUuidVersion=1.8.1-20241009-134600-a05012b # Level 04 -stdlibAuthVersion=2.12.0 -stdlibJwtVersion=2.13.0 -stdlibOAuth2Version=2.12.0 +stdlibAuthVersion=2.12.1-20241010-130800-733dbef +stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 +stdlibOAuth2Version=2.12.1-20241010-123600-0e0cfcc # Level 05 -stdlibHttpVersion=2.12.0 +stdlibHttpVersion=2.13.0-20241022-163700-67b6515 # Level 06 -stdlibTransactionVersion=1.10.0 +stdlibTransactionVersion=1.10.1-20241021-105400-f7e16a8 diff --git a/native/build.gradle b/native/build.gradle index 8cd4179f..c95e08c8 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -47,7 +47,7 @@ tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } -sourceCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 jacoco { toolVersion = "0.8.10" @@ -80,9 +80,12 @@ jacocoTestReport { } spotbugsMain { + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW ignoreFailures = true - effort = "max" - reportLevel = "low" reportsDir = file("$project.buildDir/reports/spotbugs") def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml") if (excludeFile.exists()) { diff --git a/native/src/main/java/io/ballerina/stdlib/sql/datasource/SQLWorkerThreadPool.java b/native/src/main/java/io/ballerina/stdlib/sql/datasource/SQLWorkerThreadPool.java deleted file mode 100644 index e1443075..00000000 --- a/native/src/main/java/io/ballerina/stdlib/sql/datasource/SQLWorkerThreadPool.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package io.ballerina.stdlib.sql.datasource; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import static io.ballerina.stdlib.sql.Constants.BALLERINA_SQL_MAX_POOL_SIZE; - -/** - * Class to hold the static cachedThreadPool for SQL. - */ -public class SQLWorkerThreadPool { - - private SQLWorkerThreadPool() { - } - - static final int MAX_POOL_SIZE = Integer.parseInt( - System.getenv(BALLERINA_SQL_MAX_POOL_SIZE) != null ? - System.getenv(BALLERINA_SQL_MAX_POOL_SIZE) : "50" - ); - - // This is similar to cachedThreadPool util from Executors.newCachedThreadPool(..); but with upper cap on threads - public static final ExecutorService SQL_EXECUTOR_SERVICE = new ThreadPoolExecutor(0, MAX_POOL_SIZE, - 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new SQLThreadFactory()); - - static class SQLThreadFactory implements ThreadFactory { - @Override - public Thread newThread(Runnable r) { - Thread ballerinaSql = new Thread(r); - ballerinaSql.setName("bal-sql-thread"); - return ballerinaSql; - } - } -} diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java index 885a9e8f..9bc7baeb 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java @@ -19,7 +19,6 @@ package io.ballerina.stdlib.sql.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; @@ -61,7 +60,6 @@ import static io.ballerina.stdlib.sql.Constants.RESULT_SET_TOTAL_NATIVE_DATA_FIELD; import static io.ballerina.stdlib.sql.Constants.STATEMENT_NATIVE_DATA_FIELD; import static io.ballerina.stdlib.sql.Constants.TYPE_DESCRIPTIONS_NATIVE_DATA_FIELD; -import static io.ballerina.stdlib.sql.datasource.SQLWorkerThreadPool.SQL_EXECUTOR_SERVICE; import static io.ballerina.stdlib.sql.utils.Utils.getColumnDefinitions; import static io.ballerina.stdlib.sql.utils.Utils.getDefaultStreamConstraint; import static io.ballerina.stdlib.sql.utils.Utils.getSqlQuery; @@ -95,14 +93,9 @@ public static Object nativeCall(Environment env, BObject client, BObject paramSQ boolean withinTrxBlock = Utils.isWithinTrxBlock(trxResourceManager); boolean trxManagerEnabled = trxResourceManager.getTransactionManagerEnabled(); TransactionLocalContext currentTrxContext = trxResourceManager.getCurrentTransactionContext(); - Future balFuture = env.markAsync(); - SQL_EXECUTOR_SERVICE.execute(() -> { - Object resultStream = - nativeCallExecutable(client, paramSQLString, recordTypes, statementParameterProcessor, - resultParameterProcessor, withinTrxBlock, currentTrxContext, trxManagerEnabled); - balFuture.complete(resultStream); - }); - return null; + return env.yieldAndRun(() -> nativeCallExecutable(client, paramSQLString, recordTypes, + statementParameterProcessor, resultParameterProcessor, withinTrxBlock, + currentTrxContext, trxManagerEnabled)); } private static Object nativeCallExecutable(BObject client, BObject paramSQLString, BArray recordTypes, diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/ExecuteProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/ExecuteProcessor.java index 212b47eb..69065dcf 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/ExecuteProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/ExecuteProcessor.java @@ -19,7 +19,6 @@ package io.ballerina.stdlib.sql.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.values.BArray; @@ -49,7 +48,6 @@ import java.util.Locale; import java.util.Map; -import static io.ballerina.stdlib.sql.datasource.SQLWorkerThreadPool.SQL_EXECUTOR_SERVICE; import static io.ballerina.stdlib.sql.utils.Utils.closeResources; import static io.ballerina.stdlib.sql.utils.Utils.getGeneratedKeys; import static io.ballerina.stdlib.sql.utils.Utils.getSqlQuery; @@ -78,15 +76,8 @@ public static Object nativeExecute(Environment env, BObject client, BObject para boolean withinTrxBlock = Utils.isWithinTrxBlock(trxResourceManager); boolean trxManagerEnabled = trxResourceManager.getTransactionManagerEnabled(); TransactionLocalContext currentTrxContext = trxResourceManager.getCurrentTransactionContext(); - Future balFuture = env.markAsync(); - SQL_EXECUTOR_SERVICE.execute(() -> { - Object resultStream = - nativeExecuteExecutable(client, paramSQLString, statementParameterProcessor, withinTrxBlock, - currentTrxContext, trxManagerEnabled); - balFuture.complete(resultStream); - }); - - return null; + return env.yieldAndRun(() -> nativeExecuteExecutable(client, paramSQLString, statementParameterProcessor, + withinTrxBlock, currentTrxContext, trxManagerEnabled)); } private static Object nativeExecuteExecutable(BObject client, BObject paramSQLString, @@ -159,15 +150,8 @@ public static Object nativeBatchExecute(Environment env, BObject client, BArray boolean withinTrxBlock = Utils.isWithinTrxBlock(trxResourceManager); boolean trxManagerEnabled = trxResourceManager.getTransactionManagerEnabled(); TransactionLocalContext currentTrxContext = trxResourceManager.getCurrentTransactionContext(); - Future balFuture = env.markAsync(); - SQL_EXECUTOR_SERVICE.execute(() -> { - Object resultStream = - nativeBatchExecuteExecutable(client, paramSQLStrings, statementParameterProcessor, - withinTrxBlock, currentTrxContext, trxManagerEnabled); - balFuture.complete(resultStream); - }); - - return null; + return env.yieldAndRun(() -> nativeBatchExecuteExecutable(client, paramSQLStrings, statementParameterProcessor, + withinTrxBlock, currentTrxContext, trxManagerEnabled)); } private static Object nativeBatchExecuteExecutable(BObject client, BArray paramSQLStrings, diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java index ff4524fd..c2e2af0c 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java @@ -19,7 +19,6 @@ package io.ballerina.stdlib.sql.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.TypeCreator; @@ -54,7 +53,6 @@ import java.sql.SQLException; import java.util.List; -import static io.ballerina.stdlib.sql.datasource.SQLWorkerThreadPool.SQL_EXECUTOR_SERVICE; import static io.ballerina.stdlib.sql.utils.Utils.getErrorStream; /** @@ -84,14 +82,9 @@ public static BStream nativeQuery(Environment env, BObject client, BObject param boolean withinTrxBlock = Utils.isWithinTrxBlock(trxResourceManager); boolean trxManagerEnabled = trxResourceManager.getTransactionManagerEnabled(); TransactionLocalContext currentTrxContext = trxResourceManager.getCurrentTransactionContext(); - Future balFuture = env.markAsync(); - SQL_EXECUTOR_SERVICE.execute(() -> { - BStream resultStream = - nativeQueryExecutable(client, paramSQLString, recordType, statementParameterProcessor, - resultParameterProcessor, withinTrxBlock, currentTrxContext, trxManagerEnabled); - balFuture.complete(resultStream); - }); - return null; + return env.yieldAndRun(() -> nativeQueryExecutable(client, paramSQLString, recordType, + statementParameterProcessor, resultParameterProcessor, withinTrxBlock, + currentTrxContext, trxManagerEnabled)); } private static BStream nativeQueryExecutable(BObject client, BObject paramSQLString, Object recordType, @@ -156,16 +149,9 @@ public static Object nativeQueryRow(Environment env, BObject client, BObject par boolean withinTrxBlock = Utils.isWithinTrxBlock(trxResourceManager); boolean trxManagerEnabled = trxResourceManager.getTransactionManagerEnabled(); TransactionLocalContext currentTrxContext = trxResourceManager.getCurrentTransactionContext(); - Future balFuture = env.markAsync(); - SQL_EXECUTOR_SERVICE.execute(() -> { - Object resultStream = - nativeQueryRowExecutable(client, paramSQLString, bTypedesc, statementParameterProcessor, - resultParameterProcessor, withinTrxBlock, currentTrxContext, - trxManagerEnabled); - balFuture.complete(resultStream); - }); - - return null; + return env.yieldAndRun(() -> nativeQueryRowExecutable(client, paramSQLString, bTypedesc, + statementParameterProcessor, resultParameterProcessor, withinTrxBlock, + currentTrxContext, trxManagerEnabled)); } private static Object nativeQueryRowExecutable( diff --git a/test-utils/build.gradle b/test-utils/build.gradle index 8c07af5d..f9c906db 100644 --- a/test-utils/build.gradle +++ b/test-utils/build.gradle @@ -32,9 +32,12 @@ dependencies { } spotbugsMain { + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW ignoreFailures = true - effort = "max" - reportLevel = "low" reportsDir = file("$project.buildDir/reports/spotbugs") def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml") if (excludeFile.exists()) { From da87daac1c6b346718d7866b89e334c99c8af83c Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Thu, 7 Nov 2024 11:34:49 +0530 Subject: [PATCH 2/4] Update http and OAuth2 timestamp --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6ad5dcc9..a447aa05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,10 +49,10 @@ stdlibUuidVersion=1.8.1-20241009-134600-a05012b # Level 04 stdlibAuthVersion=2.12.1-20241010-130800-733dbef stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 -stdlibOAuth2Version=2.12.1-20241010-123600-0e0cfcc +stdlibOAuth2Version=2.12.1-20241029-084800-d7ba9e5 # Level 05 -stdlibHttpVersion=2.13.0-20241022-163700-67b6515 +stdlibHttpVersion=2.13.0-20241029-110700-30ed05b # Level 06 stdlibTransactionVersion=1.10.1-20241021-105400-f7e16a8 From c967a90806e7517348e74ad7cec1aba13545e94c Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sat, 16 Nov 2024 12:10:07 +0530 Subject: [PATCH 3/4] Migrate to new runtime APIs --- gradle.properties | 42 +++++++++---------- .../stdlib/sql/datasource/PoolKey.java | 2 +- .../stdlib/sql/nativeimpl/CallProcessor.java | 4 +- .../sql/nativeimpl/OutParameterProcessor.java | 2 +- .../stdlib/sql/nativeimpl/QueryProcessor.java | 4 +- .../AbstractStatementParameterProcessor.java | 2 +- .../DefaultResultParameterProcessor.java | 4 +- .../DefaultStatementParameterProcessor.java | 2 +- .../sql/utils/ProcedureCallResultUtils.java | 2 +- .../io/ballerina/stdlib/sql/utils/Utils.java | 4 +- .../io/ballerina/stdlib/sql/TestUtils.java | 4 +- .../nativeimpl/OutParameterProcessorTest.java | 2 +- .../DefaultResultParameterProcessorTest.java | 2 +- ...efaultStatementParameterProcessorTest.java | 2 +- 14 files changed, 39 insertions(+), 39 deletions(-) diff --git a/gradle.properties b/gradle.properties index 096416d6..07db3715 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,47 +14,47 @@ researchgateReleaseVersion=2.8.0 testngVersion=7.6.1 ballerinaGradlePluginVersion=2.0.1 -ballerinaLangVersion=2201.11.0-20241008-112400-81975006 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 # Direct Dependencies # Level 01 -stdlibIoVersion=1.6.2-20240928-084100-656404f -stdlibTimeVersion=2.5.1-20240930-120200-e59222b +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibTimeVersion=2.6.0-20241113-073800-201b904 # Level 02 -stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 -stdlibOsVersion=1.8.1-20241001-120600-dd1626e +stdlibLogVersion=2.10.1-20241113-120000-4577868 +stdlibOsVersion=1.8.1-20241113-122000-cca973b # Level 03 -stdlibFileVersion=1.10.1-20241007-160900-03f7b64 +stdlibFileVersion=1.10.1-20241113-151700-e1a2e38 # Ballerinax Observer -observeVersion=1.3.1-20241007-161000-645452d -observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 +observeVersion=1.4.0-20241113-092000-b83ae74 +observeInternalVersion=1.3.1-20241113-101700-265054d # Transitive Dependencies # Level 01 -stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 -stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 +stdlibUrlVersion=2.4.1-20241113-073900-335ff51 # Level 02 -stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab -stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 +stdlibCryptoVersion=2.7.3-20241113-081400-d015a39 +stdlibTaskVersion=2.5.1-20241113-123500-f905281 # Level 03 -stdlibCacheVersion=3.8.1-20241007-154900-63f4403 -stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 -stdlibUuidVersion=1.8.1-20241009-134600-a05012b +stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf +stdlibMimeVersion=2.10.2-20241113-154200-d953747 +stdlibUuidVersion=1.8.1-20241113-154400-443c67b # Level 04 -stdlibAuthVersion=2.12.0 -stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f -stdlibJwtVersion=2.13.0 -stdlibOAuth2Version=2.12.0 +stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739 +stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa +stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe # Level 05 -stdlibHttpVersion=2.13.0-20241106-120000-d375c3b +stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a # Level 06 -stdlibTransactionVersion=1.10.1-20241021-105400-f7e16a8 +stdlibTransactionVersion=1.10.1-20241116-112500-189a4e5 diff --git a/native/src/main/java/io/ballerina/stdlib/sql/datasource/PoolKey.java b/native/src/main/java/io/ballerina/stdlib/sql/datasource/PoolKey.java index fee758bd..8e9398c5 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/datasource/PoolKey.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/datasource/PoolKey.java @@ -17,8 +17,8 @@ */ package io.ballerina.stdlib.sql.datasource; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java index 9bc7baeb..ce0bd150 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java @@ -19,9 +19,9 @@ package io.ballerina.stdlib.sql.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.StructureType; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; @@ -60,11 +60,11 @@ import static io.ballerina.stdlib.sql.Constants.RESULT_SET_TOTAL_NATIVE_DATA_FIELD; import static io.ballerina.stdlib.sql.Constants.STATEMENT_NATIVE_DATA_FIELD; import static io.ballerina.stdlib.sql.Constants.TYPE_DESCRIPTIONS_NATIVE_DATA_FIELD; +import static io.ballerina.stdlib.sql.utils.Utils.closeResources; import static io.ballerina.stdlib.sql.utils.Utils.getColumnDefinitions; import static io.ballerina.stdlib.sql.utils.Utils.getDefaultStreamConstraint; import static io.ballerina.stdlib.sql.utils.Utils.getSqlQuery; import static io.ballerina.stdlib.sql.utils.Utils.updateProcedureCallExecutionResult; -import static io.ballerina.stdlib.sql.utils.Utils.closeResources; /** * This class holds the utility methods involved with executing the call statements. diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessor.java index b3564d90..c4e1f839 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessor.java @@ -18,9 +18,9 @@ package io.ballerina.stdlib.sql.nativeimpl; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BObject; import io.ballerina.runtime.api.values.BStream; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java index c2e2af0c..11e0fdad 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/QueryProcessor.java @@ -19,12 +19,12 @@ package io.ballerina.stdlib.sql.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.types.UnionType; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BError; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/AbstractStatementParameterProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/AbstractStatementParameterProcessor.java index e4332f22..e90175f9 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/AbstractStatementParameterProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/AbstractStatementParameterProcessor.java @@ -18,7 +18,7 @@ package io.ballerina.stdlib.sql.parameterprocessor; -import io.ballerina.runtime.api.TypeTags; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BDecimal; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessor.java index 0220dd30..0a1686f6 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessor.java @@ -17,15 +17,15 @@ */ package io.ballerina.stdlib.sql.parameterprocessor; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.Field; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.StructureType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.types.UnionType; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.utils.XmlUtils; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessor.java b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessor.java index 11dede7f..24184e5a 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessor.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessor.java @@ -18,12 +18,12 @@ package io.ballerina.stdlib.sql.parameterprocessor; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.Field; import io.ballerina.runtime.api.types.ObjectType; import io.ballerina.runtime.api.types.StructureType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java b/native/src/main/java/io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java index 69255e93..2d0f9963 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java @@ -18,9 +18,9 @@ package io.ballerina.stdlib.sql.utils; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.StructureType; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BObject; diff --git a/native/src/main/java/io/ballerina/stdlib/sql/utils/Utils.java b/native/src/main/java/io/ballerina/stdlib/sql/utils/Utils.java index 019ce43c..f54dcbc9 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/utils/Utils.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/utils/Utils.java @@ -19,17 +19,17 @@ package io.ballerina.stdlib.sql.utils; import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.flags.SymbolFlags; import io.ballerina.runtime.api.flags.TypeFlags; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.Field; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.StructureType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.types.UnionType; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; diff --git a/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java b/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java index b3d479e7..a8db8e85 100644 --- a/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java +++ b/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java @@ -19,11 +19,11 @@ package io.ballerina.stdlib.sql; import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.types.Field; import io.ballerina.runtime.api.types.IntersectionType; import io.ballerina.runtime.api.types.ObjectType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.Type; import io.ballerina.runtime.api.values.BArray; @@ -36,10 +36,10 @@ import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; import io.ballerina.runtime.api.values.BValue; -import io.ballerina.runtime.internal.IteratorUtils; import io.ballerina.runtime.internal.scheduling.Strand; import io.ballerina.runtime.internal.types.BField; import io.ballerina.runtime.internal.types.BRecordType; +import io.ballerina.runtime.internal.utils.IteratorUtils; import io.ballerina.runtime.internal.values.BmpStringValue; import io.ballerina.stdlib.sql.utils.PrimitiveTypeColumnDefinition; diff --git a/native/src/test/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessorTest.java b/native/src/test/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessorTest.java index fd82dba4..a70c1f13 100644 --- a/native/src/test/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessorTest.java +++ b/native/src/test/java/io/ballerina/stdlib/sql/nativeimpl/OutParameterProcessorTest.java @@ -18,7 +18,7 @@ package io.ballerina.stdlib.sql.nativeimpl; -import io.ballerina.runtime.api.PredefinedTypes; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BObject; import io.ballerina.runtime.api.values.BString; diff --git a/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessorTest.java b/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessorTest.java index b6b504d5..6fedcade 100644 --- a/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessorTest.java +++ b/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultResultParameterProcessorTest.java @@ -18,7 +18,7 @@ package io.ballerina.stdlib.sql.parameterprocessor; -import io.ballerina.runtime.api.PredefinedTypes; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessorTest.java b/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessorTest.java index ea74729a..d278fec4 100644 --- a/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessorTest.java +++ b/native/src/test/java/io/ballerina/stdlib/sql/parameterprocessor/DefaultStatementParameterProcessorTest.java @@ -17,7 +17,7 @@ */ package io.ballerina.stdlib.sql.parameterprocessor; -import io.ballerina.runtime.api.PredefinedTypes; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.values.BString; import io.ballerina.stdlib.sql.TestUtils; import io.ballerina.stdlib.sql.exception.ApplicationError; From 8552401278523788b338c44ed2f9c5014242dad7 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Tue, 19 Nov 2024 01:06:01 +0530 Subject: [PATCH 4/4] Use main branch for github actions --- .github/workflows/build-timestamped-master.yml | 2 +- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/fossa_scan.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- gradle.properties | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index f202d1aa..2d154ffc 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -14,5 +14,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 341a7a88..65d785ad 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index ebe213e7..11922b55 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/fossa_scan.yml b/.github/workflows/fossa_scan.yml index a2862efe..651f73a6 100644 --- a/.github/workflows/fossa_scan.yml +++ b/.github/workflows/fossa_scan.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: fossas/fossa-action@java21 + - uses: fossas/fossa-action@main env: packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 2478fd39..5e6adfe3 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main secrets: inherit with: package-name: sql diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f85a9816..c717ff55 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,7 +10,7 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit with: additional-windows-test-flags: "-x test" diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 41e8f6ad..c02c8ff4 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main secrets: inherit diff --git a/gradle.properties b/gradle.properties index 07db3715..94189aef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ researchgateReleaseVersion=2.8.0 testngVersion=7.6.1 ballerinaGradlePluginVersion=2.0.1 -ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 +ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77 # Direct Dependencies