Make classes public

This commit is contained in:
Clisprail
2014-12-25 13:39:13 +01:00
parent efcb4dbb00
commit bd612718f5
@@ -1,5 +1,8 @@
package org.parabot.core.asm.adapters;
import java.lang.reflect.Modifier;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.parabot.core.Core;
import org.parabot.core.asm.ASMUtils;
@@ -43,6 +46,15 @@ public class AddInterfaceAdapter implements Injectable {
}
protected static void addInterface(ClassNode node, String i) {
if (!Modifier.isPublic(node.access)) {
if (Modifier.isPrivate(node.access)) {
node.access = node.access & (~Opcodes.ACC_PRIVATE);
}
if (Modifier.isProtected(node.access)) {
node.access = node.access & (~Opcodes.ACC_PROTECTED);
}
node.access = node.access | Opcodes.ACC_PUBLIC;
}
node.interfaces.add(i);
}