當前位置: 首頁>>代碼示例>>Java>>正文


Java IAnalysisEngine類代碼示例

本文整理匯總了Java中edu.umd.cs.findbugs.classfile.IAnalysisEngine的典型用法代碼示例。如果您正苦於以下問題:Java IAnalysisEngine類的具體用法?Java IAnalysisEngine怎麽用?Java IAnalysisEngine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IAnalysisEngine類屬於edu.umd.cs.findbugs.classfile包,在下文中一共展示了IAnalysisEngine類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMap

import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //導入依賴的package包/類
private static <DescriptorType> Map<DescriptorType, Object> createMap(
        final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
                final Class<?> analysisClass) {
    Map<DescriptorType, Object> descriptorMap;
    // Create a MapCache that allows the analysis engine to
    // decide that analysis results should be retained indefinitely.
    IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
    if (analysisClass.equals(JavaClass.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
    } else if (analysisClass.equals(ConstantPoolGen.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
    } else if (analysisClass.equals(ClassContext.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(10);
    } else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
    } else {
        descriptorMap = new HashMap<DescriptorType, Object>();
    }
    return descriptorMap;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:21,代碼來源:AnalysisCache.java

示例2: createMap

import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //導入依賴的package包/類
private static <DescriptorType> Map<DescriptorType, Object> createMap(
        final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
                final Class<?> analysisClass) {
    Map<DescriptorType, Object> descriptorMap;
    // Create a MapCache that allows the analysis engine to
    // decide that analysis results should be retained indefinitely.
    IAnalysisEngine<DescriptorType, ?> engine = engineMap.get(analysisClass);
    if (analysisClass.equals(JavaClass.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_JAVACLASS_RESULTS_TO_CACHE);
    } else if (analysisClass.equals(FBClassReader.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_FBCLASSREADER_RESULTS_TO_CACHE);
    } else if (analysisClass.equals(ConstantPoolGen.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_CONSTANT_POOL_GEN_RESULTS_TO_CACHE);
    } else if (analysisClass.equals(ClassContext.class)) {
        descriptorMap = new MapCache<DescriptorType, Object>(10);
    } else if (engine instanceof IClassAnalysisEngine && ((IClassAnalysisEngine<?>) engine).canRecompute()) {
        descriptorMap = new MapCache<DescriptorType, Object>(MAX_CLASS_RESULTS_TO_CACHE);
    } else {
        descriptorMap = new HashMap<DescriptorType, Object>();
    }
    return descriptorMap;
}
 
開發者ID:OpenNTF,項目名稱:FindBug-for-Domino-Designer,代碼行數:23,代碼來源:AnalysisCache.java

示例3: findOrCreateDescriptorMap

import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //導入依賴的package包/類
/**
 * Find or create a descriptor to analysis object map.
 *
 * @param <DescriptorType>
 *            type of descriptor used as the map's key type (ClassDescriptor
 *            or MethodDescriptor)
 * @param <E>
 *            type of analysis class
 * @param analysisClassToDescriptorMapMap
 *            analysis class to descriptor map map
 * @param engineMap
 *            analysis class to analysis engine map
 * @param analysisClass
 *            the analysis map
 * @return the descriptor to analysis object map
 */
private static <DescriptorType> Map<DescriptorType, Object> findOrCreateDescriptorMap(
        final Map<Class<?>, Map<DescriptorType, Object>> analysisClassToDescriptorMapMap,
        final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap, 
                final Class<?> analysisClass) {
    Map<DescriptorType, Object> descriptorMap = analysisClassToDescriptorMapMap.get(analysisClass);
    if (descriptorMap == null) {
        descriptorMap = createMap(engineMap, analysisClass);
        analysisClassToDescriptorMapMap.put(analysisClass, descriptorMap);
    }
    return descriptorMap;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:28,代碼來源:AnalysisCache.java

示例4: findOrCreateDescriptorMap

import edu.umd.cs.findbugs.classfile.IAnalysisEngine; //導入依賴的package包/類
/**
 * Find or create a descriptor to analysis object map.
 *
 * @param <DescriptorType>
 *            type of descriptor used as the map's key type (ClassDescriptor
 *            or MethodDescriptor)
 * @param analysisClassToDescriptorMapMap
 *            analysis class to descriptor map map
 * @param engineMap
 *            analysis class to analysis engine map
 * @param analysisClass
 *            the analysis map
 * @return the descriptor to analysis object map
 */
private static <DescriptorType> Map<DescriptorType, Object> findOrCreateDescriptorMap(
        final Map<Class<?>, Map<DescriptorType, Object>> analysisClassToDescriptorMapMap,
        final Map<Class<?>, ? extends IAnalysisEngine<DescriptorType, ?>> engineMap,
                final Class<?> analysisClass) {
    Map<DescriptorType, Object> descriptorMap = analysisClassToDescriptorMapMap.get(analysisClass);
    if (descriptorMap == null) {
        descriptorMap = createMap(engineMap, analysisClass);
        analysisClassToDescriptorMapMap.put(analysisClass, descriptorMap);
    }
    return descriptorMap;
}
 
開發者ID:OpenNTF,項目名稱:FindBug-for-Domino-Designer,代碼行數:26,代碼來源:AnalysisCache.java


注:本文中的edu.umd.cs.findbugs.classfile.IAnalysisEngine類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。