|
|
@ -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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean changed; |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
changed = false; |
|
|
|
|
|
|
|
|
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
for (var clazz : library) { |
|
|
|
for (var clazz : library) { |
|
|
|
transformClass(clazz); |
|
|
|
changed |= transformClass(clazz); |
|
|
|
|
|
|
|
|
|
|
|
for (var field : clazz.fields) { |
|
|
|
for (var field : clazz.fields) { |
|
|
|
transformField(clazz, field); |
|
|
|
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 { |
|
|
|