JavaElementFinder now correctly finds namespace$src$ classes

No new tests added

 #KT-2839 Fixed
This commit is contained in:
Alexander Udalov
2012-10-10 15:45:15 +04:00
parent ef99474379
commit a31b748092
2 changed files with 12 additions and 3 deletions
@@ -296,8 +296,10 @@ public class NamespaceCodegen extends MemberCodegen {
substringTo = name.length();
}
int pathHashCode = FileUtil.toSystemDependentName(file.getVirtualFile().getCanonicalPath()).hashCode();
// dollar sign in the end is to prevent synthetic class from having "Test" or other parseable suffix
// path hashCode to prevent same name / different path collision
return namespaceInternalName + "$src$" + name.substring(substringFrom, substringTo) + "$" + file.getVirtualFile().getCanonicalPath().hashCode();
return namespaceInternalName + "$src$" + name.substring(substringFrom, substringTo) + "$" + pathHashCode;
}
}