From 7057f313edab9f56bde38c1e38b04c48713d6ed8 Mon Sep 17 00:00:00 2001 From: vil02 Date: Tue, 17 Oct 2023 20:01:51 +0200 Subject: [PATCH 1/2] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 10 +++++----- ballerina/Dependencies.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index de50be05..c048ea36 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" authors = ["Ballerina"] keywords = ["environment"] repository = "https://github.com/ballerina-platform/module-ballerina-os" @@ -15,8 +15,8 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "os-native" -version = "1.8.0" -path = "../native/build/libs/os-native-1.8.0.jar" +version = "1.8.1" +path = "../native/build/libs/os-native-1.8.1-SNAPSHOT.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" @@ -27,5 +27,5 @@ path = "./lib/io-native-1.6.0.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "os-test-utils" -version = "1.8.0" -path = "../test-utils/build/libs/os-test-utils-1.8.0.jar" +version = "1.8.1" +path = "../test-utils/build/libs/os-test-utils-1.8.1-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 8fc6f7d9..3d14e3be 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -47,7 +47,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, From 86ac1d6db9173d703b205483ff341d491c78f1e8 Mon Sep 17 00:00:00 2001 From: vil02 Date: Tue, 17 Oct 2023 20:03:48 +0200 Subject: [PATCH 2/2] 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 #5051. --- changelog.md | 1 + .../src/main/java/io/ballerina/stdlib/os/utils/OSUtils.java | 4 +++- .../java/io/ballerina/stdlib/os/testutils/OSTestUtils.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 4556b3a2..40476d5d 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ This file contains all the notable changes done to the Ballerina OS package thro ### Changed - [API docs updated](https://github.com/ballerina-platform/ballerina-standard-library/issues/3463) +- [Make some of the Java classes proper utility classes](https://github.com/ballerina-platform/ballerina-standard-library/issues/5051) ## [1.4.0] - [2022-09-08] diff --git a/native/src/main/java/io/ballerina/stdlib/os/utils/OSUtils.java b/native/src/main/java/io/ballerina/stdlib/os/utils/OSUtils.java index d875ef53..198677be 100644 --- a/native/src/main/java/io/ballerina/stdlib/os/utils/OSUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/os/utils/OSUtils.java @@ -38,7 +38,9 @@ /** * @since 0.8.0 */ -public class OSUtils { +public final class OSUtils { + + private OSUtils() {} public static BObject getProcessObject(Process process) throws IOException { BObject obj = ValueCreator.createObjectValue(getModule(), PROCESS_TYPE); diff --git a/test-utils/src/main/java/io/ballerina/stdlib/os/testutils/OSTestUtils.java b/test-utils/src/main/java/io/ballerina/stdlib/os/testutils/OSTestUtils.java index b285239d..8c83c18e 100644 --- a/test-utils/src/main/java/io/ballerina/stdlib/os/testutils/OSTestUtils.java +++ b/test-utils/src/main/java/io/ballerina/stdlib/os/testutils/OSTestUtils.java @@ -24,7 +24,9 @@ /** * @since 0.6.5 */ -public class OSTestUtils { +public final class OSTestUtils { + + private OSTestUtils() {} public static BString testValidEnv() { return StringUtils.fromString(System.getenv("JAVA_HOME"));