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()); } } public @CheckForNull NullnessAnnotation getDirectAnnotation(Object o) {
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()); } }
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()); } } public @CheckForNull NullnessAnnotation getInheritedAnnotation(XMethod m) {
@Override 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()); } }
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()); } }
public static <E> List<E> sortByCallGraph(Collection<E> elements, OutEdges<E> outEdges) { Profiler profile = Global.getAnalysisCache().getProfiler(); profile.start(TopologicalSort.class); try { SortAlgorithm<E> instance = new Worker2<>(elements, outEdges); return instance.compute(); } finally { profile.end(TopologicalSort.class); } }
@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()); } }
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); } }
public NullnessAnnotation getResolvedAnnotation(final Object o, boolean getMinimal) { Profiler profiler = Global.getAnalysisCache().getProfiler(); profiler.start(this.getClass()); try {
cfg, analysis); Profiler profiler = Global.getAnalysisCache().getProfiler(); profiler.start(resourceTracker.getClass()); try {
ObligationDataflow dataflow = new ObligationDataflow(cfg, analysis); Profiler profiler = analysisCache.getProfiler(); profiler.start(analysis.getClass()); try {
public void execute() { Profiler profiler = Global.getAnalysisCache().getProfiler(); profiler.start(this.getClass()); try {
exceptionSetFactory); TypeDataflow typeDataflow = new TypeDataflow(cfg, typeAnalysis); Profiler profiler = Global.getAnalysisCache().getProfiler(); profiler.start(SpecialTypeAnalysis.class); try {
private void checkCallSitesAndReturnInstructions() { Profiler profiler = Global.getAnalysisCache().getProfiler(); profiler.start(CheckCallSitesAndReturnInstructions.class); try {
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()); } }
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()); } } public @CheckForNull NullnessAnnotation getDirectAnnotation(Object o) {
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()); } } public @CheckForNull NullnessAnnotation getInheritedAnnotation(XMethod m) {
@Override 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()); } }
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); } }
public static <E> List<E> sortByCallGraph(Collection<E> elements, OutEdges<E> outEdges) { Profiler profile = Global.getAnalysisCache().getProfiler(); profile.start(TopologicalSort.class); try { SortAlgorithm<E> instance = new Worker2<E>(elements, outEdges); return instance.compute(); } finally { profile.end(TopologicalSort.class); } }