implements the visitor to clear the opcode stack for the next code

@param obj
the context object for the currently parsed code block
422711
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        nodeCreations.clear();
        nodeStores.clear();
        super.visitCode(obj);

        BitSet reportedPCs = new BitSet();
        for (Integer pc : nodeCreations.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
        for (Integer pc : nodeStores.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
    }
1121412
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();
        if (prescreen(m)) {
            if (m.isSynchronized()) {
                syncPC = 0;
            } else {
                syncPC = -1;
            }
            isStatic = m.isStatic();
            unsafeAliases.clear();
            unsafeAliases.set(0);
            branchInfo.clear();
            unsafeCallOccurred = false;
            stack.resetForMethodEntry(this);
        }
    }
1088163
@Override
    public void visitCode(final Code obj) {
        if (sourceLines == null) {
            return;
        }

        if (isAbstract) {
            return;
        }

        if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) {
            return;
        }

        int methodStart = srcLineAnnotation.getStartLine() - 2;
        int methodLine = methodStart;
        String line;
        while ((methodLine >= 0) && (methodLine < sourceLines.length)) {
            line = sourceLines[methodLine];
            if (line.indexOf(methodName) >= 0) {
                break;
            }
            methodLine--;
        }

        if (methodLine < 0) {
            return;
        }

        for (int i = methodLine; i <= methodStart; i++) {
            if ((i < 0) || (i >= sourceLines.length)) {
                return;
            }
            line = sourceLines[i];
            if (line.indexOf("final") >= 0) {
                return;
            }
        }

        changedParms = new BitSet();
        super.visitCode(obj);

        BugInstance bi = null;
        for (int i = 0; i < firstLocalReg; i++) {
            if (changedParms.get(i)) {
                changedParms.clear(i);
                continue;
            }

            String parmName = getRegisterName(obj, i);
            if (bi == null) {
                bi = new BugInstance(this, BugType.FP_FINAL_PARAMETERS.name(), LOW_PRIORITY).addClass(this).addMethod(this).addSourceLine(this, 0);
                bugReporter.reportBug(bi);
            }
            bi.addString(parmName);
        }
        changedParms = null;
    }
298936
@Override
    public void visitCode(Code obj) {
        if (prescreen(getMethod())) {
            ifBlocks.clear();
            loadedRegs.clear();
            loopLocations.clear();
            stack.resetForMethodEntry(this);
            state = State.SAW_NOTHING;
            super.visitCode(obj);
        }
    }
558979
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();
        if (prescreen(m)) {
            stack.resetForMethodEntry(this);
            popStack.clear();
            super.visitCode(obj);
        }
    }
638625
@SuppressWarnings("unchecked")
    public void finish(final Object obj) {
        finish(request.getJsonConvert(), (Type) null, obj);
    }
1211648
@Override
	public void visitMethod(Method obj) {
		try {
			if (obj.isSynthetic()) {
				return;
			}

			if (Values.CONSTRUCTOR.equals(getMethodName()) && javaClass.getClassName().contains("$")) {
				return;
			}

			List<String> types = SignatureUtils.getParameterSignatures(obj.getSignature());
			if ((types.isEmpty()) || (types.size() > 2)) {
				return;
			}

			if ((obj.getAccessFlags() & Const.ACC_VARARGS) != 0) {
				return;
			}

			String lastParmSig = types.get(types.size() - 1);
			if (!lastParmSig.startsWith(Values.SIG_ARRAY_PREFIX)
					|| lastParmSig.startsWith(Values.SIG_ARRAY_OF_ARRAYS_PREFIX)) {
				return;
			}

			if (SignatureBuilder.SIG_BYTE_ARRAY.equals(lastParmSig)
					|| SignatureBuilder.SIG_CHAR_ARRAY.equals(lastParmSig)) {
				return;
			}

			if (hasSimilarParms(types)) {
				return;
			}

			if (obj.isStatic() && "main".equals(obj.getName()) && SIG_STRING_ARRAY_TO_VOID.equals(obj.getSignature())) {
				return;
			}

			if (!obj.isPrivate() && !obj.isStatic() && isInherited(obj)) {
				return;
			}

			super.visitMethod(obj);
			bugReporter.reportBug(new BugInstance(this, BugType.UVA_USE_VAR_ARGS.name(), LOW_PRIORITY).addClass(this)
					.addMethod(this));

		} catch (ClassNotFoundException cnfe) {
			bugReporter.reportMissingClass(cnfe);
		}
	}
1264293
@Override
    public void visitCode(Code obj) {
        Method method = getMethod();
        if (!method.isSynthetic() && prescreen(method)) {
            stack.resetForMethodEntry(this);
            super.visitCode(obj);
        }
    }
