Fixing second bug (C++ skeleton cannot connect to Java's callback socket server)...
[iot2.git] / iotjava / iotpolicy / IoTCompiler.java
index d056fe473e4c13377445fb38b21389c1e65fc5dd..04bf089ff98dd06529ff480ecd66dd5ca1734b53 100644 (file)
@@ -3138,7 +3138,7 @@ public class IoTCompiler {
                        int newObjectId = getNewIntfaceObjectId(newIntface);
                        println("if (set" + newObjectId + "Allowed.find(methodId) == set" + newObjectId + "Allowed.end()) {");
                        println("cerr << \"Callback object for " + intface + " is not allowed to access method: \" << methodId;");
-                       println("exit(-1);");
+                       println("return;");
                        println("}");
                }
        }
@@ -3164,7 +3164,7 @@ public class IoTCompiler {
                println(" else {");
                println("cerr << \"Illegal object Id: \" << to_string(objId);");
                // TODO: perhaps need to change this into "throw" to make it cleaner (allow stack unfolding)
-               println("exit(-1);");
+               println("return;");
                println("}");
                println("}");
                println("}\n");
@@ -4149,12 +4149,12 @@ public class IoTCompiler {
                        println("if (_objectId == object" + newObjectId + "Id) {");
                        println("if (set" + newObjectId + "Allowed.find(methodId) == set" + newObjectId + "Allowed.end()) {");
                        println("cerr << \"Object with object Id: \" << _objectId << \"  is not allowed to access method: \" << methodId << endl;");
-                       println("exit(-1);");
+                       println("return;");
                        println("}");
                        println("}");
                        println("else {");
                        println("cerr << \"Object Id: \" << _objectId << \" not recognized!\" << endl;");
-                       println("exit(-1);");
+                       println("return;");
                        println("}");
                }
        }