use of org.hotswap.agent.javassist.bytecode.FieldInfo in project HotswapAgent by HotswapProjects.
the class FieldInitLink method makeFieldCache.
private void makeFieldCache(CtMember.Cache cache) {
List list = getClassFile3(false).getFields();
int n = list.size();
for (int i = 0; i < n; ++i) {
FieldInfo finfo = (FieldInfo) list.get(i);
CtField newField = new CtField(finfo, this);
cache.addField(newField);
}
}
use of org.hotswap.agent.javassist.bytecode.FieldInfo in project HotswapAgent by HotswapProjects.
the class FieldInitLink method removeField.
public void removeField(CtField f) throws NotFoundException {
checkModify();
FieldInfo fi = f.getFieldInfo2();
ClassFile cf = getClassFile2();
if (cf.getFields().remove(fi)) {
getMembers().remove(f);
gcConstPool = true;
} else
throw new NotFoundException(f.toString());
}
use of org.hotswap.agent.javassist.bytecode.FieldInfo in project HotswapAgent by HotswapProjects.
the class FieldInitLink method makeMemberList.
private void makeMemberList(HashMap table) {
int mod = getModifiers();
if (Modifier.isAbstract(mod) || Modifier.isInterface(mod))
try {
CtClass[] ifs = getInterfaces();
int size = ifs.length;
for (int i = 0; i < size; i++) {
CtClass ic = ifs[i];
if (ic != null && ic instanceof CtClassType)
((CtClassType) ic).makeMemberList(table);
}
} catch (NotFoundException e) {
}
try {
CtClass s = getSuperclass();
if (s != null && s instanceof CtClassType)
((CtClassType) s).makeMemberList(table);
} catch (NotFoundException e) {
}
List list = getClassFile2().getMethods();
int n = list.size();
for (int i = 0; i < n; i++) {
MethodInfo minfo = (MethodInfo) list.get(i);
table.put(minfo.getName(), this);
}
list = getClassFile2().getFields();
n = list.size();
for (int i = 0; i < n; i++) {
FieldInfo finfo = (FieldInfo) list.get(i);
table.put(finfo.getName(), this);
}
}
Aggregations