Drop package facades: get rid of isPackageClassFqName

This commit is contained in:
Dmitry Petrov
2015-10-16 13:20:30 +03:00
parent 12d5aca9d6
commit dc399ac46b
7 changed files with 10 additions and 35 deletions
@@ -123,10 +123,6 @@ public abstract class AbstractLineNumberTest extends TestCaseWithTmpdir {
ClassFileFactory factory = state.getFactory();
List<Integer> actualLineNumbers = Lists.newArrayList();
for (OutputFile outputFile : ClassFileUtilsKt.getClassFiles(factory)) {
if (PackageClassUtils.isPackageClassFqName(new FqName(FileUtil.getNameWithoutExtension(outputFile.getRelativePath())))) {
// Don't test line numbers in *Package facade classes
continue;
}
ClassReader cr = new ClassReader(outputFile.asByteArray());
try {
List<Integer> lineNumbers = testFunInvoke ? readTestFunLineNumbers(cr) : readAllLineNumbers(cr);
@@ -106,11 +106,6 @@ public object InlineTestUtil {
return null
}
val classFqName = JvmClassName.byInternalName(className).getFqNameForClassNameWithoutDollars()
if (PackageClassUtils.isPackageClassFqName(classFqName)) {
return null
}
return object : MethodNode(Opcodes.ASM5, access, name, desc, signature, exceptions) {
public override fun visitMethodInsn(opcode: Int, owner: String, name: String, desc: String, itf: Boolean) {
val methodCall = MethodInfo(owner, name, desc)
@@ -143,10 +138,10 @@ public object InlineTestUtil {
cr.accept(object : ClassVisitorWithName() {
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<String>?): MethodVisitor? {
val classFqName = JvmClassName.byInternalName(className).getFqNameForClassNameWithoutDollars()
JvmClassName.byInternalName(className).getFqNameForClassNameWithoutDollars()
val declaration = MethodInfo(className, name, desc)
//do not check anonymous object creation in inline functions and in package facades
if (PackageClassUtils.isPackageClassFqName(classFqName) || declaration in inlinedMethods) {
if (declaration in inlinedMethods) {
return null
}
@@ -33,20 +33,14 @@ public interface AbstractSMAPBaseTest {
private fun extractSMAPFromClasses(outputFiles: Iterable<OutputFile>): List<SMAPAndFile> {
return outputFiles.map { outputFile ->
if (PackageClassUtils.isPackageClassFqName(FqName(FileUtil.getNameWithoutExtension(outputFile.relativePath).replace('/', '.')))) {
// Don't test line numbers in *Package facade classes
null
}
else {
var debugInfo: String? = null
ClassReader(outputFile.asByteArray()).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitSource(source: String?, debug: String?) {
debugInfo = debug
}
}, 0)
var debugInfo: String? = null
ClassReader(outputFile.asByteArray()).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitSource(source: String?, debug: String?) {
debugInfo = debug
}
}, 0)
SMAPAndFile.SMAPAndFile(debugInfo, outputFile.sourceFiles.single())
}
SMAPAndFile.SMAPAndFile(debugInfo, outputFile.sourceFiles.single())
}.filterNotNull()
}