本文整理汇总了Java中edu.umd.cs.findbugs.classfile.IAnalysisCache.getProfiler方法的典型用法代码示例。如果您正苦于以下问题:Java IAnalysisCache.getProfiler方法的具体用法?Java IAnalysisCache.getProfiler怎么用?Java IAnalysisCache.getProfiler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.findbugs.classfile.IAnalysisCache
的用法示例。
在下文中一共展示了IAnalysisCache.getProfiler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import edu.umd.cs.findbugs.classfile.IAnalysisCache; //导入方法依赖的package包/类
public When validate(Object constantValue) {
if (validator == null)
throw new IllegalStateException("No validator");
IAnalysisCache analysisCache = Global.getAnalysisCache();
Profiler profiler = analysisCache.getProfiler();
profiler.start(validator.getClass());
AtomicBoolean performing = performingValidation.get();
try {
if (!performing.compareAndSet(false, true)) {
throw new IllegalStateException("recursive validation");
}
return validator.forConstantValue(proxy, constantValue);
} catch (Exception e) {
AnalysisContext.logError("Error executing custom validator for " + typeQualifier + " " + constantValue, e);
return When.UNKNOWN;
} finally {
if (!performing.compareAndSet(true, false)) {
throw new IllegalStateException("performingValidation not set when validation completes");
}
profiler.end(validator.getClass());
}
}
示例2: analyze
import edu.umd.cs.findbugs.classfile.IAnalysisCache; //导入方法依赖的package包/类
public ObligationDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor methodDescriptor)
throws CheckedAnalysisException {
CFG cfg = analysisCache.getMethodAnalysis(CFG.class, methodDescriptor);
DepthFirstSearch dfs = analysisCache.getMethodAnalysis(DepthFirstSearch.class, methodDescriptor);
XMethod xmethod = XFactory.createXMethod(methodDescriptor);
ConstantPoolGen cpg = analysisCache.getClassAnalysis(ConstantPoolGen.class, methodDescriptor.getClassDescriptor());
ObligationPolicyDatabase database = analysisCache.getDatabase(ObligationPolicyDatabase.class);
TypeDataflow typeDataflow = analysisCache.getMethodAnalysis(TypeDataflow.class, methodDescriptor);
IsNullValueDataflow invDataflow = analysisCache.getMethodAnalysis(IsNullValueDataflow.class, methodDescriptor);
ObligationFactory factory = database.getFactory();
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);
}
return dataflow;
}
示例3: visitClass
import edu.umd.cs.findbugs.classfile.IAnalysisCache; //导入方法依赖的package包/类
public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException {
// 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 {
profiler.end(detector.getClass());
}
}
示例4: validate
import edu.umd.cs.findbugs.classfile.IAnalysisCache; //导入方法依赖的package包/类
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());
}
}