@Override
public void processConstantPoolInfo(IterationContext ic, ConstantPoolInfo cpi) {
if(cpi.getType() == ConstantPoolInfo.CLASS) {
ClassInfo ci = (ClassInfo)cpi;
JavaType jt = new JavaType(ci.getName());
String newClassName = this.advisor.newClassNameFor(jt.getType());
if(newClassName != null) {
this.oldClassNames.put(newClassName, jt.getType());
Undoable u = new ModifyClassInfoAction(ic.getCf().getPool(), ci, newClassName + jt.getDimensions());
if (this.batchMode) {
u.execute();
} else {
SystemFacade.getInstance().performAction(u, ic.getFilename());
}
}
} if(cpi.getType() == ConstantPoolInfo.NAME_AND_TYPE) {
NameAndTypeInfo nati = (NameAndTypeInfo)cpi;
Descriptor desc = nati.getDescriptor();
JavaType ret = desc.getReturn();
boolean match = false;
String newClassName = this.advisor.newClassNameFor(ret.getType());
if (newClassName != null) {
this.oldClassNames.put(newClassName, ret.getType());
match = true;
desc.setReturn(new JavaType(newClassName, ret.getDimensionCount()));
}
List params = desc.getParamList();
List<JavaType> newParams = new ArrayList<JavaType>();
for (int i=0; i < params.size(); i++) {
JavaType param = (JavaType)params.get(i);
newClassName = this.advisor.newClassNameFor(param.getType());
if (newClassName != null) {
this.oldClassNames.put(newClassName, param.getType());
match = true;
newParams.add(new JavaType(newClassName, param.getDimensionCount()));
} else {
newParams.add(param);
}
}