989480
@Override
    public void visitCode(Code obj) {
        if (Values.STATIC_INITIALIZER.equals(getMethod().getName())) {
            state = State.SAW_NOTHING;
            super.visitCode(obj);
        }
    }
796967
@Override
    public void visitMethod(Method obj) {
        state = State.SAW_NOTHING;
        iConst0Looped.clear();
        stack.resetForMethodEntry(this);
    }
392230
@Override
    public void visitMethod(Method obj) {
        Code c = obj.getCode();
        if (c != null) {
            byte[] opcodes = c.getCode();
            if (opcodes != null) {
                trPCPos = opcodes.length - 1;
                if (!obj.getSignature().endsWith(Values.SIG_VOID)) {
                    trPCPos -= 1;
                }
                trPCPos -= TAILRECURSIONFUDGE;
                possibleTailRecursion = true;
                isStatic = obj.isStatic();
                stack.resetForMethodEntry(this);
                super.visitMethod(obj);
            }
        }
    }
831968
@Override
    public void visitMethod(Method obj) {
        methodName = obj.getName();
        state = State.SAW_NOTHING;
    }
788553
@Override
    public void sawOpcode(int seen) {
        if (seen == Const.PUTFIELD) {
            OpcodeStack stack = getStack();
            if (stack.getStackDepth() > 0) {
                int reg = stack.getStackItem(0).getRegisterNumber();
                if ((reg >= 0) && (reg < firstLocalRegister)) {
                    clearSpecialField(getNameConstantOperand());
                }
            }
        }
        super.sawOpcode(seen);
    }
873183
public final void enqueue(Object obj)
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "enqueue", obj);
    // m_array has at least one position in it that is free.
    m_array[m_tail++] = obj;
    if (m_tail == m_array.length)
      m_tail = 0;
    if (m_head == m_tail)
      expand_array();
//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "enqueue");
  }
267215
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        nextAllocNumber = 1;
        storeToUserValue.clear();
        allocLocation.clear();
        allocToAddPCs.clear();
        optionalRanges.clear();

        addExceptionRanges(obj);

        super.visitCode(obj);

        for (List<Integer> pcs : allocToAddPCs.values()) {
            if (pcs.size() > 16) {
                bugReporter.reportBug(new BugInstance(this, BugType.PSC_PRESIZE_COLLECTIONS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pcs.get(0).intValue()));
            }
        }
    }
377730
@Override
    public void visitCode(Code obj) {
        if (!Values.STATIC_INITIALIZER.equals(getMethodName())) {
            state = State.SEEN_NOTHING;
            super.visitCode(obj);
        }
    }
