0025057: Message_Algorithm fails to find messages defined for base class

New method HasMsg() is added in Message_MsgFile class to check if message with given key is registered.
That method is used in Message_Algorithm to check if message is defined on given level of class hierarchy.

Generation of error message in Message_MsgFile::Msg() is revised: now it includes a message key and gets added to the registry, to avoid re-generation in case of multiple requests.
Access to message registry maintained by the Message_MsgFile class is protected from concurrent access by mutex.
This commit is contained in:
abv
2014-07-08 16:11:16 +04:00
committed by bugmaster
parent cd7c40f5af
commit c67cd62ecf
3 changed files with 36 additions and 22 deletions

View File

@@ -224,7 +224,7 @@ void Message_Algorithm::SendStatusMessages (const Message_ExecStatus& theStatus,
// find message, iterating by base classes if necessary
TCollection_AsciiString aMsgName = aClassName + aSuffix;
Handle(Standard_Type) aType = DynamicType();
while (Message_MsgFile::Msg(aMsgName).Length() == 0 && !aType.IsNull())
while (! Message_MsgFile::HasMsg(aMsgName) && !aType.IsNull())
{
Standard_AncestorIterator it(aType);
aType.Nullify();
@@ -233,7 +233,7 @@ void Message_Algorithm::SendStatusMessages (const Message_ExecStatus& theStatus,
aType = it.Value();
TCollection_AsciiString aClassName1 (aType->Name());
TCollection_AsciiString aMsgName1 = aClassName1 + aSuffix;
if (Message_MsgFile::Msg(aMsgName1).Length() != 0)
if (Message_MsgFile::HasMsg(aMsgName1))
{
aMsgName = aMsgName1;
break;