From 0b6ed1048e67128d53cc2bb3daea9ab9804b74d6 Mon Sep 17 00:00:00 2001 From: vil02 Date: Fri, 13 Oct 2023 16:48:03 +0200 Subject: [PATCH 1/4] [Automated] Update native jar versions in toml files --- ballerina/Ballerina.toml | 8 ++++---- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index f823c2c6..ce6d5ff9 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "sql" -version = "1.11.0" +version = "1.11.1" authors = ["Ballerina"] keywords = ["database", "client", "network", "SQL", "RDBMS"] repository = "https://github.com/ballerina-platform/module-ballerina-sql" @@ -15,11 +15,11 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "sql-native" -version = "1.11.0" -path = "../native/build/libs/sql-native-1.11.0.jar" +version = "1.11.1" +path = "../native/build/libs/sql-native-1.11.1-SNAPSHOT.jar" [[platform.java17.dependency]] -path = "../test-utils/build/libs/sql-test-utils-1.11.0.jar" +path = "../test-utils/build/libs/sql-test-utils-1.11.1-SNAPSHOT.jar" scope = "testOnly" [[platform.java17.dependency]] diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 2dfd28cb..3f494b01 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "sql-compiler-plugin" class = "io.ballerina.stdlib.sql.compiler.SQLCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.11.0.jar" +path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.11.1-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index d47a2a70..3abbb77e 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.0" +version = "2.10.2" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -300,7 +300,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.11.0" +version = "1.11.1" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, From 70b65bcafba02a06ec1aa959042c53a130fbdba2 Mon Sep 17 00:00:00 2001 From: vil02 Date: Fri, 13 Oct 2023 16:58:22 +0200 Subject: [PATCH 2/4] Make some Java classes proper utilities Made the design cleaner by marking Java classes as `final` and explicitly declaring their default constructors as `private`. This change makes the code coverage reports more accurate. Closes #4921. --- changelog.md | 1 + .../ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java | 4 ++-- .../io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java | 4 ++-- native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java | 4 +++- .../io/ballerina/stdlib/sql/testutils/nativeimpl/Exec.java | 4 +++- .../ballerina/stdlib/sql/testutils/nativeimpl/ExitCode.java | 4 +++- .../stdlib/sql/testutils/nativeimpl/WaitForExit.java | 4 +++- .../java/io/ballerina/stdlib/sql/testutils/utils/OSUtils.java | 4 +++- 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index 58c29783..32eee4e9 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - [Support retrieval of enum types](https://github.com/ballerina-platform/ballerina-standard-library/issues/4588) +- [Make some of the Java classes proper utility classes](https://github.com/ballerina-platform/ballerina-standard-library/issues/4921) ## [1.9.0] - 2023-06-01 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 6d4b6012..315ef510 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 @@ -51,8 +51,8 @@ /** * This class provides functionality for the `ProcedureCallResult` to iterate through the sql result sets. */ -public class ProcedureCallResultUtils { - public ProcedureCallResultUtils() { +public final class ProcedureCallResultUtils { + private ProcedureCallResultUtils() { } public static Object getNextQueryResult(BObject procedureCallResult) { diff --git a/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java b/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java index dc427664..1942b70b 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java @@ -36,8 +36,8 @@ * * @since 1.2.0 */ -public class RecordIteratorUtils { - public RecordIteratorUtils() { +public final class RecordIteratorUtils { + private RecordIteratorUtils() { } public static Object nextResult(BObject recordIterator) { 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 1eedca47..34735d6c 100644 --- a/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java +++ b/native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java @@ -73,7 +73,9 @@ /** * TestUtils class for testing ballerina native classes/methods. */ -public class TestUtils { +public final class TestUtils { + + private TestUtils() {} /** * ExtendedColumnDefinition Class for test utils. diff --git a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/Exec.java b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/Exec.java index 56d97902..b08a79d3 100644 --- a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/Exec.java +++ b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/Exec.java @@ -36,7 +36,9 @@ * * @since 0.6.0 */ -public class Exec { +public final class Exec { + + private Exec() {} public static Object exec(BString command, BMap env, Object dir, BString[] args) { List commandList = new ArrayList<>(); diff --git a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/ExitCode.java b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/ExitCode.java index 689a9594..350aebee 100644 --- a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/ExitCode.java +++ b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/ExitCode.java @@ -27,7 +27,9 @@ * * @since 0.6.0 */ -public class ExitCode { +public final class ExitCode { + + private ExitCode() {} public static Object exitCode(BObject objVal) { Process process = OSUtils.processFromObject(objVal); diff --git a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/WaitForExit.java b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/WaitForExit.java index 3329c99a..7c9c8fb1 100644 --- a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/WaitForExit.java +++ b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/nativeimpl/WaitForExit.java @@ -27,7 +27,9 @@ * * @since 0.6.0 */ -public class WaitForExit { +public final class WaitForExit { + + private WaitForExit() {} public static Object waitForExit(BObject objVal) { Process process = OSUtils.processFromObject(objVal); diff --git a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/utils/OSUtils.java b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/utils/OSUtils.java index aea008f9..4df69838 100644 --- a/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/utils/OSUtils.java +++ b/test-utils/src/main/java/io/ballerina/stdlib/sql/testutils/utils/OSUtils.java @@ -30,7 +30,9 @@ /** * @since 0.6.0 */ -public class OSUtils { +public final class OSUtils { + + private OSUtils() {} private static final BString UNKNOWN_MESSAGE = StringUtils.fromString("Unknown Error"); From adf72438dcb660fe0b61985292203818048166c3 Mon Sep 17 00:00:00 2001 From: Danesh Kuruppu Date: Thu, 22 Feb 2024 21:51:55 +0530 Subject: [PATCH 3/4] Update native/src/main/java/io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java --- .../io/ballerina/stdlib/sql/utils/ProcedureCallResultUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 315ef510..4dee81b2 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 @@ -51,7 +51,7 @@ /** * This class provides functionality for the `ProcedureCallResult` to iterate through the sql result sets. */ -public final class ProcedureCallResultUtils { +public class ProcedureCallResultUtils { private ProcedureCallResultUtils() { } From 763c92f35f9a1b623d42ff864a95181bad250e04 Mon Sep 17 00:00:00 2001 From: Danesh Kuruppu Date: Thu, 22 Feb 2024 21:52:08 +0530 Subject: [PATCH 4/4] Update native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java --- .../java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java b/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java index 1942b70b..b4aaabfa 100644 --- a/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/sql/utils/RecordIteratorUtils.java @@ -36,7 +36,7 @@ * * @since 1.2.0 */ -public final class RecordIteratorUtils { +public class RecordIteratorUtils { private RecordIteratorUtils() { }