All pastes #564726 Raw Edit

Mine

public text v1 · immutable
·published 2007-06-13 18:19 UTC
rendered paste body
			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);
					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());
			}