public void execute(Context ctx) { BMap<String, BValue> map = (BMap<String, BValue>) ctx.getRefArgument(0); try { map.clear(); ctx.setReturnValues(); } catch (BLangFreezeException e) { throw new BallerinaException(e.getMessage(), "Failed to clear map: " + e.getDetail()); } } }