srcML/stereocode

Stereotyped XML output could have incorrectly placed stereotypes

Closed this issue · 1 comments

There is a problem where the stereotypes in the XML output may be incorrectly placed. For example, if Foo() was labeled with a "get" stereotype, then the XML output may not reflect that. Either it is left empty or some other stereotype is used.

The classModelCollection::outputWithStereotypes() is used to generate the XML output. The Xpaths are collected in three places:

//src:function[not(ancestor::src:class)][" + std::to_string(i+1) + "] --> For methods defined outside the classes per unit

//src:class[not(ancestor::src:class) and not(src:name/src:operator='::')][" + std::to_string(i + 1) + "] --> For classes per unit

classXpath + "//src:function[count(ancestor::src:class) = 1][" + std::to_string(i+1) + "] --> For internal methods per unit

Issue was fixed in the most recent version of srcML.