InstructionHandle handle = il.getStart(); if (handle.getInstruction().getOpcode() != Constants.ALOAD_0) return false; handle = handle.getNext(); if (handle.getInstruction().getOpcode() != Constants.GETFIELD) return false; handle = handle.getNext(); return (handle.getInstruction() instanceof ReturnInstruction);
int count = 0; Iterator it = il.iterator(); while (it.hasNext()) { InstructionHandle ih = (InstructionHandle)it.next(); switch (ih.getInstruction().getOpcode()) { case Constants.GETFIELD: count++; if (count > 1) return false; break; case Constants.PUTFIELD: case Constants.BALOAD: case Constants.CALOAD: case Constants.DALOAD: case Constants.FALOAD: case Constants.IALOAD: case Constants.LALOAD: case Constants.SALOAD: case Constants.AALOAD: case Constants.BASTORE: case Constants.CASTORE: case Constants.DASTORE: case Constants.FASTORE: case Constants.IASTORE: case Constants.LASTORE: case Constants.SASTORE: case Constants.AASTORE: return false; case Constants.INVOKESTATIC: case Constants.INVOKEVIRTUAL: case Constants.INVOKEINTERFACE: case Constants.INVOKESPECIAL: case Constants.GETSTATIC: case Constants.PUTSTATIC:   } }  return true;
	public static boolean isGetterMethod(ClassContext classContext, Method method) {		MethodGen methodGen = classContext.getMethodGen(method);		InstructionList il = methodGen.getInstructionList();		if (il.getLength() != 3)			return false;		InstructionHandle handle = il.getStart();		if (handle.getInstruction().getOpcode() != Constants.ALOAD_0)			return false;		handle = handle.getNext();		if (handle.getInstruction().getOpcode() != Constants.GETFIELD)			return false;		handle = handle.getNext();		return (handle.getInstruction() instanceof ReturnInstruction);	}