@SuppressWarnings("unchecked") protected Map<AnalysisLocal<T>, T> getMap() { Map<?, ?> m = Global.getAnalysisCache().getAnalysisLocals(); return (Map<AnalysisLocal<T>, T>) m; }
@Override public void report() { if (!Analysis.FIND_EFFECTIVE_RELEVANT_QUALIFIERS) { return; } Global.getAnalysisCache().eagerlyPutDatabase(InterproceduralCallGraph.class, callGraph); } }
/** * Get the Subtypes2 inheritance hierarchy database. */ public Subtypes2 getSubtypes2() { return Global.getAnalysisCache().getDatabase(Subtypes2.class); }
public static SourceLineAnnotation fromVisitedInstruction(MethodDescriptor methodDescriptor, int position) { try { IAnalysisCache analysisCache = Global.getAnalysisCache(); JavaClass jclass = analysisCache.getClassAnalysis(JavaClass.class, methodDescriptor.getClassDescriptor()); Method method = analysisCache.getMethodAnalysis(Method.class, methodDescriptor); return fromVisitedInstruction(jclass, method, position); } catch (CheckedAnalysisException e) { return createReallyUnknown(methodDescriptor.getClassDescriptor().toDottedClassName()); } }
static byte[] loadClassData(String name) throws CheckedAnalysisException { ClassDescriptor d = DescriptorFactory.createClassDescriptorFromDottedClassName(name); ClassData data = Global.getAnalysisCache().getClassAnalysis(ClassData.class, d); return data.getData(); } static class Data {
@Override public String toString() { return (isStatic() ? "static " : "") + getClassDescriptor().getDottedClassName() + "." + getName() + " " + getSignature(); }
@Override public void logError(String message) { Global.getAnalysisCache().getErrorLogger().logError(message); }
@Override public void reportMissingClass(ClassDescriptor classDescriptor) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(classDescriptor); }
@Override public void reportSkippedAnalysis(MethodDescriptor method) { Global.getAnalysisCache().getErrorLogger().reportSkippedAnalysis(method); }
public XClass getXClass() throws CheckedAnalysisException { return Global.getAnalysisCache().getClassAnalysis(XClass.class, this); } /**
@Override public String toString() { return (isStatic ? "static " : "") + getClassDescriptor().getDottedClassName() + "." + name + signature; }
/** * Convert this exception to a ClassNotFoundException. This method should * only be called if the ResourceNotFoundException occurs while looking for * a class. The message format is parseable by ClassNotFoundExceptionParser. */ public ClassNotFoundException toClassNotFoundException() { ClassDescriptor classDescriptor = DescriptorFactory.createClassDescriptorFromResourceName(resourceName); return new ClassNotFoundException("ResourceNotFoundException while looking for class " + classDescriptor.toDottedClassName() + ": " + getMessage()); } }
@Override public void registerAnalysisEngines(IAnalysisCache analysisCache) { for (IClassAnalysisEngine<?> engine : classAnalysisEngineList) { engine.registerWith(analysisCache); } for (IMethodAnalysisEngine<?> engine : methodAnalysisEngineList) { engine.registerWith(analysisCache); } } }
public FindUnsatisfiedObligation(BugReporter bugReporter) { this.bugReporter = bugReporter; IAnalysisCache analysisCache = Global.getAnalysisCache(); database = analysisCache.getDatabase(ObligationPolicyDatabase.class); }
@Override public void logError(String message, Throwable e) { Global.getAnalysisCache().getErrorLogger().logError(message, e); }
@Override public void reportMissingClass(ClassNotFoundException ex) { Global.getAnalysisCache().getErrorLogger().reportMissingClass(ex); }
@Override public void registerAnalysisEngines(IAnalysisCache analysisCache) { for (IClassAnalysisEngine<?> engine : classAnalysisEngineList) { engine.registerWith(analysisCache); } for (IMethodAnalysisEngine<?> engine : methodAnalysisEngineList) { engine.registerWith(analysisCache); } } }
/** * @return Returns the database. */ static MethodInfoDatabase getDatabase() { return Global.getAnalysisCache().getDatabase(MethodInfoDatabase.class); } static IdentityHashMap<MethodInfo, Void> getUnconditionalthrowers() {
public FindUselessObjects(BugReporter reporter) { this.reporter = reporter; this.noSideEffectMethods = Global.getAnalysisCache().getDatabase(NoSideEffectMethodsDatabase.class); }
public FindDoubleCheck(BugReporter bugReporter) { this.bugReporter = bugReporter; this.nse = Global.getAnalysisCache().getDatabase(NoSideEffectMethodsDatabase.class); }