Files
CodeChickenCore/codechicken/lib/asm/CC_ClassWriter.java
T

37 lines
896 B
Java
Raw Normal View History

2013-07-16 17:58:02 +10:00
package codechicken.lib.asm;
import org.objectweb.asm.ClassWriter;
public class CC_ClassWriter extends ClassWriter
{
private final boolean runtime;
2013-07-16 17:58:02 +10:00
public CC_ClassWriter(int flags)
{
this(flags, false);
}
public CC_ClassWriter(int flags, boolean runtime)
2013-07-16 17:58:02 +10:00
{
super(flags);
this.runtime = runtime;
2013-07-16 17:58:02 +10:00
}
@Override
protected String getCommonSuperClass(String type1, String type2)
{
String c = type1.replace('/', '.');
String d = type2.replace('/', '.');
if(ClassHeirachyManager.classExtends(d, c))
return type1;
if(ClassHeirachyManager.classExtends(c, d))
return type2;
do
{
c = ClassHeirachyManager.getSuperClass(c, runtime);
2013-07-16 17:58:02 +10:00
}
while(!ClassHeirachyManager.classExtends(d, c));
return c.replace('.', '/');
}
}