diff --git a/AlgebraicDataflowArchitectureModel/src/algorithms/JerseyMethodBodyGenerator.java b/AlgebraicDataflowArchitectureModel/src/algorithms/JerseyMethodBodyGenerator.java index 8eddeb8..a88eea0 100644 --- a/AlgebraicDataflowArchitectureModel/src/algorithms/JerseyMethodBodyGenerator.java +++ b/AlgebraicDataflowArchitectureModel/src/algorithms/JerseyMethodBodyGenerator.java @@ -256,8 +256,9 @@ private static String getCodeForConversionFromMapToTuple(Type tupleType, String mapVar) { String decoded = "$x"; List elementsTypes = TypeInference.getTupleComponentTypes(tupleType); - String elementBase = mapVar + ".entrySet().iterator().next()"; + String elementBase = mapVar; for (Type elmType: elementsTypes.subList(0, elementsTypes.size() - 1)) { + elementBase += ".entrySet().iterator().next()"; if (elmType == DataConstraintModel.typeBoolean) { decoded = decoded.replace("$x", "new AbstractMap.SimpleEntry<>(Boolean.parseBoolean(" + elementBase + ".getKey()), $x)"); } else if (elmType == DataConstraintModel.typeInt) { @@ -273,7 +274,7 @@ } else { // To do. } - elementBase += ".getValue().entrySet().iterator().next()"; + elementBase += ".getValue()"; } decoded = decoded.replace("$x", elementBase); return decoded;