Use '$' instead of '-' in package part class names

Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic
signature writer) because they expect class names to be Java identifiers.

Some tests fixed, some will be fixed in future commits
This commit is contained in:
Alexander Udalov
2014-09-22 11:43:30 +04:00
parent e3876624d8
commit c57441b51b
69 changed files with 148 additions and 135 deletions
@@ -56,7 +56,7 @@ public class PackagePartClassUtils {
String fileName = FileUtil.getNameWithoutExtension(PathUtil.getFileName(file.getName()));
// path hashCode to prevent same name / different path collision
String srcName = facadeFqName.shortName().asString() + "-" + replaceSpecialSymbols(fileName) + "-" + Integer.toHexString(
String srcName = facadeFqName.shortName().asString() + "$" + replaceSpecialSymbols(fileName) + "$" + Integer.toHexString(
getPathHashCode(file));
return facadeFqName.parent().child(Name.identifier(srcName));
@@ -24,7 +24,7 @@ import java.util.HashMap
import java.io.File
public fun IncrementalCache.getPackagesWithRemovedFiles(sourceFilesToCompile: Collection<JetFile>): Collection<FqName> {
return getRemovedPackageParts(sourceFilesToCompile).map { it.getFqNameForClassNameWithoutDollars().parent() }
return getRemovedPackageParts(sourceFilesToCompile).map { it.getPackageFqName() }
}
public fun IncrementalCache.getRemovedPackageParts(sourceFilesToCompile: Collection<JetFile>): Collection<JvmClassName> {