Register the "built-in" analysis engines with given IAnalysisCache.

@param analysisCache
an IAnalysisCache
768890
public static void registerBuiltInAnalysisEngines(IAnalysisCache analysisCache) {
        new edu.umd.cs.findbugs.classfile.engine.EngineRegistrar().registerAnalysisEngines(analysisCache);
        new edu.umd.cs.findbugs.classfile.engine.asm.EngineRegistrar().registerAnalysisEngines(analysisCache);
        new edu.umd.cs.findbugs.classfile.engine.bcel.EngineRegistrar().registerAnalysisEngines(analysisCache);
    }
995433
public static <K, V> void registerCacheObject(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
      //these can change during runtime, so always look it up
      MBeanServer mBeanServer = cache.getMBeanServer();
      if (mBeanServer != null) {
         ObjectName registeredObjectName = calculateObjectName(cache, objectNameType);
         try {
            if (objectNameType.equals(ObjectNameType.CONFIGURATION)) {
               if (!isRegistered(cache, objectNameType)) {
                  SecurityActions.registerMBean(cache.getCacheMXBean(), registeredObjectName, mBeanServer);
               }
            } else if (objectNameType.equals(ObjectNameType.STATISTICS)) {
               if (!isRegistered(cache, objectNameType)) {
                  SecurityActions.registerMBean(cache.getCacheStatisticsMXBean(), registeredObjectName, mBeanServer);
               }
            }
         } catch (Exception e) {
            throw new CacheException("Error registering cache MXBeans for CacheManager "
                  + registeredObjectName + " . Error was " + e.getMessage(), e);
         }
      }
   }
660916
@Override
    public ClassInfo analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor) throws CheckedAnalysisException {

        if (descriptor instanceof ClassInfo) {
            return (ClassInfo) descriptor;
        }
        ClassData classData;
        try {
            classData = analysisCache.getClassAnalysis(ClassData.class, descriptor);
        } catch (edu.umd.cs.findbugs.classfile.MissingClassException e) {
            if (!"package-info".equals(descriptor.getSimpleName())) {
                throw e;
            }

            ClassInfo.Builder builder = new ClassInfo.Builder();
            builder.setClassDescriptor(descriptor);
            builder.setAccessFlags(1536);
            return builder.build();
        }

        // Read the class info

        FBClassReader reader = analysisCache.getClassAnalysis(FBClassReader.class, descriptor);
        ClassParserInterface parser = new ClassParserUsingASM(reader, descriptor, classData.getCodeBaseEntry());

        ClassInfo.Builder classInfoBuilder = new ClassInfo.Builder();
        parser.parse(classInfoBuilder);
        ClassInfo classInfo = classInfoBuilder.build();

        if (!classInfo.getClassDescriptor().equals(descriptor)) {
            throw new ClassNameMismatchException(descriptor, classInfo.getClassDescriptor(), classData.getCodeBaseEntry());
        }
        return classInfo;
    }
288241
@Override
    public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {
        LOGGER.debug("Initializing Central analyzer");
        LOGGER.debug("Central analyzer enabled: {}", isEnabled());
        if (isEnabled()) {
            try {
                searcher = new CentralSearch(getSettings());
            } catch (MalformedURLException ex) {
                setEnabled(false);
                throw new InitializationException("The configured URL to Maven Central is malformed", ex);
            }
        }
    }
1096682
private void injectCache(DoubleConsumer cacheAware) {
      if (cacheAware instanceof CacheAware) {
         ((CacheAware) cacheAware).injectCache(registry.getComponent(Cache.class));
      }
   }
537651
public void analyzeInstruction(Instruction ins) throws DataflowAnalysisException {
        if (frame.isValid()) {
            try {
                ins.accept(this);
            } catch (InvalidBytecodeException e) {
                String message = "Invalid bytecode: could not analyze instr. " + ins + " at frame " + frame;
                throw new DataflowAnalysisException(message, e);
            }
        }
    }
1194369
@Override
    public StoreDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            return null;
        }
        StoreAnalysis analysis = new StoreAnalysis(getDepthFirstSearch(analysisCache, descriptor), getConstantPoolGen(
                analysisCache, descriptor.getClassDescriptor()));
        StoreDataflow dataflow = new StoreDataflow(getCFG(analysisCache, descriptor), analysis);
        dataflow.execute();
        return dataflow;
    }
879767
public void setAnalysisSchemes(java.util.Collection<AnalysisSchemeStatus> analysisSchemes) {
        if (analysisSchemes == null) {
            this.analysisSchemes = null;
            return;
        }

        this.analysisSchemes = new com.amazonaws.internal.SdkInternalList<AnalysisSchemeStatus>(analysisSchemes);
    }
724512
static <K, V> boolean isRegistered(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
      Set<ObjectName> registeredObjectNames;
      MBeanServer mBeanServer = cache.getMBeanServer();

      if (mBeanServer != null) {
         ObjectName objectName = calculateObjectName(cache, objectNameType);
         registeredObjectNames = SecurityActions.queryNames(objectName, null, mBeanServer);

         return !registeredObjectNames.isEmpty();
      } else {
         return false;
      }
   }
1172003
void analyze(final MethodResult methodResult) {
        lock.lock();
        try {
            buildPackagePrefix(methodResult.getParentResource().getOriginalClass());

            determineReturnTypes(methodResult).stream()
                    // FEATURE handle several sub-resource impl's
                    .reduce((l, r) -> JavaUtils.determineMostSpecificType(l, r))
                    .ifPresent(t -> registerSubResourceJob(t, methodResult.getSubResource()));
        } finally {
            lock.unlock();
        }
    }
1152703
@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);
    }
285815
@Override
    public ConstantDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            return null;
        }
        ConstantAnalysis analysis = new ConstantAnalysis(methodGen, getDepthFirstSearch(analysisCache, descriptor));
        ConstantDataflow dataflow = new ConstantDataflow(getCFG(analysisCache, descriptor), analysis);
        dataflow.execute();

        return dataflow;
    }
1071188
@Override
    public CompactLocationNumbering analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor)
            throws CheckedAnalysisException {
        Method method = analysisCache.getMethodAnalysis(Method.class, descriptor);

        if (method.getCode() == null) {
            return null;
        }

        CFG cfg = getCFG(analysisCache, descriptor);
        return new CompactLocationNumbering(cfg);
    }
1009502
@Override
    public ConstantPoolGen analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor) throws CheckedAnalysisException {
        ClassGen classGen = new ClassGen(analysisCache.getClassAnalysis(JavaClass.class, descriptor));
        return classGen.getConstantPool();
    }
873829
protected void clearCaches() {
        DescriptorFactory.clearInstance();
        ObjectTypeFactory.clearInstance();
        TypeQualifierApplications.clearInstance();
        TypeQualifierAnnotation.clearInstance();
        TypeQualifierValue.clearInstance();
        // Make sure the codebases on the classpath are closed
        AnalysisContext.removeCurrentAnalysisContext();
        Global.removeAnalysisCacheForCurrentThread();
        IO.close(classPath);
    }
1372539
private void injectCache(Consumer<? super R> cacheAware) {
      if (cacheAware instanceof CacheAware) {
         ((CacheAware) cacheAware).injectCache(registry.getComponent(Cache.class));
      }
   }
1072545
@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());
        }
    }