Package edu.umd.cs.findbugs.ba.vna

Examples of edu.umd.cs.findbugs.ba.vna.ValueNumber


            // System.out.println("instanceof check for block " +
            // edge.getSource().getId() + " has no value number");
            return tmpFact;
        }

        ValueNumber instanceOfValueNumber = check.getValueNumber();
        ValueNumberFrame vnaFrame = valueNumberDataflow.getStartFact(edge.getTarget());
        if (!vnaFrame.isValid()) {
            return tmpFact;
        }
View Full Code Here


                // instruction,
                // and the type the value was compared to.
                try {
                    ValueNumberFrame vnaFrame = valueNumberDataflow.getFactAtLocation(getLocation());
                    if (vnaFrame.isValid()) {
                        ValueNumber stackValue = vnaFrame.getStackValue(1);
                        if (stackValue.hasFlag(ValueNumber.CONSTANT_CLASS_OBJECT)) {
                            String c = valueNumberDataflow.getClassName(stackValue);
                            if (c != null) {
                                if (c.charAt(0) != '[' && !c.endsWith(";")) {
                                    c = "L" + c.replace('.', '/') + ";";
                                }
View Full Code Here

            if (annotation == NullnessAnnotation.NONNULL) {

                BugAnnotation variableAnnotation = null;
                try {
                    ValueNumberFrame vnaFrame = classContext.getValueNumberDataflow(method).getFactAtLocation(location);
                    ValueNumber valueNumber = vnaFrame.getTopValue();
                    variableAnnotation = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location, valueNumber,
                            vnaFrame, "VALUE_OF");

                } catch (DataflowAnalysisException e) {
                    AnalysisContext.logError("error", e);
View Full Code Here

        IsNullValueFrame frame = invDataflow.getFactAtLocation(location);
        ValueNumberFrame vnaFrame = classContext.getValueNumberDataflow(method).getFactAtLocation(location);
        if (!vnaFrame.isValid()) {
            return;
        }
        ValueNumber valueNumber = vnaFrame.getTopValue();
        if (!frame.isValid()) {
            return;
        }
        IsNullValue tos = frame.getTopValue();
        if (tos.isDefinitelyNull()) {
View Full Code Here

            boolean definitelyNull = definitelyNullArgSet.get(i);

            if (definitelyNull) {
                propertySet.addProperty(NullArgumentWarningProperty.ARG_DEFINITELY_NULL);
            }
            ValueNumber valueNumber = null;
            if (vnaFrame != null) {
                try {
                    valueNumber = vnaFrame.getArgument(instruction, classContext.getConstantPoolGen(), i, sigParser);
                    BugAnnotation variableAnnotation = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location,
                            valueNumber, vnaFrame, "VALUE_OF");
View Full Code Here

                    System.out.println("QQQ dnullArgSet: " + definitelyNullArgSet);
                }
                BugAnnotation variableAnnotation = null;
                try {
                    ValueNumberFrame vnaFrame = classContext.getValueNumberDataflow(method).getFactAtLocation(location);
                    ValueNumber valueNumber = vnaFrame.getArgument(invokeInstruction, cpg, i, sigParser);
                    variableAnnotation = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location, valueNumber,
                            vnaFrame, "VALUE_OF");

                } catch (DataflowAnalysisException e) {
                    AnalysisContext.logError("error", e);
View Full Code Here

            // Get the value number
            ValueNumberFrame vnaFrame = classContext.getValueNumberDataflow(method).getFactAtLocation(location);
            if (vnaFrame.isValid()) {
                Instruction ins = location.getHandle().getInstruction();

                ValueNumber valueNumber = vnaFrame.getInstance(ins, classContext.getConstantPoolGen());
                if (valueNumber.hasFlag(ValueNumber.CONSTANT_CLASS_OBJECT)) {
                    return;
                }
                variableAnnotation = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location, valueNumber, vnaFrame,
                        "VALUE_OF");
                if (variableAnnotation instanceof LocalVariableAnnotation) {
View Full Code Here

            // Get the value number
            ValueNumberFrame vnaFrame = classContext.getValueNumberDataflow(method).getFactAtLocation(location);
            if (vnaFrame.isValid()) {
                Instruction ins = location.getHandle().getInstruction();

                ValueNumber valueNumber = vnaFrame.getInstance(ins, classContext.getConstantPoolGen());
                if (valueNumber.hasFlag(ValueNumber.CONSTANT_CLASS_OBJECT)) {
                    return null;
                }
                variableAnnotation = ValueNumberSourceInfo.findAnnotationFromValueNumber(method, location, valueNumber, vnaFrame,
                        "VALUE_OF");
View Full Code Here

    protected static Variable snarfFieldValue(FieldInstruction fieldIns, ConstantPoolGen cpg, ValueNumberFrame frame)
            throws DataflowAnalysisException {

        if (isLongOrDouble(fieldIns, cpg)) {
            int numSlots = frame.getNumSlots();
            ValueNumber topValue = frame.getValue(numSlots - 1);
            ValueNumber nextValue = frame.getValue(numSlots - 2);
            return new LongOrDoubleLocalVariable(topValue, nextValue);
        } else {
            return new LocalVariable(frame.getTopValue());
        }
View Full Code Here

        }
        if (trackValueNumbers) {
            try {
                ValueNumberFrame vnaFrameAfter = vnaDataflow.getFactAfterLocation(getLocation());
                if (vnaFrameAfter.isValid()) {
                    ValueNumber tosVN = vnaFrameAfter.getTopValue();
                    getFrame().setKnownValue(tosVN, tos);
                }
            } catch (DataflowAnalysisException e) {
                AnalysisContext.logError("error", e);
            }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.vna.ValueNumber

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.