Package edu.umd.cs.findbugs.ba.obl

Examples of edu.umd.cs.findbugs.ba.obl.StateSet


            //
            // Main loop: looking at the StateSet at the exit block of the CFG,
            // see if there are any states with nonempty obligation sets.
            //
            Map<Obligation, State> leakedObligationMap = new HashMap<Obligation, State>();
            StateSet factAtExit = dataflow.getResultFact(cfg.getExit());
            for (Iterator<State> i = factAtExit.stateIterator(); i.hasNext();) {
                State state = i.next();
                checkStateForLeakedObligations(state, leakedObligationMap);
            }

            //
View Full Code Here


                    // See if the initial instance of the leaked resource
                    // is in the entry fact due to a @WillClose annotation.
                    if (curBlock == cfg.getEntry()) {
                        // Get the entry fact - it should have precisely one
                        // state
                        StateSet entryFact = dataflow.getResultFact(curBlock);
                        Iterator<State> i = entryFact.stateIterator();
                        if (i.hasNext()) {
                            State entryState = i.next();
                            if (entryState.getObligationSet().getCount(obligation.getId()) > 0) {
                                lastSourceLine = SourceLineAnnotation.forFirstLineOfMethod(methodDescriptor);
                                lastSourceLine
View Full Code Here

                    System.out.println("visit edge " + edge);
                }
            }

            private State getTransferState(InstructionHandle handle) {
                StateSet stateSet;
                try {
                    stateSet = dataflow.getFactAtLocation(new Location(handle, curBlock));
                } catch (DataflowAnalysisException e) {
                    bugReporter.logError("Error checking obligation state at " + handle, e);
                    return null;
                }

                List<State> prefixes = stateSet.getPrefixStates(state.getPath());
                if (prefixes.size() != 1) {
                    // Could this happen?
                    if (DEBUG_FP) {
                        System.out.println("at " + handle + " in " + xmethod + " found " + prefixes.size()
                                + " states which are prefixes of error state");
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.obl.StateSet

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.