Improve bytecode generation.

This commit is contained in:
James Roseborough
2010-08-13 00:23:53 +00:00
parent a950957318
commit a62350b06a
3 changed files with 33 additions and 13 deletions

View File

@@ -215,16 +215,14 @@ public class luajc {
if ( loadclasses ) {
ClassLoader loader = new ClassLoader() {
public Class findClass(String classname) throws ClassNotFoundException {
String key = classname.replace('.', '/');
byte[] bytes = (byte[]) t.get(key);
byte[] bytes = (byte[]) t.get(classname);
if ( bytes != null )
return defineClass(classname, bytes, 0, bytes.length);
return super.findClass(classname);
}
};
for ( Enumeration e = t.keys(); e.hasMoreElements(); ) {
String key = (String) e.nextElement();
String classname = key.replace('/', '.');
String classname = (String) e.nextElement();
try {
Class c = loader.loadClass(classname);
Object o = c.newInstance();