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