implement the visitor to reset the opcode stack and set of locals that are jdbc objects

@param obj
the context param of the currently parsed method
164996
@Override
    public void visitMethod(Method obj) {
        stack.resetForMethodEntry(this);
        jdbcLocals.clear();

        int[] parmRegs = RegisterUtils.getParameterRegisters(obj);
        Type[] argTypes = obj.getArgumentTypes();

        for (int t = 0; t < argTypes.length; t++) {
            String sig = argTypes[t].getSignature();
            if (isJDBCClass(sig)) {
                jdbcLocals.put(Integer.valueOf(parmRegs[t]),
                        Integer.valueOf(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), parmRegs[t], 0)));
            }
        }
    }
543091
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        xmlItemCount = 0;
        xmlConfidentCount = 0;
        firstPC = -1;
        super.visitCode(obj);
        if ((xmlItemCount >= lowReportingThreshold) && (xmlConfidentCount > (lowReportingThreshold >> 1))) {
            bugReporter.reportBug(new BugInstance(this, "CBX_CUSTOM_BUILT_XML",
                    (xmlItemCount >= highReportingThreshold) ? HIGH_PRIORITY : (xmlItemCount >= midReportingThreshold) ? NORMAL_PRIORITY : LOW_PRIORITY)
                            .addClass(this).addMethod(this).addSourceLine(this, firstPC));

        }
    }
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);
            }
        }
    }
830576
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();

        if (overloadedMethods.contains(m)) {
            return;
        }

        int aFlags = m.getAccessFlags();
        if ((((aFlags & Const.ACC_PRIVATE) != 0) || ((aFlags & Const.ACC_STATIC) != 0)) && ((aFlags & Const.ACC_SYNTHETIC) == 0)
                && (!m.getSignature().endsWith(")Z"))) {
            stack.resetForMethodEntry(this);
            returnRegister = Values.NEGATIVE_ONE;
            returnConstant = null;
            registerConstants.clear();
            returnPC = -1;

            try {
                super.visitCode(obj);
                if ((returnConstant != null)) {
                    BugInstance bi = new BugInstance(this, BugType.MRC_METHOD_RETURNS_CONSTANT.name(),
                            ((aFlags & Const.ACC_PRIVATE) != 0) ? NORMAL_PRIORITY : LOW_PRIORITY).addClass(this).addMethod(this);
                    if (returnPC >= 0) {
                        bi.addSourceLine(this, returnPC);
                    }

                    bi.addString(returnConstant.toString());
                    bugReporter.reportBug(bi);
                }
            } catch (StopOpcodeParsingException e) {
                // method was not suspect
            }
        }
    }
1348497
@Override
    public void visitMethod(final Method obj) {
        methodName = obj.getName();
        methodIsStatic = obj.isStatic();
    }
1054369
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();

        if (isIgnorableMethod(m)) {
            return;
        }

        stack.resetForMethodEntry(this);
        syncBlockBranchResetValues.clear();
        syncBlockCount = 0;
        super.visitCode(obj);
    }
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);
        }
    }
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());
            }
        }
    }
1226056
@Override
    public void visitCode(final Code obj) {
        stack.resetForMethodEntry(this);
        indexToFieldMap.clear();
        super.visitCode(obj);
    }
558979
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();
        if (prescreen(m)) {
            stack.resetForMethodEntry(this);
            popStack.clear();
            super.visitCode(obj);
        }
    }
363063
public void executeBeforeMethods(final Object obj) {
        // Invoke element only if not parameterized
        if (this.element.getDataProvider() == null) {
            // invoking once the beforeFirstRun-method
            if (!beforeFirstRun) {
                beforeFirstRun = true;

                Method[] beforeFirst = null;
                try {
                    beforeFirst = element.findBeforeFirstRun();
                    if (beforeFirst.length != 0) {
                        checkAndExecuteBeforeAfters(obj, BeforeFirstRun.class, beforeFirst);
                    }
                } catch (final PerfidixMethodCheckException e) {
                    BENCHRES.addException(e);
                }
            }

            // invoking the beforeEachRun-method
            Method[] beforeEach = null;
            try {
                beforeEach = element.findBeforeEachRun();
                if (beforeEach.length != 0) {
                    checkAndExecuteBeforeAfters(obj, BeforeEachRun.class, beforeEach);
                }
            } catch (final PerfidixMethodCheckException e) {
                BENCHRES.addException(e);
            }
        }
    }
155842
@Override
    public void visitCode(final Code obj) {
        if (obj.getCode() != null) {
            stack.resetForMethodEntry(this);
            sawLDCEmpty = false;
            super.visitCode(obj);
        }
    }
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()));
            }
        }
    }
863582
@Override
    public void visitCode(final Code obj) {
        try {
            localCollections = new HashMap<>();
            localScopeEnds = new HashMap<>();
            localSourceLineAnnotations = new HashMap<>();
            stack.resetForMethodEntry(this);
            super.visitCode(obj);
        } finally {
            localCollections = null;
            localScopeEnds = null;
            localSourceLineAnnotations = null;
        }
    }
878316
@Override
    public void visitMethod(Method obj) {
        firstLocalRegister = SignatureUtils.getFirstRegisterSlot(obj);
        super.visitMethod(obj);
    }
746546
@Override
    public void visitCode(Code obj) {

        stack.resetForMethodEntry(this);
        unendedZLIBs.clear();
        super.visitCode(obj);

        for (SourceLineAnnotation sa : unendedZLIBs.values()) {
            bugReporter.reportBug(new BugInstance(this, BugType.IOI_UNENDED_ZLIB_OBJECT.name(), NORMAL_PRIORITY)
                    .addClass(this).addMethod(this).addSourceLine(sa));
        }
    }
1319440
@Override
    public void visitCode(Code obj) {
        try {
            Method m = getMethod();
            Type retType = m.getReturnType();
            if ("Ljava/lang/Boolean;".equals(retType.getSignature())) {
                stack.resetForMethodEntry(this);
                super.visitCode(obj);
            }
        } catch (StopOpcodeParsingException e) {
            // if the method was already reported
        }
    }