Skip to content

Commit

Permalink
Merge pull request #545 from HindujaB/java21
Browse files Browse the repository at this point in the history
Migrate runtime APIs for Javav 21
  • Loading branch information
warunalakshitha authored Nov 13, 2024
2 parents 8b6c9f0 + bbda34b commit d953747
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 22 deletions.
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "mime"
version = "2.10.0"
version = "2.10.1"
authors = ["Ballerina"]
keywords = ["mime", "multipart", "entity"]
repository = "https://github.com/ballerina-platform/module-ballerina-mime"
Expand All @@ -15,11 +15,11 @@ graalvmCompatible = true
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "mime-native"
version = "2.10.0"
path = "../native/build/libs/mime-native-2.10.0.jar"
version = "2.10.1"
path = "../native/build/libs/mime-native-2.10.1.jar"

[[platform.java21.dependency]]
path = "../test-utils/build/libs/mime-test-utils-2.10.0.jar"
path = "../test-utils/build/libs/mime-test-utils-2.10.1.jar"
scope = "testOnly"

[[platform.java21.dependency]]
Expand Down
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.10.0"
version = "2.10.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This file contains all the notable changes done to the Ballerina MIME package th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [2.10.1] - 2024-10-15

## Changed
- [Fix packing snapshot dependencies](https://github.com/ballerina-platform/ballerina-library/issues/7266)

## [2.10.0] - 2024-08-20

### Added
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=2.10.1-SNAPSHOT
ballerinaLangVersion=2201.10.0-20241007-143200-6b69ca80
version=2.10.2-SNAPSHOT
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87

mimepullVersion=1.9.11
puppycrawlCheckstyleVersion=10.12.0
Expand All @@ -12,10 +12,10 @@ checkstyleToolVersion=10.12.0
githubSpotbugsVersion=6.0.18
jakartaActivationVersion=2.0.1
testngVersion=7.6.1
ballerinaGradlePluginVersion=2.2.3
ballerinaGradlePluginVersion=2.2.4
mockitoVersion=5.3.1

stdlibIoVersion=1.6.2-20240928-084100-656404f
stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4
observeVersion=1.3.1-20241007-161000-645452d
observeInternalVersion=1.3.1-20241007-182700-a5f77a1
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
stdlibLogVersion=2.10.1-20241113-120000-4577868
observeVersion=1.4.0-20241113-092000-b83ae74
observeInternalVersion=1.3.1-20241113-101700-265054d
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package io.ballerina.stdlib.mime.util;

import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.concurrent.StrandMetadata;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
Expand Down Expand Up @@ -378,7 +379,8 @@ public static void writeByteStreamToOutputStream(Environment env, BObject entity
private static void writeContent(Environment env, BObject entity, OutputStream outputStream,
BObject iteratorObj) {
try {
Object result = env.getRuntime().call(iteratorObj, BYTE_STREAM_NEXT_FUNC);
Object result = env.getRuntime().callMethod(iteratorObj, BYTE_STREAM_NEXT_FUNC,
new StrandMetadata(true, null));
handleContentResult(env, entity, outputStream, result, iteratorObj);
} catch (BError error) {
handleContentPanic(error);
Expand Down Expand Up @@ -431,7 +433,8 @@ public static void writeEventStreamToOutputStream(Environment env, BObject entit

private static void writeEvent(Environment env, BObject eventStreamWriter) {
try {
handleEventPanic(eventStreamWriter, env.getRuntime().call(eventStreamWriter, WRITE_EVENT_STREAM_METHOD));
handleEventPanic(eventStreamWriter, env.getRuntime().callMethod(eventStreamWriter,
WRITE_EVENT_STREAM_METHOD, new StrandMetadata(true, null)));
} catch (BError error) {
handleEventPanic(eventStreamWriter, error);
} catch (Throwable throwable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package io.ballerina.stdlib.mime.util;

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.MapType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package io.ballerina.stdlib.mime.util;

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.MapType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package io.ballerina.stdlib.mime.util;

import io.ballerina.runtime.api.Module;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ErrorCreator;
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.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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package io.ballerina.stdlib.mime.util;

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.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BLink;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package io.ballerina.stdlib.mime.util;

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.MapType;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

package io.ballerina.stdlib.mime.util;

import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.api.values.BStreamingJson;
Expand Down

0 comments on commit d953747

Please sign in to comment.