Examples of Profiler


Examples of edu.umd.cs.findbugs.log.Profiler

        ObligationAnalysis analysis = new ObligationAnalysis(dfs, xmethod, cpg, factory, database, typeDataflow, invDataflow,
                analysisCache.getErrorLogger());
        ObligationDataflow dataflow = new ObligationDataflow(cfg, analysis);

        Profiler profiler = analysisCache.getProfiler();
        profiler.start(analysis.getClass());
        try {
            dataflow.execute();
        } finally {
            profiler.end(analysis.getClass());
        }

        if (DEBUG_PRINTCFG) {
            System.out.println("Dataflow CFG:");
            DataflowCFGPrinter.printCFG(dataflow, System.out);
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

* @author pugh
*/
public class ZipCodeBaseFactory {

    public static AbstractScannableCodeBase makeZipCodeBase(ICodeBaseLocator codeBaseLocator, File file) throws IOException {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(ZipCodeBaseFactory.class);
        try {
            return new ZipFileCodeBase(codeBaseLocator, file);
        } catch (ZipException e) {
            // May be too many zip entries
            return new ZipInputStreamCodeBase(codeBaseLocator, file);
        } finally {
            profiler.end(ZipCodeBaseFactory.class);
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

            IAnalysisEngine<ClassDescriptor, E> engine = (IAnalysisEngine<ClassDescriptor, E>) classAnalysisEngineMap
                    .get(analysisClass);
            if (engine == null) {
                throw new IllegalArgumentException("No analysis engine registered to produce " + analysisClass.getName());
            }
            Profiler profiler = getProfiler();
            // Perform the analysis
            try {
                profiler.start(engine.getClass());
                analysisResult = engine.analyze(this, classDescriptor);

                // If engine returned null, we need to construct
                // an AbnormalAnalysisResult object to record that fact.
                // Otherwise we will try to recompute the value in
                // the future.
                if (analysisResult == null) {
                    analysisResult = NULL_ANALYSIS_RESULT;
                }
            } catch (CheckedAnalysisException e) {
                // Exception - make note
                // Andrei: e.getStackTrace() cannot be null, but getter clones
                // the stack...
                // if (e.getStackTrace() == null)
                // e.fillInStackTrace();
                analysisResult = new AbnormalAnalysisResult(e);
            } catch (RuntimeException e) {
                // Exception - make note
                // Andrei: e.getStackTrace() cannot be null, but getter clones
                // the stack...
                // if (e.getStackTrace() == null)
                // e.fillInStackTrace();
                analysisResult = new AbnormalAnalysisResult(e);
            } finally {
                profiler.end(engine.getClass());
            }

            // Save the result
            descriptorMap.put(classDescriptor, analysisResult);
        }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

            throws CheckedAnalysisException {
        IMethodAnalysisEngine<E> engine = (IMethodAnalysisEngine<E>) methodAnalysisEngineMap.get(analysisClass);
        if (engine == null) {
            throw new IllegalArgumentException("No analysis engine registered to produce " + analysisClass.getName());
        }
        Profiler profiler = getProfiler();
        profiler.start(engine.getClass());
        try {
            return engine.analyze(this, methodDescriptor);
        } finally {
            profiler.end(engine.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

        this.nonnullTypeQualifierValue = TypeQualifierValue.getValue(javax.annotation.Nonnull.class, null);
    }

    @Override
    public NullnessAnnotation getResolvedAnnotation(Object o, boolean getMinimal) {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(this.getClass());
        try {

            if (DEBUG) {
                System.out.println("getResolvedAnnotation: o=" + o + "...");
            }

            TypeQualifierAnnotation tqa = null;

            if (o instanceof XMethodParameter) {
                XMethodParameter param = (XMethodParameter) o;

                tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(param.getMethod(),
                        param.getParameterNumber(), nonnullTypeQualifierValue);
            } else if (o instanceof XMethod || o instanceof XField) {
                tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation((AnnotatedObject) o,
                        nonnullTypeQualifierValue);
            }

            NullnessAnnotation result = toNullnessAnnotation(tqa);
            if (DEBUG) {
                if (result == null) {
                    System.out.println("   ===> not found");
                } else {
                    System.out.println("   ===> " + tqa + "/" + result.toString() );
                }
            }
            return result;
        } finally {
            profiler.end(this.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

            profiler.end(this.getClass());
        }
    }

    public @CheckForNull NullnessAnnotation getInheritedAnnotation(XMethod m, int parameter) {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(this.getClass());
        try {
            TypeQualifierAnnotation tqa
            = TypeQualifierApplications.getInheritedTypeQualifierAnnotation(m,
                    parameter, nonnullTypeQualifierValue);
            NullnessAnnotation result = toNullnessAnnotation(tqa);
            return result;
        } finally {
            profiler.end(this.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

        } finally {
            profiler.end(this.getClass());
        }
    }
    public @CheckForNull NullnessAnnotation getInheritedAnnotation(XMethod m) {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(this.getClass());
        try {
            TypeQualifierAnnotation tqa
            = TypeQualifierApplications.getInheritedTypeQualifierAnnotation(m, nonnullTypeQualifierValue);
            NullnessAnnotation result = toNullnessAnnotation(tqa);
            return result;
        } finally {
            profiler.end(this.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

        } finally {
            profiler.end(this.getClass());
        }
    }
    public @CheckForNull NullnessAnnotation getDirectAnnotation(Object o) {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(this.getClass());
        try {

            if (DEBUG) {
                System.out.println("getDirectAnnotation: o=" + o + "...");
            }

            TypeQualifierAnnotation tqa = null;

            if (o instanceof XMethodParameter) {
                XMethodParameter param = (XMethodParameter) o;
                tqa = TypeQualifierApplications.getDirectTypeQualifierAnnotation(param.getMethod(),
                        param.getParameterNumber(), nonnullTypeQualifierValue);
            } else if (o instanceof XMethod || o instanceof XField) {
                tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation((AnnotatedObject) o,
                        nonnullTypeQualifierValue);
            }

            NullnessAnnotation result = toNullnessAnnotation(tqa);
            if (DEBUG) {
                if (result == null) {
                    System.out.println("   ===> not found");
                } else {
                    System.out.println("   ===> " + tqa + "/" + result.toString() );
                }
            }
            return result;
        } finally {
            profiler.end(this.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

    public When validate(@CheckForNull Object constantValue) {
        if (validator == null) {
            throw new IllegalStateException("No validator");
        }
        IAnalysisCache analysisCache = Global.getAnalysisCache();
        Profiler profiler = analysisCache.getProfiler();
        profiler.start(validator.getClass());
        try {
            return ValidationSecurityManager.sandboxedValidation(proxy, validator, constantValue);
        } catch (Exception e) {
            AnalysisContext.logError("Error executing custom validator for " + typeQualifier + " " + constantValue, e);
            return When.UNKNOWN;
        } finally {
            profiler.end(validator.getClass());
        }
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.log.Profiler

        this.undeterminedBranchSet = new BitSet();
        this.assertionMethods = classContext.getAssertionMethods();
    }

    public void execute() {
        Profiler profiler = Global.getAnalysisCache().getProfiler();
        profiler.start(this.getClass());
        try {
            // Do the null-value analysis
            this.invDataflow = classContext.getIsNullValueDataflow(method);
            this.vnaDataflow = classContext.getValueNumberDataflow(method);
            if (findGuaranteedDerefs) {
                if (DEBUG_DEREFS) {
                    System.out.println("Checking for guaranteed derefs in "
                            + classContext.getClassDescriptor().getDottedClassName() + "." + method.getName()
                            + method.getSignature());
                }
                this.uvdDataflow = classContext.getUnconditionalValueDerefDataflow(method);
            }

            // Check method and report potential null derefs and
            // redundant null comparisons.
            examineBasicBlocks();
            if (findGuaranteedDerefs) {
                examineNullValues();
            }
            examineRedundantBranches();
        } catch (MissingClassException e) {
            AnalysisContext.reportMissingClass(e.getClassNotFoundException());
        } catch (CheckedAnalysisException e) {
            AnalysisContext.logError("Error while checking guaranteed derefs in "
                    + classContext.getClassDescriptor().getDottedClassName() + "." + method.getName() + method.getSignature(), e);
        } finally {
            profiler.end(this.getClass());
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.