From f6bd1da560bb40b2ee8b58ec1ed3421b0d7f83d9 Mon Sep 17 00:00:00 2001 From: anuruddhal Date: Tue, 26 Sep 2023 12:53:33 +0530 Subject: [PATCH] Fix parsing inline listeners --- cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java b/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java index 9ed7404c..a84bcb5a 100644 --- a/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java +++ b/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java @@ -344,6 +344,9 @@ private List extractListeners(ServiceDeclarationNode serviceDeclar } listenerInfo = httpsListener.get(); } else { + if (expressionNode.kind() != SyntaxKind.EXPLICIT_NEW_EXPRESSION) { + return Collections.emptyList(); + } //Inline Listener ExplicitNewExpressionNode refNode = (ExplicitNewExpressionNode) expressionNode; FunctionArgumentNode functionArgumentNode = refNode.parenthesizedArgList().arguments().get(0);