Add the new "type" field to internal data model of Java Cloud Debugge… · pdeva/cloud-debug-java@89cbfcd · GitHub
Skip to content

Commit 89cbfcd

Browse files
committed
Add the new "type" field to internal data model of Java Cloud Debugger. The type is neither populated nor sent to the backend at this point.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=108622446
1 parent c4daa10 commit 89cbfcd

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/agent/model.h

Lines changed: 1 addition & 0 deletions

src/agent/model_json.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ static void SerializeModel(
401401
(*root)["value"] = Json::Value(model.value.value());
402402
}
403403

404+
if (!model.type.empty()) {
405+
(*root)["type"] = Json::Value(model.type);
406+
}
407+
404408
if (model.var_table_index.has_value()) {
405409
(*root)["varTableIndex"] =
406410
Json::Value(static_cast<int>(model.var_table_index.value()));
@@ -429,6 +433,13 @@ std::unique_ptr<VariableModel> DeserializeModel<VariableModel>(
429433
model->value.clear();
430434
}
431435

436+
// Type.
437+
if (root.isMember("type")) {
438+
model->type = JsonCppGetString(root, "type");
439+
} else {
440+
model->type.clear();
441+
}
442+
432443
// Reference to object in "variable_table".
433444
if (root.isMember("varTableIndex")) {
434445
model->var_table_index = JsonCppGetInt(root, "varTableIndex", -1);

src/agent/model_util.h

Lines changed: 11 additions & 0 deletions

0 commit comments

Comments
 (0)