Skip to content

Commit

Permalink
bugfix:catch范围错误,导致锁未释放
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofeng committed Oct 28, 2021
1 parent 265499a commit d3a0217
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ private void undo() {
if(undoPosition == 0)
LOGGER.error("不能再进行undoPosition操作");
else{
undoPosition --;
redoPosition --;
broadcastRoomMessage(CaseMessageType.EDITOR, undoDiffs.get(undoPosition));
try {
undoPosition --;
redoPosition --;
broadcastRoomMessage(CaseMessageType.EDITOR, undoDiffs.get(undoPosition));
JsonNode target = JsonPatch.apply(jsonMapper.readTree(undoDiffs.get(undoPosition)), jsonMapper.readTree(testCaseContent));
testCaseContent = target.toString();
} catch (Exception e) {
Expand All @@ -217,8 +217,8 @@ private void redo() {
if(redoPosition == undoDiffs.size())
LOGGER.error("不能再进行redoPosition操作");
else{
broadcastRoomMessage(CaseMessageType.EDITOR, redoDiffs.get(redoPosition));
try {
broadcastRoomMessage(CaseMessageType.EDITOR, redoDiffs.get(redoPosition));
JsonNode target = JsonPatch.apply(jsonMapper.readTree(redoDiffs.get(undoPosition)), jsonMapper.readTree(testCaseContent));
testCaseContent = target.toString();
} catch (Exception e) {
Expand Down

0 comments on commit d3a0217

Please sign in to comment.