|
|
@ -11,23 +11,28 @@ public abstract class Transformer { |
|
|
|
public void transform(ClassPath classPath) throws AnalyzerException { |
|
|
|
public void transform(ClassPath classPath) throws AnalyzerException { |
|
|
|
preTransform(classPath); |
|
|
|
preTransform(classPath); |
|
|
|
|
|
|
|
|
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
boolean changed; |
|
|
|
for (var clazz : library) { |
|
|
|
do { |
|
|
|
transformClass(clazz); |
|
|
|
changed = false; |
|
|
|
|
|
|
|
|
|
|
|
for (var field : clazz.fields) { |
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
transformField(clazz, field); |
|
|
|
for (var clazz : library) { |
|
|
|
} |
|
|
|
changed |= transformClass(clazz); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var field : clazz.fields) { |
|
|
|
|
|
|
|
changed |= transformField(clazz, field); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (var method : clazz.methods) { |
|
|
|
for (var method : clazz.methods) { |
|
|
|
transformMethod(clazz, method); |
|
|
|
changed |= transformMethod(clazz, method); |
|
|
|
|
|
|
|
|
|
|
|
if ((method.access & (Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT)) == 0) { |
|
|
|
if ((method.access & (Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT)) == 0) { |
|
|
|
transformCode(clazz, method); |
|
|
|
changed |= transformCode(clazz, method); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} while (changed); |
|
|
|
|
|
|
|
|
|
|
|
postTransform(classPath); |
|
|
|
postTransform(classPath); |
|
|
|
} |
|
|
|
} |
|
|
@ -36,20 +41,20 @@ public abstract class Transformer { |
|
|
|
/* empty */ |
|
|
|
/* empty */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void transformClass(ClassNode clazz) throws AnalyzerException { |
|
|
|
public boolean transformClass(ClassNode clazz) throws AnalyzerException { |
|
|
|
/* empty */ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void transformField(ClassNode clazz, FieldNode field) throws AnalyzerException { |
|
|
|
public boolean transformField(ClassNode clazz, FieldNode field) throws AnalyzerException { |
|
|
|
/* empty */ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void transformMethod(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
public boolean transformMethod(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
/* empty */ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
public boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
/* empty */ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void postTransform(ClassPath classPath) throws AnalyzerException { |
|
|
|
public void postTransform(ClassPath classPath) throws AnalyzerException { |
|
|
|