Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.OpcodeStack


        int priority;
        boolean valueIsNull = true;
        String warning;
        int pc = location.getHandle().getPosition();
        OpcodeStack stack = null;
        OpcodeStack.Item item1 = null;

        OpcodeStack.Item item2 = null;
        try {
            stack = OpcodeStackScanner.getStackAt(classContext.getJavaClass(), method, pc);

            item1 = stack.getStackItem(0);
        } catch (RuntimeException e) {
            if (SystemProperties.ASSERTIONS_ENABLED) {
                AnalysisContext.logError("Error getting stack at specific PC", e);
            }
            assert true;
        }
        if (redundantBranch.secondValue == null) {
            if (redundantBranch.firstValue.isDefinitelyNull()) {
                warning = "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE";
                priority = NORMAL_PRIORITY;
            } else {
                warning = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE";
                valueIsNull = false;
                priority = isChecked ? HIGH_PRIORITY : NORMAL_PRIORITY;
            }
            if (infeasibleEdgeSimplyThrowsException) {
                priority++;
            }

        } else {
            if (stack != null) {
                item2 = stack.getStackItem(1);
            }
            boolean bothNull = redundantBranch.firstValue.isDefinitelyNull() && redundantBranch.secondValue.isDefinitelyNull();
            if (redundantBranch.secondValue.isChecked()) {
                isChecked = true;
            }
View Full Code Here


    @Override
    public final void visitCode(Code obj) {
        if (!shouldVisitCode(obj)) {
            return;
        }
        stack = new OpcodeStack();
        stack.resetForMethodEntry(this);
        super.visitCode(obj);
        stack = null;
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.OpcodeStack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.