296703
@Override
	public void sawOpcode(int seen) {
		String userValue = null;

		try {
			stack.precomputation(this);

			int pc = getPC();
			if (branchTargets.get(pc)) {
				localMethodCalls.clear();
				fieldMethodCalls.clear();
				branchTargets.clear(pc);
			}

			if (((seen >= Const.IFEQ) && (seen <= Const.GOTO)) || ((seen >= Const.IFNULL) && (seen <= Const.GOTO_W))) {
				branchTargets.set(getBranchTarget());
			} else if ((seen == Const.TABLESWITCH) || (seen == Const.LOOKUPSWITCH)) {
				int[] offsets = getSwitchOffsets();
				for (int offset : offsets) {
					branchTargets.set(offset + pc);
				}
				branchTargets.set(getDefaultSwitchOffset() + pc);
			} else if (OpcodeUtils.isAStore(seen)) {
				localMethodCalls.remove(Integer.valueOf(RegisterUtils.getAStoreReg(this, seen)));
			} else if (seen == Const.PUTFIELD) {
				String fieldSource = "";

				if (stack.getStackDepth() > 0) {
					OpcodeStack.Item item = stack.getStackItem(0);
					fieldSource = (String) item.getUserValue();
					if (fieldSource == null) {
						fieldSource = "";
					}
				}
				fieldMethodCalls.remove(new FieldInfo(fieldSource, getNameConstantOperand()));
			} else if (seen == Const.GETFIELD) {
				if (stack.getStackDepth() > 0) {
					OpcodeStack.Item item = stack.getStackItem(0);
					userValue = (String) item.getUserValue();
					if (userValue == null) {
						int reg = item.getRegisterNumber();
						if (reg >= 0) {
							userValue = String.valueOf(reg);
						} else {
							XField xf = item.getXField();
							if (xf != null) {
								userValue = xf.getName();
							}
						}
					}
				}
			} else if ((seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKEINTERFACE)
					|| (seen == Const.INVOKESTATIC)) {

				String className = getClassConstantOperand();
				String methodName = getNameConstantOperand();
				String signature = getSigConstantOperand();
				int parmCount = SignatureUtils.getNumParameters(signature);

				int reg = -1;
				XField field = null;
				MethodCall mc = null;
				String fieldSource = null;
				if (seen == Const.INVOKESTATIC) {
					XMethod xm = XFactory.createXMethod(getDottedClassConstantOperand(), methodName, signature, true);
					String genericSignature = xm.getSourceSignature();
					if ((genericSignature != null) && genericSignature.endsWith(">;")) {
						return;
					}
				} else if (stack.getStackDepth() > parmCount) {
					OpcodeStack.Item obj = stack.getStackItem(parmCount);
					reg = obj.getRegisterNumber();
					field = obj.getXField();

					if (reg >= 0) {
						mc = localMethodCalls.get(Integer.valueOf(reg));
						MethodInfo mi = Statistics.getStatistics().getMethodStatistics(className,
								getNameConstantOperand(), signature);
						if ((mi != null) && mi.getModifiesState()) {
							clearFieldMethods(String.valueOf(reg));
							return;
						}
					} else if (field != null) {
						fieldSource = (String) obj.getUserValue();
						if (fieldSource == null) {
							fieldSource = "";
						}
						mc = fieldMethodCalls.get(new FieldInfo(fieldSource, field.getName()));
						MethodInfo mi = Statistics.getStatistics().getMethodStatistics(className,
								getNameConstantOperand(), signature);
						if ((mi != null) && mi.getModifiesState()) {
							clearFieldMethods(fieldSource);
							return;
						}
					}
				}

				int neededStackSize = parmCount + ((seen == Const.INVOKESTATIC) ? 0 : 1);
				if (stack.getStackDepth() >= neededStackSize) {
					Object[] parmConstants = new Object[parmCount];
					for (int i = 0; i < parmCount; i++) {
						OpcodeStack.Item parm = stack.getStackItem(i);
						parmConstants[i] = parm.getConstant();
						if (parm.getSignature().startsWith(Values.SIG_ARRAY_PREFIX)) {
							if (!Values.ZERO.equals(parm.getConstant())) {
								return;
							}
							XField f = parm.getXField();
							if (f != null) {
								// Two different fields holding a 0 length array should be considered different
								parmConstants[i] = f.getName() + ':' + parmConstants[i];
							}
						}

						if (parmConstants[i] == null) {
							return;
						}
					}

					if (seen == Const.INVOKESTATIC) {
						mc = staticMethodCalls.get(className);
					} else if ((reg < 0) && (field == null)) {
						return;
					}

					if (mc != null) {
						if (!signature.endsWith(Values.SIG_VOID) && methodName.equals(mc.getName())
								&& signature.equals(mc.getSignature()) && !isRiskyName(className, methodName)
								&& !commonMethods.contains(new FQMethod(className, methodName, signature))) {
							Object[] parms = mc.getParms();
							if (Arrays.equals(parms, parmConstants)) {
								int ln = getLineNumber(pc);

								if ((ln != mc.getLineNumber()) || (Math.abs(pc - mc.getPC()) < 10)) {
									Statistics statistics = Statistics.getStatistics();
									MethodInfo mi = statistics.getMethodStatistics(className, methodName, signature);

									bugReporter.reportBug(
											new BugInstance(this, BugType.PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS.name(),
													getBugPriority(methodName, mi)).addClass(this).addMethod(this)
															.addSourceLine(this).addString(methodName + signature));
								}
							}
						}

						if (seen == Const.INVOKESTATIC) {
							staticMethodCalls.remove(className);
						} else {
							if (reg >= 0) {
								localMethodCalls.remove(Integer.valueOf(reg));
							} else if (fieldSource != null) {
								fieldMethodCalls.remove(new FieldInfo(fieldSource, field.getName()));
							}
						}
					} else {
						int ln = getLineNumber(pc);
						if (seen == Const.INVOKESTATIC) {
							staticMethodCalls.put(className,
									new MethodCall(methodName, signature, parmConstants, pc, ln));
						} else {
							if (reg >= 0) {
								localMethodCalls.put(Integer.valueOf(reg),
										new MethodCall(methodName, signature, parmConstants, pc, ln));
							} else if (field != null) {
								OpcodeStack.Item obj = stack.getStackItem(parmCount);
								fieldSource = (String) obj.getUserValue();
								if (fieldSource == null) {
									fieldSource = "";
								}
								fieldMethodCalls.put(new FieldInfo(fieldSource, field.getName()),
										new MethodCall(methodName, signature, parmConstants, pc, ln));
							}
						}
					}
				}
			} else if (OpcodeUtils.isReturn(seen)) {
				localMethodCalls.clear();
				fieldMethodCalls.clear();
				branchTargets.clear(pc);
			}
		} finally {
			stack.sawOpcode(this, seen);
			if ((userValue != null) && (stack.getStackDepth() > 0)) {
				OpcodeStack.Item item = stack.getStackItem(0);
				item.setUserValue(userValue);
			}
		}
	}