Skip to content

Commit

Permalink
Merge pull request #1003 from warunalakshitha/java21
Browse files Browse the repository at this point in the history
Migrate to latest Java 21 changes
  • Loading branch information
warunalakshitha authored Nov 17, 2024
2 parents f3d8003 + 1199f90 commit adfe701
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 77 deletions.
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ version = "@constraint.version@"
path = "./lib/constraint-native-@constraint.native.version@.jar"

[build-options]
observabilityIncluded=true
observabilityIncluded=false
2 changes: 1 addition & 1 deletion 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=3.2.0-SNAPSHOT
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87
ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77

amqpClientVersion=5.18.0
puppycrawlCheckstyleVersion=10.12.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Semaphore;

import static io.ballerina.runtime.api.constants.RuntimeConstants.ORG_NAME_SEPARATOR;
import static io.ballerina.runtime.api.constants.RuntimeConstants.VERSION_SEPARATOR;
import static io.ballerina.runtime.api.types.TypeTags.INTERSECTION_TAG;
import static io.ballerina.runtime.api.types.TypeTags.OBJECT_TYPE_TAG;
import static io.ballerina.runtime.api.types.TypeTags.RECORD_TYPE_TAG;
import static io.ballerina.runtime.api.constants.RuntimeConstants.ORG_NAME_SEPARATOR;
import static io.ballerina.runtime.api.constants.RuntimeConstants.VERSION_SEPARATOR;
import static io.ballerina.runtime.api.utils.TypeUtils.getReferredType;
import static io.ballerina.stdlib.rabbitmq.RabbitMQConstants.CONSTRAINT_VALIDATION;
import static io.ballerina.stdlib.rabbitmq.RabbitMQConstants.FUNC_ON_ERROR;
Expand Down Expand Up @@ -285,25 +284,14 @@ private boolean isMessageType(Parameter parameter, BMap<BString, Object> annotat

private boolean invokeIsAnydataMessageTypeMethod(Type paramType) {
BObject client = ValueCreator.createObjectValue(ModuleUtils.getModule(), TYPE_CHECKER_OBJECT_NAME);
Semaphore sem = new Semaphore(0);
RabbitMQTypeCheckCallback messageTypeCheckCallback = new RabbitMQTypeCheckCallback(sem);
StrandMetadata strandMetadata = new StrandMetadata(true, getProperties(IS_ANYDATA_MESSAGE));
Thread.startVirtualThread(() -> {
try {
Object result = runtime.callMethod(client, IS_ANYDATA_MESSAGE, strandMetadata,
ValueCreator.createTypedescValue(paramType));
messageTypeCheckCallback.notifySuccess(result);
} catch (BError bError) {
messageTypeCheckCallback.notifyFailure(bError);
throw bError;
}
});
try {
sem.acquire();
} catch (InterruptedException e) {
throw returnErrorValue(e.getMessage());
return (boolean) runtime.callMethod(client, IS_ANYDATA_MESSAGE, strandMetadata,
ValueCreator.createTypedescValue(paramType));
} catch (BError bError) {
bError.printStackTrace();
throw bError;
}
return messageTypeCheckCallback.getIsMessageType();
}

private Map<String, Object> getNewObserverContextInProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ public void notifyFailure(BError error) {
// Service level `panic` is captured in this method.
// Since, `panic` is due to a critical application bug or resource exhaustion we need to exit the application.
// Please refer: https://github.com/ballerina-platform/ballerina-standard-library/issues/2714
// System.exit(1);
System.exit(1);
}
}

This file was deleted.

0 comments on commit adfe701

Please sign in to comment.