switch (state) { case SEEN_NOTHING: if (seen == ICONST_0) { state = SEEN_ICONST_0; iConst0_PC = getPC(); } break;  case SEEN_ICONST_0: if ((seen == INVOKEINTERFACE) &&  (getClassConstantOperand().equals("java/sql/ResultSet"))) { String methodName = getNameConstantOperand();  int pcOffset = getPC() - iConst0_PC; if ((pcOffset <= 1) &&  (methodName.startsWith("get")) &&  (dbFieldTypesSet.contains(methodName.substring(3)))) { state = SEEN_NOTHING; bugReporter.reportBug(new BugInstance("BRSA_BAD_RESULTSET_ACCESS", NORMAL_PRIORITY) .addClassAndMethod(this) .addSourceLine(this));
try { if ((seen == INVOKEINTERFACE) &&  (getClassConstantOperand().equals("java/sql/ResultSet"))) { String methodName = getNameConstantOperand(); if ((methodName.startsWith("get") && dbFieldTypesSet.contains(methodName.substring(3))) ||  (methodName.startsWith("update") && dbFieldTypesSet.contains(methodName.substring(6)))) { String signature = getSigConstantOperand(); Type[] argTypes = Type.getArgumentTypes(signature); int numParms = argTypes.length; if (stack.getStackDepth() >= numParms) { OpcodeStack.Item item = stack.getStackItem(numParms-1); Object cons = item.getConstant(); if ((cons != null) && ("I".equals(item.getSignature())) && (((Integer) cons).intValue() == 0)) { bugReporter.reportBug(new BugInstance("BRSA_BAD_RESULTSET_ACCESS", NORMAL_PRIORITY) .addClassAndMethod(this) .addSourceLine(this)); }
	public void sawOpcode(int seen) {		switch (state) {			case SEEN_NOTHING:				if (seen == ICONST_0) {					state = SEEN_ICONST_0;					iConst0_PC = getPC();				}				break;						case SEEN_ICONST_0:				if ((seen == INVOKEINTERFACE)				&&  (getClassConstantOperand().equals("java/sql/ResultSet"))) {					String methodName = getNameConstantOperand();										int pcOffset = getPC() - iConst0_PC;					if ((pcOffset <= 1)					&&  (methodName.startsWith("get"))					&&  (dbFieldTypesSet.contains(methodName.substring(3)))) {						state = SEEN_NOTHING;						bugReporter.reportBug(new BugInstance("BRSA_BAD_RESULTSET_ACCESS", NORMAL_PRIORITY)						        .addClassAndMethod(this)						        .addSourceLine(this));					}					else if (((pcOffset < 3) && (pcOffset > 1))					&&       (methodName.startsWith("update"))					&&       (dbFieldTypesSet.contains(methodName.substring(6)))) {						state = SEEN_NOTHING;						bugReporter.reportBug(new BugInstance("BRSA_BAD_RESULTSET_ACCESS", NORMAL_PRIORITY)						        .addClassAndMethod(this)						        .addSourceLine(this));					} 				}				if ((getPC() - iConst0_PC) > 2)     					state = SEEN_NOTHING;				break;		}	}