Package edu.umd.cs.findbugs.classfile

Examples of edu.umd.cs.findbugs.classfile.MethodDescriptor


            return null;
        }
        final XMethod xmethod = xclass.findMethod(methodName, desc, false);
        if (xmethod == null) {
            // unable to continue the analysis
            bugReporter.reportSkippedAnalysis(new MethodDescriptor(xclass.getClassDescriptor().getClassName(), methodName, desc,
                    false));
            return null;
        }
        return new DetectorNode(methodAccess, methodName, desc, methodSignature, exceptions, xmethod);
    }
View Full Code Here


            for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) {
                BugInstance warning = i.next();
                MethodAnnotation method = warning.getPrimaryMethod();
                if (method != null) {
                    MethodDescriptor methodDesc = method.toMethodDescriptor();
                    Collection<BugInstance> warnings = warningsByMethod.get(methodDesc);
                    if (warnings == null) {
                        warnings = new LinkedList<BugInstance>();
                        warningsByMethod.put(methodDesc, warnings);
                    }
View Full Code Here

        switch (seen) {
        case Constants.INVOKESTATIC:
        case Constants.INVOKEVIRTUAL:
        case Constants.INVOKEINTERFACE:
        case Constants.INVOKESPECIAL:
            MethodDescriptor called = getMethodDescriptorOperand();
            XMethod calledXMethod = XFactory.createXMethod(called);
            InterproceduralCallGraphVertex calledVertex = findVertex(calledXMethod);
            callGraph.createEdge(currentVertex, calledVertex);
            break;
        default:
View Full Code Here

    }

    private void annotateWarningWithSourceSinkInfo(BugInstance warning, XMethod xMethod, ValueNumber vn,
            SourceSinkInfo sourceSinkInfo) {
        MethodDescriptor methodDescriptor = xMethod.getMethodDescriptor();
        switch (sourceSinkInfo.getType()) {
        case PARAMETER:
            try {
                Method method = Global.getAnalysisCache().getMethodAnalysis(Method.class, methodDescriptor);
                LocalVariableAnnotation lva = LocalVariableAnnotation.getParameterLocalVariableAnnotation(method,
View Full Code Here

            if (m.getCode() == null) {
                continue;
            }
            method = m;

            MethodDescriptor methodDescriptor = BCELUtil.getMethodDescriptor(jclass, method);

            // Try to get MethodGen. If we can't get one,
            // then this method should be skipped.
            MethodGen methodGen = analysisCache.getMethodAnalysis(MethodGen.class, methodDescriptor);
            if (methodGen == null) {
View Full Code Here

    }

    private <Analysis> Analysis getMethodAnalysis(Class<Analysis> analysisClass, Method method) throws DataflowAnalysisException,
    CFGBuilderException {
        try {
            MethodDescriptor methodDescriptor = BCELUtil.getMethodDescriptor(jclass, method);
            return Global.getAnalysisCache().getMethodAnalysis(analysisClass, methodDescriptor);
        } catch (DataflowAnalysisException e) {
            throw e;
        } catch (CFGBuilderException e) {
            throw e;
View Full Code Here

            if (methodName != null && !method.getName().equals(methodName)) {
                continue;
            }

            MethodDescriptor descriptor = DescriptorFactory.instance().getMethodDescriptor(jclass, method);
            MethodGen methodGen = new MethodGen(method, jclass.getClassName(), classGen.getConstantPool());

            CFGBuilder cfgBuilder = new BetterCFGBuilder2(descriptor, methodGen);
            cfgBuilder.build();
View Full Code Here

        // Test dataflow analysis on each method]
        for (XMethod xMethod : classInfo.getXMethods()) {
            if (methodName != null && !methodName.equals(xMethod.getName())) {
                continue;
            }
            MethodDescriptor methodDescriptor = xMethod.getMethodDescriptor();

            System.out.println("-----------------------------------------------------------------");
            System.out.println("Method: " + SignatureConverter.convertMethodSignature(methodDescriptor));
            System.out.println("-----------------------------------------------------------------");
View Full Code Here

        }

    }

    public @CheckForNull MethodAnnotation getMethodCalledAnnotation(ConstantPoolGen cpg, InvokeInstruction inv) {
        MethodDescriptor invokedMethod = getInvokedMethod(cpg, inv);
        boolean standardEquals = invokedMethod.getName().equals("equals")
                && invokedMethod.getSignature().equals("(Ljava/lang/Object;)Z") && !invokedMethod.isStatic();
        return standardEquals ? null : MethodAnnotation.fromMethodDescriptor(invokedMethod);
    }
View Full Code Here

    public MethodDescriptor getInvokedMethod(ConstantPoolGen cpg, InvokeInstruction inv) {
        String invoked = inv.getClassName(cpg);
        String methodName = inv.getMethodName(cpg);
        String methodSig = inv.getSignature(cpg);
        MethodDescriptor invokedMethod =
                DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(invoked), methodName, methodSig, inv instanceof INVOKESTATIC);
        return invokedMethod;
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.classfile.MethodDescriptor

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.