Package edu.umd.cs.findbugs.classfile.analysis

Examples of edu.umd.cs.findbugs.classfile.analysis.MethodInfo


    public XFactory() {
    }

    public void intern(XClass c) {
        for (XMethod m : c.getXMethods()) {
            MethodInfo mi = (MethodInfo) m;
            methods.put(mi, mi);
        }
        for (XField f : c.getXFields()) {
            FieldInfo fi = (FieldInfo) f;
            fields.put(fi, fi);
View Full Code Here


                // else
                // System.out.println(slashedClassName+"."+methodName+methodDesc
                // + " is thrower");
            }
            mBuilder.setNumberMethodCalls(methodCallCount);
            MethodInfo methodInfo = mBuilder.build();
            Builder classBuilder = (ClassInfo.Builder) cBuilder;
            if (isBridge && bridgedMethodSignature != null && !bridgedMethodSignature.equals(methodDesc)) {
                classBuilder.addBridgeMethodDescriptor(methodInfo, bridgedMethodSignature);
            } else {
                classBuilder.addMethodDescriptor(methodInfo);
            }

            if (methodInfo.usesConcurrency()) {
                classBuilder.setUsesConcurrency();
            }
            if (methodInfo.isStub()) {
                classBuilder.setHasStubs();
            }
        }
View Full Code Here

    private JumpInfo getJumpInfo() {
        IAnalysisCache analysisCache = Global.getAnalysisCache();
        XMethod xMethod = XFactory.createXMethod(v.getThisClass(), v.getMethod());
        if (xMethod instanceof MethodInfo) {
            MethodInfo mi = (MethodInfo) xMethod;
            if (!mi.hasBackBranch()) {
                return null;
            }
        }
        try {
            return analysisCache.getMethodAnalysis(JumpInfo.class, xMethod.getMethodDescriptor());
View Full Code Here

    }
    private JumpInfoFromStackMap getJumpInfoFromStackMap() {
        IAnalysisCache analysisCache = Global.getAnalysisCache();
        XMethod xMethod = XFactory.createXMethod(v.getThisClass(), v.getMethod());
        if (xMethod instanceof MethodInfo) {
            MethodInfo mi = (MethodInfo) xMethod;
            if (!mi.hasBackBranch()) {
                return null;
            }
        }

        try {
View Full Code Here

            branchAnalysis.setupVisitorForClass(jclass);
            XMethod createXMethod = XFactory.createXMethod(jclass, method);
            if (!(createXMethod instanceof MethodInfo)) {
                return null;
            }
            MethodInfo xMethod = (MethodInfo) createXMethod;

            int iteration = 1;
            OpcodeStack myStack = branchAnalysis.stack;
            /*
            if (false) {
                myStack.learnFrom(myStack.getJumpInfoFromStackMap());
            }
             */
            do {
                if (DEBUG && iteration > 1 ) {
                    System.out.println("Iterative jump info for " + xMethod +", iteration " + iteration);
                    myStack.printJumpEntries();
                    System.out.println();
                }
                // myStack.resetForMethodEntry0(ClassName.toSlashedClassName(jclass.getClassName()), method);
                branchAnalysis.doVisitMethod(method);
                if (xMethod.hasBackBranch() != myStack.backwardsBranch && !myStack.encountedTop) {
                    AnalysisContext.logError(
                            String.format("For %s, mismatch on existence of backedge: %s for precomputation, %s for bytecode analysis",
                                    xMethod, xMethod.hasBackBranch(), myStack.backwardsBranch));
                }
                if (iteration++ > 40) {
                    AnalysisContext.logError("Iterative jump info didn't converge after " + iteration + " iterations in " + xMethod
                            + ", size " + method.getCode().getLength());
                    break;
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.classfile.analysis.MethodInfo

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.