Skip to content

Commit

Permalink
Small refactor to dafny java wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjeline committed Aug 14, 2023
1 parent af50183 commit d75e1ba
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public String isAuthorized_str(String json) {
}

public String eval_str(String json) {
var query = deserializeEvalQuery(json);
return query.map(x -> eval_json(x)).orElse("null");
return deserializeEvalQuery(json).map(x -> eval_json(x)).orElse("null");
}

private Optional<difftest_mhelpers.Json> deserializeEvalQuery(String json) {
Expand All @@ -66,7 +65,7 @@ private Optional<difftest_mhelpers.Json> deserializeEvalQuery(String json) {

public String eval_json(difftest_mhelpers.Json json) {
try {
var result = difftest_mmain.__default.evalJson(json);
difftest_mhelpers.Json result = difftest_mmain.__default.evalJson(json);
JsonNode serialized = DafnyUtils.convertJsonDafnyToJackson(result);
return mapper.writeValueAsString(serialized);
} catch (JsonProcessingException e) {
Expand Down

0 comments on commit d75e1ba

Please sign in to comment.