Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.ClassContext


     */
    @Override
    public UsagesRequiringNonNullValues analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor)
            throws CheckedAnalysisException {
        // ClassContext classContext = getClassContext(jclass);
        ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, descriptor.getClassDescriptor());
        Method method = getMethod(analysisCache, descriptor);
        return DerefFinder.getAnalysis(classContext, method);
    }
View Full Code Here


     */
    @Override
    public ClassContext analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor) throws CheckedAnalysisException {

        JavaClass javaClass = analysisCache.getClassAnalysis(JavaClass.class, descriptor);
        ClassContext classContext = new ClassContext(javaClass, AnalysisContext.currentAnalysisContext());
        return classContext;
    }
View Full Code Here

     */
    @Nonnull
    public BugInstance addSourceLine(MethodDescriptor methodDescriptor, Location location) {
        try {
            IAnalysisCache analysisCache = Global.getAnalysisCache();
            ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, methodDescriptor.getClassDescriptor());
            Method method = analysisCache.getMethodAnalysis(Method.class, methodDescriptor);
            return addSourceLine(classContext, method, location);
        } catch (CheckedAnalysisException e) {
            return addSourceLine(SourceLineAnnotation.createReallyUnknown(methodDescriptor.getClassDescriptor()
                    .toDottedClassName()));
View Full Code Here

    }

    @Override
    public <E> E getMethodAnalysis(Class<E> analysisClass, @Nonnull MethodDescriptor methodDescriptor) throws CheckedAnalysisException {
        requireNonNull(methodDescriptor, "methodDescriptor is null");
        ClassContext classContext = getClassAnalysis(ClassContext.class, methodDescriptor.getClassDescriptor());
        Object object = classContext.getMethodAnalysis(analysisClass, methodDescriptor);

        if (object == null) {
            try {
                object = analyzeMethod(classContext, analysisClass, methodDescriptor);
                if (object == null) {
                    object = NULL_ANALYSIS_RESULT;
                }
            } catch (RuntimeException e) {
                object = new AbnormalAnalysisResult(e);
            } catch (CheckedAnalysisException e) {
                object = new AbnormalAnalysisResult(e);
            }

            classContext.putMethodAnalysis(analysisClass, methodDescriptor, object);

        }
        if (Debug.VERIFY_INTEGRITY && object == null) {
            throw new IllegalStateException("AnalysisFactory failed to produce a result object");
        }
View Full Code Here

    }

    @Override
    public <E> void eagerlyPutMethodAnalysis(Class<E> analysisClass, @Nonnull MethodDescriptor methodDescriptor, E analysisObject) {
        try {
            ClassContext classContext = getClassAnalysis(ClassContext.class, methodDescriptor.getClassDescriptor());
            assert analysisClass.isInstance(analysisObject);
            classContext.putMethodAnalysis(analysisClass, methodDescriptor, analysisObject);
        } catch (CheckedAnalysisException e) {
            IllegalStateException ise = new IllegalStateException("Unexpected exception adding method analysis to cache");
            ise.initCause(e);
            throw ise;
        }
View Full Code Here

    @Override
    public void purgeMethodAnalyses(@Nonnull MethodDescriptor methodDescriptor) {
        try {

            ClassContext classContext = getClassAnalysis(ClassContext.class, methodDescriptor.getClassDescriptor());
            classContext.purgeMethodAnalyses(methodDescriptor);
        } catch (CheckedAnalysisException e) {
            IllegalStateException ise = new IllegalStateException("Unexpected exception purging method analyses from cache");
            ise.initCause(e);
            throw ise;
        }
View Full Code Here

                try {
                    IAnalysisCache analysisCache = Global.getAnalysisCache();

                    ClassDescriptor c = DescriptorFactory.createClassDescriptor(obj);

                    ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, c);
                    didInCallOrder = true;
                    for (Method m : classContext.getMethodsInCallOrder()) {
                        doVisitMethod(m);
                    }

                } catch (CheckedAnalysisException e) {
                    AnalysisContext.logError("Error trying to visit methods in order", e);
View Full Code Here

        // Just get the ClassContext from the analysis cache
        // and apply the detector to it.

        IAnalysisCache analysisCache = Global.getAnalysisCache();
        ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, classDescriptor);
        Profiler profiler = analysisCache.getProfiler();
        profiler.start(detector.getClass());
        try {
            detector.visitClassContext(classContext);
        } finally {
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.ClassContext

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.