From 1823e831da9d0124f68573a27c0bf52acbec0c8d Mon Sep 17 00:00:00 2001
From: Sophie Coudert <sophie.coudert@telecom-paris.fr>
Date: Fri, 26 Apr 2024 17:07:57 +0200
Subject: [PATCH] mini-bug

---
 src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java b/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
index 2005e9cdb4..4a6f68c4b2 100644
--- a/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
+++ b/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
@@ -338,8 +338,8 @@ public class Avatar2SysML {
 
                 // Message declaration .........................
 
-                StringBuffer msg1Buf = new StringBuffer(indent + "// Message of signal " + blk1SysMLname + "." + sig1SYSMLname + "----------\n");
-                StringBuffer msg2Buf = new StringBuffer(indent + "// Message of signal " + blk2SysMLname  + sig2SYSMLname + "----------\n");
+                StringBuffer msg1Buf = new StringBuffer(indent + "\n// Message of signal " + blk1SysMLname + "." + sig1SYSMLname + "............\n");
+                StringBuffer msg2Buf = new StringBuffer(indent + "\n// Message of signal " + blk2SysMLname  + sig2SYSMLname + "............\n");
                 if (in2out) {
                     msg1Buf.append(indent + "part def " + message2SYSMLname + " :> '#DataMessage' {\n");
                     msg2Buf.append(indent + "part def " + message1SYSMLname + " :> " + message2SYSMLname + "{\n");
@@ -1101,8 +1101,9 @@ public class Avatar2SysML {
     String methodCall2SysML(AvatarTermFunction m) {
         MethodInfo methodInfo = methodMap.get(m.getMethod());
         List<AvatarTerm>  parameters = m.getArgs().getComponents();
-        StringBuffer result = new StringBuffer(methodInfo.getName() + "(");
         int nbFields = methodInfo.getArity();
+        if (nbFields == 0) return(methodInfo.getName() + "()");
+        StringBuffer result = new StringBuffer(methodInfo.getName() + "(");
         int j = 0; // index in method profile;
         int k = 0; // index in method parameters;
         while (j < nbFields) {
-- 
GitLab