From 067b4780a7b67ebc0b4a0426b9ead3f6f34a8929 Mon Sep 17 00:00:00 2001 From: Anna Makarenko Date: Wed, 3 Jan 2024 19:32:59 +0300 Subject: [PATCH] review fixes --- ...nslateMainSystemIdtfsFromScToFileAgent.cpp | 28 +++++++++---------- .../cxx/identifiersModule/test/units/test.cpp | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/platform-dependent-components/problem-solver/cxx/identifiersModule/agent/TranslateMainSystemIdtfsFromScToFileAgent.cpp b/platform-dependent-components/problem-solver/cxx/identifiersModule/agent/TranslateMainSystemIdtfsFromScToFileAgent.cpp index c46717c8..981ecf36 100644 --- a/platform-dependent-components/problem-solver/cxx/identifiersModule/agent/TranslateMainSystemIdtfsFromScToFileAgent.cpp +++ b/platform-dependent-components/problem-solver/cxx/identifiersModule/agent/TranslateMainSystemIdtfsFromScToFileAgent.cpp @@ -35,25 +35,25 @@ SC_AGENT_IMPLEMENTATION(TranslateMainSystemIdtfsFromScToFileAgent) ScAddr edgeBelongsToNrelSystemIdtf; ScAddr sourceOfEdgeBelongsToNrelSystemIdtf; - std::string systemIdtf; - std::string mainIdtf; - std::string strType; + std::string systemIdentifier; + std::string mainIdentifier; + std::string stringType; while (iterator3PtrEdgeBelongsToNrelSystemIdtf->Next()) { edgeBelongsToNrelSystemIdtf = iterator3PtrEdgeBelongsToNrelSystemIdtf->Get(2); sourceOfEdgeBelongsToNrelSystemIdtf = ms_context->GetEdgeSource(edgeBelongsToNrelSystemIdtf); try { - systemIdtf = getSystemIdtfAndVerifyNode(sourceOfEdgeBelongsToNrelSystemIdtf); - mainIdtf = getMainIdtfAndVerifyNode(sourceOfEdgeBelongsToNrelSystemIdtf); - strType = getStrScType(sourceOfEdgeBelongsToNrelSystemIdtf); - - if (!systemIdtf.empty() && !mainIdtf.empty() && !strType.empty()) { - streamIdtfs << "{\"" << mainIdtf << "\", " - << "{\"" << systemIdtf << "\", \"" - << strType << "\"} },\n"; + systemIdentifier = getSystemIdtfAndVerifyNode(sourceOfEdgeBelongsToNrelSystemIdtf); + mainIdentifier = getMainIdtfAndVerifyNode(sourceOfEdgeBelongsToNrelSystemIdtf); + stringType = getStrScType(sourceOfEdgeBelongsToNrelSystemIdtf); + + if (!systemIdentifier.empty() && !mainIdentifier.empty() && !stringType.empty()) { + streamIdtfs << "{\"" << mainIdentifier << "\", " + << "{\"" << systemIdentifier << "\", \"" + << stringType << "\"} },\n"; } } - catch (utils::ScException &exception) { + catch (utils::ScException const & exception) { SC_LOG_ERROR(exception.Description()); utils::AgentUtils::finishAgentWork(&m_memoryCtx, actionAddr, false); return SC_RESULT_ERROR; @@ -164,8 +164,8 @@ bool TranslateMainSystemIdtfsFromScToFileAgent::writeInFile(std::string const & } file.close(); } - catch (std::exception const & err) { - SC_LOG_ERROR(err.what()); + catch (std::exception const & exception) { + SC_LOG_ERROR(exception.what()); return false; } return true; diff --git a/platform-dependent-components/problem-solver/cxx/identifiersModule/test/units/test.cpp b/platform-dependent-components/problem-solver/cxx/identifiersModule/test/units/test.cpp index 9e9abb43..b383324d 100644 --- a/platform-dependent-components/problem-solver/cxx/identifiersModule/test/units/test.cpp +++ b/platform-dependent-components/problem-solver/cxx/identifiersModule/test/units/test.cpp @@ -43,7 +43,7 @@ namespace ModuleTest SC_THROW_EXCEPTION(utils::ScException, "Cant find file with identifiers"); } } - catch (utils::ScException & exception) + catch (utils::ScException const & exception) { SC_LOG_ERROR(exception.Description()); }