Run transformers even if bytecode not loaded, fixes synthetic classes

This commit is contained in:
Mumfrey committed 2016-01-10 19:37:23 +00:00
1 parent 967d9e28e7
commit 61ec3187b8
1 file changed
+5 -5
@@ -86,16 +86,16 @@ abstract class TreeInfo {
protected static byte[] loadClass(String className, boolean runTransformers) throws ClassNotFoundException, IOException {
String transformedName = className.replace('/', '.');
String name = MixinEnvironment.getCurrentEnvironment().unmap(transformedName);
byte[] classBytes = null;
if ((classBytes = TreeInfo.getClassBytes(name, transformedName)) == null) {
throw new ClassNotFoundException(String.format("The specified class '%s' was not found", transformedName));
}
byte[] classBytes = TreeInfo.getClassBytes(name, transformedName);
if (runTransformers) {
classBytes = TreeInfo.applyTransformers(name, transformedName, classBytes);
}
if (classBytes == null) {
throw new ClassNotFoundException(String.format("The specified class '%s' was not found", transformedName));
}
return classBytes;
}