if (s.getValue().getName().equalsIgnoreCase("client")) {
System.out.println("found the client");
BCMethod js5caller = null;
int index = 0;
for (BCMethod m : s.getValue().getDeclaredMethods()) {
Code theCode = m.getCode(false);
int js5connect = theCode.getPool().findStringEntry(
"js5connect", false);
for (int j = 0; j < theCode.getInstructions().length; j++) {
Instruction i = theCode.getInstructions()[j];
if (i instanceof ConstantInstruction) {
ConstantInstruction ldc = (ConstantInstruction) i;
if (ldc.getType().equals(String.class))
if (ldc.getStringValue().equals("js5connect")) {
System.out.println("found it in method "
+ m.getName());
js5caller = m;
index = j;
}
}
}
}
Instruction[] instructions = js5caller.getCode(false)
.getInstructions();
for (int i = index; i < instructions.length; i++) {
if (instructions[i] instanceof MethodInstruction) {
index = i;
break;
}
}
for (int i = index; i < instructions.length; i++) {
if (instructions[i] instanceof PutFieldInstruction) {
index = i;
break;
}
}
PutFieldInstruction loginIndexCaller = (PutFieldInstruction) instructions[index];
System.out.println("the login index is "
+ loginIndexCaller.getFieldDeclarerName() + "."
+ loginIndexCaller.getFieldName());
}