BigInteger clauseAsInt = new BigInteger(clause);
BigInteger clauseAsInt; if (clause.length == 0) clauseAsInt = BigInteger.ZERO; else clauseAsInt = new BigInteger(clause);
	private void findSwitchDuplicates(CFG cfg, Method method, BasicBlock bb) {								int[] switchPos = new int[cfg.getNumOutgoingEdges(bb)+1];		HashMap<Integer, InstructionHandle> prevHandle = new HashMap<Integer, InstructionHandle>();		Iterator<Edge> iei = cfg.outgoingEdgeIterator(bb);		int idx = 0;				while (iei.hasNext()) {			Edge e = iei.next();			int eType = e.getType();			if (eType == EdgeTypes.SWITCH_EDGE || eType == EdgeTypes.SWITCH_DEFAULT_EDGE) {				BasicBlock target = e.getTarget();				InstructionHandle firstIns = getDeepFirstInstruction(cfg, target);				if (firstIns == null)					continue; // give up on this edge				int firstInsPosition = firstIns.getPosition();				switchPos[idx++] = firstInsPosition;				InstructionHandle prevIns = firstIns.getPrev(); // prev in bytecode, not flow				if (prevIns != null) prevHandle.put((Integer)firstInsPosition, prevIns);			} else {				// hmm, this must not be a switch statement, so give up				return;			}		}				if (idx < 2) // need at least two edges to tango			return;								Arrays.sort(switchPos, 0, idx); // sort the 'idx' switch positions				// compute end position of final case (ok if set to 0 or <= switchPos[idx-1])		switchPos[idx] = getFinalTarget(cfg, switchPos[idx-1], prevHandle.values());				HashMap<BigInteger, Collection<Integer>> map = new HashMap<BigInteger,Collection<Integer>>();		for (int i = 0; i < idx; i++) {			if (switchPos[i]+1 >= switchPos[i+1]) continue; // why the +1 on lhs?						int endPos = switchPos[i+1];			InstructionHandle last = prevHandle.get((Integer)switchPos[i+1]);			if (last == null) {				// should be default case -- leave endPos as is			} else if (last.getInstruction() instanceof GotoInstruction) {				endPos = last.getPosition(); // don't store the goto			} else if (last.getInstruction() instanceof ReturnInstruction) {				// leave endPos as is (store the return instruction)		//	} else if (last.getInstruction() instanceof ATHROW) {		//		// leave endPos as is (store the throw instruction)		// Don't do this since many cases may throw "not implemented".			} else {				if (i+2 < idx) continue; // falls through to next case, so don't store it at all				if (i+1 < idx && switchPos[idx]!=switchPos[idx-1]) continue; // also falls through unless switch has no default case			}						byte[] clause = getCodeBytes(method, switchPos[i], endPos);						BigInteger clauseAsInt = new BigInteger(clause);						Collection<Integer> values = map.get(clauseAsInt);						if (values == null) {				values = new LinkedList<Integer>();				map.put(clauseAsInt,values);			}			values.add((Integer)i); // index into the sorted array		}		for(Collection<Integer> clauses : map.values()) {			if (clauses.size() > 1) {				BugInstance bug = new BugInstance(this, "DB_DUPLICATE_SWITCH_CLAUSES", LOW_PRIORITY)						.addClass(classContext.getJavaClass())						.addMethod(classContext.getJavaClass(), method);				for(int i : clauses) 					bug.addSourceLineRange(this.classContext, this, 							switchPos[i],							switchPos[i+1]-1); // not endPos, but that's ok				bugReporter.reportBug(bug);			}		}	}