Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.CallGraph


        // Set<Method> publicReachableMethods;
        Set<Method> allMethods = new HashSet<Method>(Arrays.asList(javaClass.getMethods()));

        try {
            selfCalls.execute();
            CallGraph callGraph = selfCalls.getCallGraph();
            if (DEBUG) {
                System.out.println("Call graph (not unlocked methods): " + callGraph.getNumVertices() + " nodes, "
                        + callGraph.getNumEdges() + " edges");
            }
            // Find call edges that are obviously locked
            Set<CallSite> obviouslyLockedSites = findObviouslyLockedCallSites(classContext, selfCalls);
            lockedMethodSet = findNotUnlockedMethods(classContext, selfCalls, obviouslyLockedSites);
            lockedMethodSet.retainAll(findLockedMethods(classContext, selfCalls, obviouslyLockedSites));
View Full Code Here


    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume no methods are called from an
        // unlocked context
        Set<Method> lockedMethodSet = new HashSet<Method>();
        lockedMethodSet.addAll(Arrays.asList(methodList));

        // Assume all public methods are called from
        // unlocked context
        for (Method method : methodList) {
            if (method.isPublic() && !isConstructor(method.getName())) {
                lockedMethodSet.remove(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                // Ignore obviously locked edges
                if (obviouslyLockedSites.contains(callSite)) {
View Full Code Here

    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume all methods are locked
        Set<Method> lockedMethodSet = new HashSet<Method>();

        // Assume all public methods are unlocked
        for (Method method : methodList) {
            if (method.isSynchronized()) {
                lockedMethodSet.add(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) {
                    // Calling method is locked, so the called method
View Full Code Here

TOP

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

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.