Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Java 21 #9

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bal run

### Setting up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources:
1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:

* [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)
Expand Down
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
distribution = "2201.9.2"
distribution = "2201.11.0-20241117-133400-a3054b77"
org = "ballerinax"
name = "aws.marketplace.mpe"
version = "0.1.0"
Expand All @@ -9,10 +9,10 @@ keywords = ["AWS", "Marketplace", "Cloud/Subscriptions", "Entitlement Management
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-aws.marketplace.mpe"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
artifactId = "aws.marketplace.mpe-native"
version = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.9.2"
distribution-version = "2201.11.0-20241117-133400-a3054b77"

[[package]]
org = "ballerina"
Expand Down
6 changes: 3 additions & 3 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
distribution = "2201.9.2"
distribution = "2201.11.0-20241117-133400-a3054b77"
org = "ballerinax"
name = "aws.marketplace.mpe"
version = "@toml.version@"
Expand All @@ -9,10 +9,10 @@ keywords = ["AWS", "Marketplace", "Cloud/Subscriptions", "Entitlement Management
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-aws.marketplace.mpe"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
artifactId = "aws.marketplace.mpe-native"
version = "@project.version@"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ group=io.ballerina.lib
version=0.1.1-SNAPSHOT

checkstylePluginVersion=10.12.0
spotbugsPluginVersion=5.0.14
spotbugsPluginVersion=6.0.18
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
testngVersion=7.6.1
eclipseLsp4jVersion=0.12.0
ballerinaGradlePluginVersion=2.2.4
ballerinaLangVersion=2201.9.2
ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77

stdlibTimeVersion=2.4.0
stdlibTimeVersion=2.6.0-20241113-073800-201b904
awsMpEntitlementSdkVersion=2.27.6
7 changes: 5 additions & 2 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ test {
}

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")
def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml")
if (excludeFile.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package io.ballerina.lib.aws.mpe;

import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.Future;
import io.ballerina.runtime.api.values.BError;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
Expand Down Expand Up @@ -93,20 +92,18 @@ public static Object getEntitlements(Environment env, BObject bAwsMpeClient, BMa
MarketplaceEntitlementClient nativeClient = (MarketplaceEntitlementClient) bAwsMpeClient
.getNativeData(NATIVE_CLIENT);
GetEntitlementsRequest entitlementsRequest = CommonUtils.getNativeRequest(request);
Future future = env.markAsync();
EXECUTOR_SERVICE.execute(() -> {
return env.yieldAndRun(() -> {
try {
GetEntitlementsResponse entitlementsResponse = nativeClient.getEntitlements(entitlementsRequest);
BMap<BString, Object> bResponse = CommonUtils.getBallerinaResponse(entitlementsResponse);
future.complete(bResponse);
return bResponse;
} catch (Exception e) {
String errorMsg = String.format("Error occurred while retrieving entitlements for the product: %s",
e.getMessage());
BError bError = CommonUtils.createError(errorMsg, e);
future.complete(bError);
return bError;
}
});
return null;
}

/**
Expand Down
Loading