Skip to content

Commit

Permalink
Merge pull request #2227 from ballerina-platform/callMethodImprovement
Browse files Browse the repository at this point in the history
Remove creating metadata if it is a extern function
  • Loading branch information
TharmiganK authored Nov 26, 2024
2 parents 9551ecd + 0cbbf06 commit ac9f445
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package io.ballerina.stdlib.http.api;

import io.ballerina.runtime.api.Runtime;
import io.ballerina.runtime.api.concurrent.StrandMetadata;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.flags.SymbolFlags;
Expand Down Expand Up @@ -494,8 +493,7 @@ public static void populateInterceptorServicesRegistries(List<HTTPInterceptorSer
if (includesInterceptableService) {
final Object[] createdInterceptors = new Object[1];
try {
Object response = runtime.callMethod(service.getBalService(), CREATE_INTERCEPTORS_FUNCTION_NAME,
new StrandMetadata(true, null));
Object response = runtime.callMethod(service.getBalService(), CREATE_INTERCEPTORS_FUNCTION_NAME, null);
if (response instanceof BError) {
log.error("Error occurred while creating interceptors", response);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.Module;
import io.ballerina.runtime.api.Runtime;
import io.ballerina.runtime.api.concurrent.StrandMetadata;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.Field;
Expand Down Expand Up @@ -1645,8 +1644,7 @@ public static void populateInterceptorServicesFromService(BObject serviceEndpoin
public static void populateInterceptorServicesFromListener(BObject serviceEndpoint, Runtime runtime) {
final BArray[] interceptorResponse = new BArray[1];
try {
Object result = runtime.callMethod(serviceEndpoint, CREATE_INTERCEPTORS_FUNCTION_NAME,
new StrandMetadata(false, null));
Object result = runtime.callMethod(serviceEndpoint, CREATE_INTERCEPTORS_FUNCTION_NAME, null);
if (result instanceof BArray) {
interceptorResponse[0] = (BArray) result;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.Runtime;
import io.ballerina.runtime.api.concurrent.StrandMetadata;
import io.ballerina.runtime.api.types.ObjectType;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BError;
import io.ballerina.runtime.api.values.BObject;
import io.ballerina.runtime.observability.ObserveUtils;
Expand Down Expand Up @@ -265,10 +262,7 @@ private static void startInterceptResponseMethod(HttpCarbonMessage inboundMessag
String methodName = service.getServiceType().equals(HttpConstants.RESPONSE_ERROR_INTERCEPTOR)
? HttpConstants.INTERCEPT_RESPONSE_ERROR : HttpConstants.INTERCEPT_RESPONSE;
try {
ObjectType serviceType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(serviceObj));
Object result = runtime.callMethod(serviceObj, methodName,
new StrandMetadata(serviceType.isIsolated() && serviceType.isIsolated(methodName), null),
signatureParams);
Object result = runtime.callMethod(serviceObj, methodName, null, signatureParams);
callback.handleResult(result);
} catch (BError bError) {
callback.handlePanic(bError);
Expand Down

0 comments on commit ac9f445

Please sign in to comment.