Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 71e3b0b

Browse files
committed
Fix: Unnecessary Analysis prevented big models from being saved as DFD and DD
1 parent 123b7a0 commit 71e3b0b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

bundles/org.dataflowanalysis.standalone/src/org/dataflowanalysis/standalone/websocket/WebSocketServerHandler.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ else if (message.startsWith("Json2DFD:")) {
9898
message = message.replaceFirst("Json2DFD:", "");
9999
var name = message.split(":")[0];
100100
message = message.replaceFirst(name + ":", "");
101-
var webEditorDfd = deserializeJsonAndAnnotate(message);
101+
var webEditorDfd = deserializeJson(message);
102102
return Converter.convertToDFDandStringify(webEditorDfd, name);
103103
}
104104
else if (message.startsWith("DFD:")) {
@@ -131,6 +131,20 @@ private WebEditorDfd deserializeJsonAndAnnotate(String json) throws IllegalArgum
131131
return Converter.analyzeAnnotate(webEditorDfd);
132132
}
133133

134+
private WebEditorDfd deserializeJson(String json) throws IllegalArgumentException {
135+
var objectMapper = new ObjectMapper();
136+
WebEditorDfd webEditorDfd;
137+
try {
138+
webEditorDfd = objectMapper.readValue(json, WebEditorDfd.class);
139+
} catch (Exception e) {
140+
e.printStackTrace();
141+
throw new IllegalArgumentException("Invalid Json Model");
142+
}
143+
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
144+
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
145+
return webEditorDfd;
146+
}
147+
134148
private WebEditorDfd safeLoadAndConvertDFDString(String message) {
135149
message = message.replaceFirst("DFD:", "");
136150
String name = message.split(":")[0];

0 commit comments

Comments
 (0)