From a9b44eebd0de29d3124379debb976f435df2f84c Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Wed, 13 Nov 2024 11:50:16 +0530 Subject: [PATCH] Migrate to new Runtime APIs --- ballerina/Ballerina.toml | 14 +++++++------- ballerina/Dependencies.toml | 10 +++++----- gradle.properties | 8 ++++---- .../yaml/io/BallerinaByteBlockInputStream.java | 4 ++-- .../io/ballerina/lib/data/yaml/parser/Values.java | 4 ++-- .../ballerina/lib/data/yaml/parser/YamlParser.java | 4 ++-- .../lib/data/yaml/serializer/Serializer.java | 2 +- .../lib/data/yaml/utils/JsonTraverse.java | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 46fb4f9..ff17129 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "data.yaml" -version = "0.1.0" +version = "0.1.1" authors = ["Ballerina"] keywords = ["yaml"] repository = "https://github.com/ballerina-platform/module-ballerina-data.yaml" @@ -11,15 +11,15 @@ distribution = "2201.10.0" [platform.java17] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.lib" artifactId = "yaml-native" -version = "0.1.0" -path = "../native/build/libs/data.yaml-native-0.1.0.jar" +version = "0.1.1" +path = "../native/build/libs/data.yaml-native-0.1.1-SNAPSHOT.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "constraint-native" -version = "1.5.0" -path = "./lib/constraint-native-1.5.0.jar" +version = "1.6.0" +path = "./lib/constraint-native-1.6.0-20241113-090900-d276ad5.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index cd9d8f1..ef4eb5a 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.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -22,7 +22,7 @@ modules = [ [[package]] org = "ballerina" name = "data.yaml" -version = "0.1.0" +version = "0.1.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "io"}, @@ -37,7 +37,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.6.2" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -116,7 +116,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} diff --git a/gradle.properties b/gradle.properties index f81e3d3..6d253a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.lib version=0.1.1-SNAPSHOT -ballerinaLangVersion=2201.10.0-20241002-115300-57eee14c +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 checkstyleToolVersion=10.12.0 puppycrawlCheckstyleVersion=10.12.0 @@ -17,6 +17,6 @@ downloadPluginVersion=4.0.4 releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 -stdlibIoVersion=1.6.2-20240928-084100-656404f -stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 -stdlibTimeVersion=2.5.1-20241003-232800-e59222b +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 +stdlibTimeVersion=2.6.0-20241113-073800-201b904 diff --git a/native/src/main/java/io/ballerina/lib/data/yaml/io/BallerinaByteBlockInputStream.java b/native/src/main/java/io/ballerina/lib/data/yaml/io/BallerinaByteBlockInputStream.java index 88327be..52cbb06 100644 --- a/native/src/main/java/io/ballerina/lib/data/yaml/io/BallerinaByteBlockInputStream.java +++ b/native/src/main/java/io/ballerina/lib/data/yaml/io/BallerinaByteBlockInputStream.java @@ -76,7 +76,7 @@ public int read() { public void close() throws IOException { super.close(); if (closeMethod != null) { - env.getRuntime().call(iterator, closeMethod.getName()); + env.getRuntime().callMethod(iterator, closeMethod.getName(), null); } } @@ -86,7 +86,7 @@ private boolean hasBytesInCurrentChunk() { private boolean readNextChunk() throws InterruptedException { try { - Object result = env.getRuntime().call(iterator, nextMethodName); + Object result = env.getRuntime().callMethod(iterator, nextMethodName, null); if (result == null) { this.done = true; return true; diff --git a/native/src/main/java/io/ballerina/lib/data/yaml/parser/Values.java b/native/src/main/java/io/ballerina/lib/data/yaml/parser/Values.java index 811fb5b..3b9b6e6 100644 --- a/native/src/main/java/io/ballerina/lib/data/yaml/parser/Values.java +++ b/native/src/main/java/io/ballerina/lib/data/yaml/parser/Values.java @@ -22,8 +22,6 @@ import io.ballerina.lib.data.yaml.utils.DiagnosticErrorCode; import io.ballerina.lib.data.yaml.utils.DiagnosticLog; import io.ballerina.lib.data.yaml.utils.TagResolutionUtils; -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; @@ -32,10 +30,12 @@ import io.ballerina.runtime.api.types.FiniteType; import io.ballerina.runtime.api.types.IntersectionType; import io.ballerina.runtime.api.types.MapType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.ReferenceType; import io.ballerina.runtime.api.types.TupleType; 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.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; diff --git a/native/src/main/java/io/ballerina/lib/data/yaml/parser/YamlParser.java b/native/src/main/java/io/ballerina/lib/data/yaml/parser/YamlParser.java index a49bd4f..b2c877b 100644 --- a/native/src/main/java/io/ballerina/lib/data/yaml/parser/YamlParser.java +++ b/native/src/main/java/io/ballerina/lib/data/yaml/parser/YamlParser.java @@ -33,8 +33,6 @@ import io.ballerina.lib.data.yaml.utils.JsonTraverse; import io.ballerina.lib.data.yaml.utils.OptionsUtils; import io.ballerina.lib.data.yaml.utils.TagResolutionUtils; -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; @@ -42,9 +40,11 @@ import io.ballerina.runtime.api.types.Field; import io.ballerina.runtime.api.types.IntersectionType; import io.ballerina.runtime.api.types.MapType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.TupleType; 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.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; diff --git a/native/src/main/java/io/ballerina/lib/data/yaml/serializer/Serializer.java b/native/src/main/java/io/ballerina/lib/data/yaml/serializer/Serializer.java index 96b8e7d..736c7e1 100644 --- a/native/src/main/java/io/ballerina/lib/data/yaml/serializer/Serializer.java +++ b/native/src/main/java/io/ballerina/lib/data/yaml/serializer/Serializer.java @@ -20,7 +20,7 @@ import io.ballerina.lib.data.yaml.common.Types; import io.ballerina.lib.data.yaml.common.YamlEvent; -import io.ballerina.runtime.api.TypeTags; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; diff --git a/native/src/main/java/io/ballerina/lib/data/yaml/utils/JsonTraverse.java b/native/src/main/java/io/ballerina/lib/data/yaml/utils/JsonTraverse.java index b82a140..35e152a 100644 --- a/native/src/main/java/io/ballerina/lib/data/yaml/utils/JsonTraverse.java +++ b/native/src/main/java/io/ballerina/lib/data/yaml/utils/JsonTraverse.java @@ -21,17 +21,17 @@ import io.ballerina.lib.data.yaml.common.Types; import io.ballerina.lib.data.yaml.parser.ParserUtils; import io.ballerina.lib.data.yaml.parser.Values; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.flags.SymbolFlags; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.Field; import io.ballerina.runtime.api.types.IntersectionType; import io.ballerina.runtime.api.types.MapType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.TupleType; 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.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils;