Skip to content

Commit

Permalink
Merge pull request #9 from ravinperera00/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
warunalakshitha authored Jan 27, 2025
2 parents d53eab5 + 878dbaa commit a6ae2d8
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@2201.10.x
uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main
secrets: inherit
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
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[package]
distribution = "2201.9.2"
distribution = "2201.11.0-20241117-133400-a3054b77"
org = "ballerinax"
name = "aws.marketplace.mpe"
version = "0.1.1"
version = "0.2.0"
license= ["Apache-2.0"]
authors = ["Ballerina"]
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.1"
Expand Down
8 changes: 4 additions & 4 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

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

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
version = "1.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -29,7 +29,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -40,7 +40,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "aws.marketplace.mpe"
version = "0.1.1"
version = "0.2.0"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "jballerina.java"},
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
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
org.gradle.caching=true
group=io.ballerina.lib
version=0.1.2-SNAPSHOT
version=0.2.0-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

0 comments on commit a6ae2d8

Please sign in to comment.