/*
(non-Javadoc)

@see edu.umd.cs.findbugs.bcel.OpcodeStackDetector#sawOpcode(int)
191517
@Override
    public void sawOpcode(int seen) {
        // System.out.println(getPC() + " " + Const.getOpcodeName(seen) + " " + state);

        if (stack.getStackDepth() < stackDepth) {
            state = FormatState.NONE;
            stackDepth = 0;
            arguments = null;
        }
        if (seen == Const.ANEWARRAY && stack.getStackDepth() >= 2) {
            Object size = stack.getStackItem(0).getConstant();
            Object formatStr = stack.getStackItem(1).getConstant();
            if (size instanceof Integer && formatStr instanceof String) {
                arguments = new OpcodeStack.Item[(Integer) size];
                this.formatString = (String) formatStr;
                state = FormatState.READY_FOR_FORMAT;
                stackDepth = stack.getStackDepth();
            }
        } else if (state == FormatState.READY_FOR_FORMAT && seen == Const.DUP) {
            state = FormatState.EXPECTING_ASSIGNMENT;
        } else if (state == FormatState.EXPECTING_ASSIGNMENT && stack.getStackDepth() == stackDepth + 3 && seen == Const.AASTORE) {
            Object pos = stack.getStackItem(1).getConstant();
            OpcodeStack.Item value = stack.getStackItem(0);
            if (pos instanceof Integer) {
                int index = (Integer) pos;
                if (index >= 0 && index < arguments.length) {
                    arguments[index] = value;
                    state = FormatState.READY_FOR_FORMAT;
                } else {
                    state = FormatState.NONE;
                }
            } else {
                state = FormatState.NONE;
            }
        } else if (state == FormatState.READY_FOR_FORMAT
                && (seen == Const.INVOKESPECIAL || seen == Const.INVOKEVIRTUAL || seen == Const.INVOKESTATIC || seen == Const.INVOKEINTERFACE)
                && stack.getStackDepth() == stackDepth) {

            String cl = getClassConstantOperand();
            String nm = getNameConstantOperand();
            String sig = getSigConstantOperand();
            XMethod m = getXMethodOperand();
            if ((m == null || m.isVarArgs())
                    && sig.indexOf("Ljava/lang/String;[Ljava/lang/Object;)") >= 0
                    && ("java/util/Formatter".equals(cl) && "format".equals(nm) || "java/lang/String".equals(cl)
                            && "format".equals(nm) || "java/io/PrintStream".equals(cl) && "format".equals(nm)
                            || "java/io/PrintStream".equals(cl) && "printf".equals(nm) || cl.endsWith("Writer")
                            && "format".equals(nm) || cl.endsWith("Writer") && "printf".equals(nm)) || cl.endsWith("Logger")
                            && nm.endsWith("fmt")) {

                if (formatString.indexOf('\n') >= 0) {
                    bugReporter.reportBug(new BugInstance(this, "VA_FORMAT_STRING_USES_NEWLINE", NORMAL_PRIORITY)
                    .addClassAndMethod(this).addCalledMethod(this).addString(formatString)
                    .describe(StringAnnotation.FORMAT_STRING_ROLE).addSourceLine(this));
                }
            }

        }
    }
480743
@Override
	public void sawOpcode(int seen) {
        if ((seen == Const.INVOKEVIRTUAL) && "printStackTrace".equals(getNameConstantOperand())
				&& SignatureBuilder.SIG_VOID_TO_VOID.equals(getSigConstantOperand())) {
			bugReporter
					.reportBug(new BugInstance(this, BugType.IMC_IMMATURE_CLASS_PRINTSTACKTRACE.name(), NORMAL_PRIORITY)
							.addClass(this).addMethod(this).addSourceLine(this));
		}
	}
878926
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            int sDepth = stack.getStackDepth();
            Iterator<PopInfo> it = popStack.iterator();

            while (it.hasNext()) {
                if (sDepth < it.next().popDepth) {
                    it.remove();
                }
            }

            if ((seen == Const.INVOKESTATIC) && !popStack.isEmpty()) {
                String method = getNameConstantOperand();
                if (method.indexOf(Values.SYNTHETIC_MEMBER_CHAR) < 0) {
                    PopInfo pInfo = popStack.get(0);
                    int numArguments = SignatureUtils.getNumParameters(getSigConstantOperand());
                    if (((numArguments > 0) || (pInfo.popPC == (getPC() - 1))) && (numArguments == (stack.getStackDepth() - pInfo.popDepth))
                            && classDefinesStaticMethod(SignatureUtils.stripSignature(pInfo.popSignature))) {
                        int lineNumber = -1;
                        if (lineNumberTable != null) {
                            lineNumber = lineNumberTable.getSourceLine(getPC());
                        }
                        if (pInfo.popLineNum == lineNumber) {
                            bugReporter.reportBug(new BugInstance(this, BugType.SMII_STATIC_METHOD_INSTANCE_INVOCATION.name(), NORMAL_PRIORITY).addClass(this)
                                    .addMethod(this).addSourceLine(this));
                        }
                        popStack.clear();
                    }
                }
            }

            if ((seen == Const.PUTFIELD) || (seen == Const.ATHROW) || (seen == Const.GOTO) || (seen == Const.GOTO_W)
                    || ((seen >= Const.IFEQ) && (seen <= Const.IF_ACMPNE)) || OpcodeUtils.isAStore(seen)) {
                popStack.clear();
            } else if ((seen == Const.INVOKESPECIAL) || (seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESTATIC)) {
                if (Values.SIG_VOID.equals(SignatureUtils.getReturnSignature(getSigConstantOperand()))) {
                    popStack.clear();
                }
            }

            if ((seen == Const.POP) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item itm = stack.getStackItem(0);
                String popSig = itm.getSignature();
                if (popSig.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX)) {
                    int lineNumber = -1;
                    if (lineNumberTable != null) {
                        lineNumber = lineNumberTable.getSourceLine(getPC());
                    }
                    popStack.add(new PopInfo(getPC(), lineNumber, popSig, sDepth - 1));
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
            popStack.clear();
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
1283578
@Override
    public void sawOpcode(int seen) {
        if (seen == Const.PUTFIELD) {
            QMethod methodInfo = new QMethod(getMethodName(), getMethodSig());
            Map<Map.Entry<String, String>, SourceLineAnnotation> fields = methodWrites.get(methodInfo);
            if (fields == null) {
                fields = new HashMap<>();
                methodWrites.put(methodInfo, fields);
            }
            String fieldName = getNameConstantOperand();
            String fieldSig = getSigConstantOperand();

            FieldAnnotation fa = new FieldAnnotation(getDottedClassName(), fieldName, fieldSig, false);
            fieldAnnotations.put(fieldName, fa);
            fields.put(new AbstractMap.SimpleImmutableEntry(fieldName, fieldSig), SourceLineAnnotation.fromVisitedInstruction(this));
        }
    }
17166
@Override
    public void sawOpcode(int seen) {
        String attributeName = null;
        boolean sawGetAttribute = false;
        try {
            stack.precomputation(this);

            if (seen == Const.INVOKEINTERFACE) {
                String clsName = getClassConstantOperand();
                if ("javax/servlet/http/HttpSession".equals(clsName)) {
                    String methodName = getNameConstantOperand();
                    if ("getAttribute".equals(methodName)) {
                        if (stack.getStackDepth() > 0) {
                            OpcodeStack.Item item = stack.getStackItem(0);
                            Object con = item.getConstant();
                            if (con instanceof String) {
                                attributeName = (String) con;
                                sawGetAttribute = true;
                            }
                        }
                    } else if ("setAttribute".equals(methodName) && (stack.getStackDepth() > 1)) {
                        OpcodeStack.Item item = stack.getStackItem(1);
                        Object con = item.getConstant();
                        if (con instanceof String) {
                            attributeName = (String) con;
                            changedAttributes.remove(attributeName);
                        }
                    }
                }
            } else if (OpcodeUtils.isALoad(seen)) {
                int reg = RegisterUtils.getALoadReg(this, seen);
                attributeName = savedAttributes.get(Integer.valueOf(reg));
                sawGetAttribute = attributeName != null;
            } else if ((((seen >= Const.ASTORE_0) && (seen <= Const.ASTORE_3)) || (seen == Const.ASTORE)) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                attributeName = (String) item.getUserValue();
                int reg = RegisterUtils.getAStoreReg(this, seen);
                savedAttributes.put(Integer.valueOf(reg), attributeName);
            }

            if ((seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEVIRTUAL)) {
                String methodName = getNameConstantOperand();
                Matcher m = modifyingNames.matcher(methodName);
                if (m.matches()) {
                    String signature = getSigConstantOperand();
                    int numArgs = SignatureUtils.getNumParameters(signature);
                    if (stack.getStackDepth() > numArgs) {
                        OpcodeStack.Item item = stack.getStackItem(numArgs);
                        attributeName = (String) item.getUserValue();
                        if (attributeName != null) {
                            changedAttributes.put(attributeName, Integer.valueOf(getPC()));
                        }
                    }
                }
            } else if ((seen >= Const.IASTORE) && (seen <= Const.SASTORE) && (stack.getStackDepth() > 2)) {
                OpcodeStack.Item item = stack.getStackItem(2);
                attributeName = (String) item.getUserValue();
                if (attributeName != null) {
                    changedAttributes.put(attributeName, Integer.valueOf(getPC()));
                }
            }
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);
            if (sawGetAttribute && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(attributeName);
            }
        }
    }
130142
@Override
    public void sawOpcode(int seen) {
        try {

            stack.precomputation(this);

            if (OpcodeUtils.isStandardInvoke(seen)) {
                String clsName = getClassConstantOperand();
                if (!safeClasses.contains(clsName)) {
                    try {
                        JavaClass cls = Repository.lookupClass(clsName);
                        Method[] methods = cls.getMethods();
                        String methodName = getNameConstantOperand();
                        String signature = getSigConstantOperand();
                        boolean found = false;
                        for (Method m : methods) {
                            if (m.getName().equals(methodName) && m.getSignature().equals(signature)) {

                                if (isAnonymousInnerCtor(m, cls)) {
                                    // The java compiler doesn't properly attached an Exception Table to anonymous
                                    // constructors, so just clear if so
                                    break;
                                }

                                ExceptionTable et = m.getExceptionTable();
                                if (et != null) {
                                    String[] thrownExceptions = et.getExceptionNames();
                                    for (String thrownException : thrownExceptions) {
                                        removeThrownExceptionHierarchy(thrownException);
                                    }
                                }
                                found = true;
                                break;
                            }
                        }

                        if (!found) {
                            clearExceptions();
                        }
                    } catch (ClassNotFoundException cnfe) {
                        bugReporter.reportMissingClass(cnfe);
                        clearExceptions();
                    }
                } else if ("wait".equals(getNameConstantOperand())) {
                    removeException("java.lang.InterruptedException");
                }
            } else if (seen == Const.ATHROW) {
                if (stack.getStackDepth() > 0) {
                    OpcodeStack.Item item = stack.getStackItem(0);
                    String exSig = item.getSignature();
                    String thrownException = SignatureUtils.stripSignature(exSig);
                    removeThrownExceptionHierarchy(thrownException);
                } else {
                    clearExceptions();
                }
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
710008
@Override
    public void sawOpcode(int seen) {
        int index;

        switch (state) {
            case SEEN_NOTHING:
                if (seen == Const.BIPUSH) {
                    arraySize = getIntConstant();
                    if (arraySize > 0) {
                        state = State.SEEN_ARRAY_SIZE;
                    }
                } else if ((seen >= Const.ICONST_M1) && (seen <= Const.ICONST_5)) {
                    arraySize = seen - Const.ICONST_M1 - 1;
                    if (arraySize > 0) {
                        state = State.SEEN_ARRAY_SIZE;
                    }
                }
            break;

            case SEEN_ARRAY_SIZE:
                if ((seen == Const.ANEWARRAY) || (seen == Const.NEWARRAY)) {
                    state = State.SEEN_NEWARRAY;
                    storeCount = 0;
                } else {
                    state = State.SEEN_NOTHING;
                }
            break;

            case SEEN_NEWARRAY:
                if (seen == Const.DUP) {
                    state = State.SEEN_DUP;
                } else {
                    state = State.SEEN_NOTHING;
                }
            break;

            case SEEN_DUP:
                if (seen == Const.BIPUSH) {
                    index = getIntConstant();
                } else if ((seen >= Const.ICONST_M1) && (seen <= Const.ICONST_5)) {
                    index = seen - Const.ICONST_M1 - 1;
                } else {
                    state = State.SEEN_NOTHING;
                    return;
                }
                if (index != storeCount) {
                    state = State.SEEN_NOTHING;
                } else {
                    state = State.SEEN_INDEX;
                }
            break;

            case SEEN_INDEX:
                if ((seen == Const.LDC) || (seen == Const.LDC_W)) {
                    state = State.SEEN_LDC;
                } else {
                    state = State.SEEN_NOTHING;
                }
            break;

            case SEEN_LDC:
                if ((seen >= Const.IASTORE) && (seen <= Const.SASTORE)) {
                    if ((++storeCount) == arraySize) {
                        state = State.SEEN_INDEX_STORE;
                    } else {
                        state = State.SEEN_NEWARRAY;
                    }
                }
            break;

            case SEEN_INDEX_STORE:
                if (OpcodeUtils.isAStore(seen)) {
                    bugReporter.reportBug(new BugInstance(this, BugType.SACM_STATIC_ARRAY_CREATED_IN_METHOD.name(),
                            (arraySize < 3) ? LOW_PRIORITY : ((arraySize < 10) ? NORMAL_PRIORITY : HIGH_PRIORITY)).addClass(this).addMethod(this)
                                    .addSourceLine(this, getPC()));
                }
                state = State.SEEN_NOTHING;
            break;
        }
    }
517443
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            if (seen == Const.INVOKEVIRTUAL) {
                checkForTailRecursion();
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
1011865
@Override
    public void sawOpcode(final int seen) {
        Object hashCodedStringRef = null;
        try {
            stack.precomputation(this);

            switch (seen) {
                case Const.INVOKEVIRTUAL:
                    if (Values.SLASHED_JAVA_LANG_STRING.equals(getClassConstantOperand())) {
                        String calledMethodName = getNameConstantOperand();
                        String calledMethodSig = getSigConstantOperand();

                        if (("equals".equals(calledMethodName) && SignatureBuilder.SIG_OBJECT_TO_BOOLEAN.equals(calledMethodSig))
                                || ("compareTo".equals(calledMethodName) && SignatureBuilder.SIG_STRING_TO_INT.equals(calledMethodSig))
                                || ("equalsIgnoreCase".equals(calledMethodName) && SignatureBuilder.SIG_STRING_TO_BOOLEAN.equals(calledMethodSig))) {

                            if (stack.getStackDepth() > 0) {
                                OpcodeStack.Item itm = stack.getStackItem(0);
                                Object constant = itm.getConstant();
                                if ((constant != null) && constant.getClass().equals(String.class) && !lookupSwitchOnString()) {
                                    bugReporter.reportBug(new BugInstance(this, "LSC_LITERAL_STRING_COMPARISON", HIGH_PRIORITY) // very
                                                                                                                                // confident
                                            .addClass(this).addMethod(this).addSourceLine(this));
                                }
                            }
                        } else if (Values.HASHCODE.equals(calledMethodName) && (stack.getStackDepth() > 0)) {
                            OpcodeStack.Item item = stack.getStackItem(0);
                            int reg = item.getRegisterNumber();
                            if (reg >= 0) {
                                hashCodedStringRef = String.valueOf(reg);
                            } else {
                                XField xf = item.getXField();
                                if (xf != null) {
                                    hashCodedStringRef = xf.getName();
                                } else {
                                    XMethod xm = item.getReturnValueOf();
                                    if (xm != null) {
                                        hashCodedStringRef = xm.toString();
                                    }
                                }

                            }
                        }
                    }
                break;

                case Const.TABLESWITCH:
                case Const.LOOKUPSWITCH:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        String stringRef = (String) item.getUserValue();
                        if (stringRef != null) {
                            int[] offsets = getSwitchOffsets();
                            BitSet bs = new BitSet();
                            int pc = getPC();
                            for (int offset : offsets) {
                                bs.set(pc + offset);
                            }
                            bs.set(pc + getDefaultSwitchOffset());
                            lookupSwitches.add(new LookupDetails(stringRef, bs));
                        }
                    }
                break;
                default:
                break;
            }

        } finally {
            stack.sawOpcode(this, seen);
            if ((hashCodedStringRef != null) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(hashCodedStringRef);
            }

            if (!lookupSwitches.isEmpty()) {
                int innerMostSwitch = lookupSwitches.size() - 1;
                LookupDetails details = lookupSwitches.get(innerMostSwitch);
                if (details.getSwitchTargets().get(getPC()) && (stack.getStackDepth() > 0)) {
                    OpcodeStack.Item item = stack.getStackItem(0);
                    item.setUserValue(details.getStringReference());
                }

                // previousSetBit is a jdk1.7 api - gonna cheat cause findbugs
                // runs on 1.7
                if (getPC() >= details.getSwitchTargets().previousSetBit(Integer.MAX_VALUE)) {
                    lookupSwitches.remove(innerMostSwitch);
                }
            }
        }
    }
1139135
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            switch (state) {
                case SAW_NOTHING:
                    if (seen == Const.ICONST_0) {
                        state = State.SAW_CONSTANT_0;
                    } else if ((seen >= Const.ICONST_1) && (seen <= Const.ICONST_5)) {
                        state = State.SAW_CONSTANT;
                    } else if ((seen == Const.LDC) || (seen == Const.LDC_W)) {
                        Constant c = getConstantRefOperand();
                        if (c instanceof ConstantInteger) {
                            state = State.SAW_CONSTANT;
                        }
                    }
                break;

                case SAW_CONSTANT_0:
                case SAW_CONSTANT:
                    switch (seen) {
                        case Const.AALOAD:
                            if ("main".equals(this.getMethodName())) {
                                break;
                            }
                            //$FALL-THROUGH$
                        case Const.IALOAD:
                        case Const.LALOAD:
                        case Const.FALOAD:
                        case Const.DALOAD:
                            // case BALOAD: byte and char indexing seems prevalent, and
                            // case CALOAD: usually harmless so ignore
                        case Const.SALOAD:
                            if (stack.getStackDepth() > 1) {
                                OpcodeStack.Item item = stack.getStackItem(1);
                                if (!isArrayFromUbiquitousMethod(item)) {
                                    if (state == State.SAW_CONSTANT_0) {
                                        iConst0Looped.set(getPC());
                                    } else {
                                        bugReporter.reportBug(new BugInstance(this, BugType.CLI_CONSTANT_LIST_INDEX.name(), NORMAL_PRIORITY).addClass(this)
                                                .addMethod(this).addSourceLine(this));
                                    }
                                }
                            }
                        break;

                        case Const.INVOKEVIRTUAL:
                            if (Values.SLASHED_JAVA_UTIL_LIST.equals(getClassConstantOperand())) {
                                String methodName = getNameConstantOperand();
                                if ("get".equals(methodName)) {
                                    if (state == State.SAW_CONSTANT_0) {
                                        iConst0Looped.set(getPC());
                                    } else {
                                        bugReporter.reportBug(new BugInstance(this, BugType.CLI_CONSTANT_LIST_INDEX.name(), NORMAL_PRIORITY).addClass(this)
                                                .addMethod(this).addSourceLine(this));
                                    }
                                }
                            }
                        break;
                        default:
                        break;
                    }
                    state = State.SAW_NOTHING;
                break;
            }

            if (((seen >= Const.IFEQ) && (seen <= Const.GOTO)) || (seen == Const.GOTO_W)) {
                int branchTarget = this.getBranchTarget();
                for (int bugPC = iConst0Looped.nextSetBit(0); bugPC >= 0; bugPC = iConst0Looped.nextSetBit(bugPC + 1)) {
                    if (branchTarget < bugPC) {
                        if ((bugPC - branchTarget) < max_iConst0LoopDistance) {
                            bugReporter.reportBug(new BugInstance(this, BugType.CLI_CONSTANT_LIST_INDEX.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                                    .addSourceLine(this, bugPC));
                        }
                        iConst0Looped.clear(bugPC);
                    }
                }
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
206541
private void sawInitOpcode(int seen) {
        boolean isSyncCollection = false;
        try {
            stack.mergeJumps(this);
            isSyncCollection = isSyncCollectionCreation(seen);
            if (seen == Const.PUTFIELD) {
                processCollectionStore();
            }
        } finally {
            stack.sawOpcode(this, seen);
            if (isSyncCollection && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(Boolean.TRUE);
            }
        }
    }
268794
@Override
	public void sawOpcode(final int seen) {
		try {
			stack.precomputation(this);

			if (seen == Const.INVOKEINTERFACE) {
				processInvokeInterface();
			} else if (seen == Const.INVOKEVIRTUAL) {
				processInvokeVirtual();
			} else if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) {
				OpcodeStack.Item item = stack.getStackItem(0);
				XField field = item.getXField();
				if (field != null) {
					String fieldName = field.getName();
					fieldsReported.remove(fieldName);
					if (fieldsReported.isEmpty()) {
						throw new StopOpcodeParsingException();
					}
				}
			}
		} finally {
			stack.sawOpcode(this, seen);
		}
	}
1272194
@Override
    public void sawOpcode(final int seen) {
        try {
            stack.precomputation(this);

            if (OpcodeUtils.isStandardInvoke(seen)) {
                String calledClass = getDottedClassConstantOperand();

                if (seen == Const.INVOKEINTERFACE) {
                    int parmCount = SignatureUtils.getNumParameters(this.getSigConstantOperand());
                    if (!countClassAccess(parmCount)) {
                        countClassAccess(calledClass);
                    }
                } else {
                    countClassAccess(calledClass);
                }
            } else if (seen == Const.PUTFIELD) {
                countClassAccess(1);
            } else if (seen == Const.GETFIELD) {
                countClassAccess(0);
            } else if ((seen == Const.PUTSTATIC) || (seen == Const.GETSTATIC)) {
                countClassAccess(getDottedClassConstantOperand());
            } else if ((seen == Const.ALOAD_0) && (!methodIsStatic)) {
                countClassAccess(clsName);
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
629932
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            if (seen == Const.INVOKEVIRTUAL) {
                String clsName = getClassConstantOperand();
                if ("java/util/Properties".equals(clsName)) {
                    String methodName = getNameConstantOperand();
                    if ("put".equals(methodName)) {
                        String sig = getSigConstantOperand();
                        if (SignatureBuilder.SIG_TWO_OBJECTS_TO_OBJECT.equals(sig) && (stack.getStackDepth() >= 3)) {
                            OpcodeStack.Item valueItem = stack.getStackItem(0);
                            String valueSig = valueItem.getSignature();
                            if (Values.SIG_JAVA_LANG_STRING.equals(valueSig)) {
                                bugReporter.reportBug(new BugInstance(this, BugType.IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY.name(), LOW_PRIORITY).addClass(this)
                                        .addMethod(this).addSourceLine(this));
                            } else if (Values.SIG_JAVA_LANG_OBJECT.equals(valueSig)) {
                                bugReporter.reportBug(new BugInstance(this, BugType.IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY.name(), NORMAL_PRIORITY)
                                        .addClass(this).addMethod(this).addSourceLine(this));
                            } else {
                                bugReporter.reportBug(new BugInstance(this, BugType.IPU_IMPROPER_PROPERTIES_USE.name(), NORMAL_PRIORITY).addClass(this)
                                        .addMethod(this).addSourceLine(this));
                            }
                        }
                    }
                }
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
1019802
@Override
    public void sawOpcode(int seen) {
        if (state == State.SAW_NOTHING) {
            if (seen == Const.INVOKESPECIAL) {
                state = State.SAW_INVOKESPECIAL;
            }
        } else if (state == State.SAW_INVOKESPECIAL) {
            handleInvokeSpecialState(seen);
        }
    }
152718
@Override
    public void sawOpcode(int seen) {
        try {

            stack.precomputation(this);

            if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                if (item.isNull()) {
                    bugReporter.reportBug(new BugInstance(this, BugType.TBP_TRISTATE_BOOLEAN_PATTERN.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                            .addSourceLine(this));
                    throw new StopOpcodeParsingException();
                }
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
384726
@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            if (unsafeCallOccurred && OpcodeUtils.isAStore(seen)) {
                int storeReg = RegisterUtils.getAStoreReg(this, seen);
                if (storeReg >= 0) {
                    unsafeAliases.set(storeReg);
                }
            }

            if ((seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESPECIAL) || (seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEDYNAMIC)) {
                String methodSig = getSigConstantOperand();

                MethodInfo mi = Statistics.getStatistics().getMethodStatistics(getClassConstantOperand(), getNameConstantOperand(), methodSig);
                if (mi.getModifiesState()) {
                    unsafeCallOccurred = true;
                } else {
                    if (!Values.SIG_VOID.equals(SignatureUtils.getReturnSignature(methodSig))) {
                        int parmCount = SignatureUtils.getNumParameters(methodSig);
                        if (stack.getStackDepth() > parmCount) {
                            OpcodeStack.Item itm = stack.getStackItem(parmCount);
                            unsafeCallOccurred = unsafeAliases.get(itm.getRegisterNumber());
                        } else {
                            unsafeCallOccurred = false;
                        }
                    } else {
                        unsafeCallOccurred = false;
                    }
                }
            } else if (seen == Const.INVOKESTATIC) {
                unsafeCallOccurred = getDottedClassConstantOperand().equals(this.getClassContext().getJavaClass().getClassName());
            } else if (((seen >= Const.IFEQ) && (seen <= Const.GOTO)) || (seen == Const.GOTO_W)) {
                Integer from = Integer.valueOf(getPC());
                Integer to = Integer.valueOf(getBranchTarget());
                branchInfo.put(from, to);
                unsafeCallOccurred = false;
            } else {
                unsafeCallOccurred = false;
            }

            if (seen == Const.MONITORENTER) {
                if (syncPC < 0) {
                    syncPC = getPC();
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        int monitorReg = itm.getRegisterNumber();
                        if (monitorReg >= 0) {
                            unsafeAliases.set(monitorReg);
                        }
                    }
                }
            } else if (seen == Const.MONITOREXIT) {
                syncPC = -1;
            } else if (syncPC >= 0) {
                processSyncBlockInstruction(seen);
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }