[java] Rewrite method identifier method to handle more cases.

This commit is contained in:
Joao Matos 2017-11-24 14:34:06 +00:00
Родитель f6c41ef7bd
Коммит 101093aee0
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -277,13 +277,19 @@ namespace Embeddinator.Generators
return true;
}
static Declaration GetRootAssociatedDecl(Declaration decl)
{
while (decl.AssociatedDeclaration != null)
decl = decl.AssociatedDeclaration;
return decl;
}
public static string GetMethodIdentifier(Method method)
{
var name = method.Name;
var @class = method.Namespace as Class;
var associated = method.AssociatedDeclaration ?? method;
var associated = GetRootAssociatedDecl(method);
if (associated.DefinitionOrder != 0)
name += $"_{associated.DefinitionOrder}";