Skip to content

Commit

Permalink
fix(diagnostic_graph_aggregator): fix shadowFunction (autowarefoundat…
Browse files Browse the repository at this point in the history
…ion#7838)

* fix(diagnostic_graph_aggregator): fix shadowFunction

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* feat: modify variable name

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Co-authored-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: palas21 <palas21@itu.edu.tr>
  • Loading branch information
2 people authored and palas21 committed Jul 12, 2024
1 parent 6c6fe99 commit 5299660
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ FileLoader::FileLoader(const PathConfig * path)
}

TreeData tree = TreeData::Load(path->resolved);
const auto paths = tree.optional("files").children("files");
const auto files = tree.optional("files").children("files");
const auto edits = tree.optional("edits").children("edits");
const auto units = tree.optional("units").children("units");
for (const auto & data : paths) create_path_config(data);
for (const auto & data : files) create_path_config(data);
for (const auto & data : edits) create_edit_config(data);
for (const auto & data : units) create_unit_config(data);
}
Expand Down
12 changes: 6 additions & 6 deletions system/diagnostic_graph_aggregator/src/common/graph/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ TreeData::TreeData(const YAML::Node & yaml, const TreePath & path) : path_(path)
TreeData::Item TreeData::required(const std::string & name)
{
// TODO(Takagi, Isamu): check map type.
const auto path = path_.field(name);
const auto tree_path = path_.field(name);
if (!yaml_[name]) {
throw FieldNotFound(path);
throw FieldNotFound(tree_path);
}
const auto data = yaml_[name];
yaml_.remove(name);
return TreeData(data, path);
return TreeData(data, tree_path);
}

TreeData::Item TreeData::optional(const std::string & name)
{
// TODO(Takagi, Isamu): check map type.
const auto path = path_.field(name);
const auto tree_path = path_.field(name);
if (!yaml_[name]) {
return TreeData(YAML::Node(YAML::NodeType::Undefined), path);
return TreeData(YAML::Node(YAML::NodeType::Undefined), tree_path);
}
const auto data = yaml_[name];
yaml_.remove(name);
return TreeData(data, path);
return TreeData(data, tree_path);
}

bool TreeData::is_valid() const
Expand Down
8 changes: 4 additions & 4 deletions system/diagnostic_graph_aggregator/src/common/graph/units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ void NodeUnit::initialize_status()

LeafUnit::LeafUnit(const UnitLoader & unit) : BaseUnit(unit)
{
const auto node = unit.data().required("node").text();
const auto name = unit.data().required("name").text();
const auto sep = node.empty() ? "" : ": ";
const auto diag_node = unit.data().required("node").text();
const auto diag_name = unit.data().required("name").text();
const auto sep = diag_node.empty() ? "" : ": ";

struct_.path = unit.path();
struct_.name = node + sep + name;
struct_.name = diag_node + sep + diag_name;
status_.level = DiagnosticStatus::STALE;
}

Expand Down

0 comments on commit 5299660

Please sign in to comment.