• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DetectorFactoryCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.umd.cs.findbugs.DetectorFactoryCollection的典型用法代码示例。如果您正苦于以下问题:Java DetectorFactoryCollection类的具体用法?Java DetectorFactoryCollection怎么用?Java DetectorFactoryCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DetectorFactoryCollection类属于edu.umd.cs.findbugs包,在下文中一共展示了DetectorFactoryCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String[] args) throws IOException, DocumentException {
    FindBugs.setNoAnalysis();
    DetectorFactoryCollection.instance();
    ListBugDatabaseInfoCommandLine commandLine = new ListBugDatabaseInfoCommandLine();
    int argCount = commandLine.parse(args, 0, Integer.MAX_VALUE, USAGE);

    PrintWriter out = UTF8.printWriter(System.out, true);
    if (argCount == args.length)
        listVersion(out, null, commandLine.formatDates);
    else {
        out.println("version\ttime\tclasses\tNCSS\terrors\ttotal\thigh\tmedium\tlow\tfile");
        while (argCount < args.length) {
            String fileName = args[argCount++];
            listVersion(out, fileName, commandLine.formatDates);
        }
    }
    out.close();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:19,代码来源:ListBugDatabaseInfo.java


示例2: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    DetectorFactoryCollection.instance(); // load plugins

    Churn churn = new Churn();
    ChurnCommandLine commandLine = churn.new ChurnCommandLine();
    int argCount = commandLine
            .parse(args, 0, 2, "Usage: " + Churn.class.getName() + " [options] [<xml results> [<history]] ");

    SortedBugCollection bugCollection = new SortedBugCollection();
    if (argCount < args.length)
        bugCollection.readXML(args[argCount++]);
    else
        bugCollection.readXML(System.in);
    churn.setBugCollection(bugCollection);
    churn.execute();
    PrintStream out = System.out;
    try {
        if (argCount < args.length) {
            out = UTF8.printStream(new FileOutputStream(args[argCount++]), true);
        }
        churn.dump(out);
    } finally {
        out.close();
    }

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:27,代码来源:Churn.java


示例3: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    FindBugs.setNoAnalysis();
    DetectorFactoryCollection.instance(); // load plugins

    RebornIssues reborn = new RebornIssues();
    CommandLine commandLine = new CommandLine();
    int argCount = commandLine.parse(args, 0, 2, "Usage: " + RebornIssues.class.getName()
            + " [options] [<xml results> [<history]] ");

    SortedBugCollection bugCollection = new SortedBugCollection();
    if (argCount < args.length)
        bugCollection.readXML(args[argCount++]);
    else
        bugCollection.readXML(System.in);
    reborn.setBugCollection(bugCollection);
    reborn.execute();

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:19,代码来源:RebornIssues.java


示例4: getAnalysisOptionProperties

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static ArrayList<String> getAnalysisOptionProperties(boolean ignoreComments, boolean ignoreBlankLines) {
    ArrayList<String> resultList = new ArrayList<String>();
    URL u = DetectorFactoryCollection.getCoreResource("analysisOptions.properties");
    if (u != null) {
        BufferedReader reader = null;
        try {
            reader = UTF8.bufferedReader(u.openStream());
            addCommandLineOptions(resultList, reader, ignoreComments, ignoreBlankLines);
        } catch (IOException e) {
            AnalysisContext.logError("unable to load analysisOptions.properties", e);
        } finally {
            Util.closeSilently(reader);
        }
    }
    return resultList;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:17,代码来源:CommandLine.java


示例5: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String[] argv) throws Exception {
    DetectorFactoryCollection detectorFactoryCollection = DetectorFactoryCollection.instance();

    ExecutionPlan execPlan = new ExecutionPlan();

    for (String pluginId : argv) {
        Plugin plugin = detectorFactoryCollection.getPluginById(pluginId);
        if (plugin != null) {
            execPlan.addPlugin(plugin);
        }
    }

    execPlan.build();

    System.out.println(execPlan.getNumPasses() + " passes in plan");
    execPlan.print();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:18,代码来源:ExecutionPlan.java


示例6: AnalysisRun

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
/**
 * Creates a new instance of AnalysisRun.
 */
public AnalysisRun(Project project, FindBugsFrame frame) {
    this.frame = frame;
    this.logger = frame.getLogger();
    this.reporter = new SwingGUIBugReporter(this);
    this.reporter.setPriorityThreshold(Detector.EXP_PRIORITY);

    // Create IFindBugsEngine
    FindBugs2 engine = new FindBugs2();
    engine.setBugReporter(reporter);
    engine.setProject(project);
    engine.setDetectorFactoryCollection(DetectorFactoryCollection.instance());

    this.findBugs = engine;
    this.treeModelMap = new HashMap<String, DefaultTreeModel>();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:19,代码来源:AnalysisRun.java


示例7: populateTable

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
/**
 * populates the Detector JTable model with all available detectors
 * Due to Netbeans form builder, populate table gets called before the tablesorter is installed,
 * so it is correct for the model retrieved from the table to be assumed to be the base DefaultTableModel.
 */
private void populateTable() {
    Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
    while (i.hasNext()) {
        DetectorFactory factory = i.next();
        if (factory.isHidden())
            continue;
        DefaultTableModel model = (DefaultTableModel) detectorTable.getModel();
        model.addRow(new Object[]{
                factory.getShortName(),
                factory.getSpeed(),
                UserPreferences.getUserPreferences().isDetectorEnabled(factory)
                    ? Boolean.TRUE : Boolean.FALSE
                });
        factoryList.add(factory);
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:22,代码来源:ConfigureDetectorsDialog.java


示例8: changeClicked

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
protected void changeClicked() {
    final List<CloudPlugin> plugins = new ArrayList<CloudPlugin>();
    final List<String> descriptions = new ArrayList<String>();
    List<CloudPlugin> clouds = new ArrayList<CloudPlugin>(DetectorFactoryCollection.instance().getRegisteredClouds().values());
    Collections.sort(clouds, new Comparator<CloudPlugin>() {
        public int compare(CloudPlugin o1, CloudPlugin o2) {
            return o1.getDescription().compareToIgnoreCase(o2.getDescription());
        }
    });
    for (final CloudPlugin plugin : clouds) {
        final boolean disabled = isDisabled(plugin);
        if (!disabled && !plugin.isHidden()) {
            descriptions.add(plugin.getDescription());
            plugins.add(plugin);
        }
    }
    showCloudChooser(plugins, descriptions);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:19,代码来源:CloudCommentsPane.java


示例9: getPatternDetails

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
private String getPatternDetails() {
    if (pattern == null) {
        return "";
    }
    StringBuilder sb = new StringBuilder("<b>Pattern</b>: ");
    sb.append(pattern.getType());
    sb.append("\n<br><b>Type</b>: ").append(pattern.getAbbrev()).append(", <b>Category</b>: ");
    sb.append(pattern.getCategory());
    BugCategory category = DetectorFactoryCollection.instance().getBugCategory(pattern.getCategory());
    if(category != null) {
        sb.append(" (");
        sb.append(category.getShortDescription());
        sb.append(")");
    }
    return sb.toString();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:17,代码来源:BugInfoView.java


示例10: refreshTitle

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
private void refreshTitle() {
    if (marker != null) {
        String bugType = marker.getAttribute(FindBugsMarker.BUG_TYPE, "");
        pattern = DetectorFactoryCollection.instance().lookupBugPattern(bugType);
    }
    if (pattern == null) {
        return;
    }
    if (bug == null) {
        return;
    }
    if(file != null) {
        setContentDescription(file.getName() +
                ": " + marker.getAttribute(IMarker.LINE_NUMBER, 0));
    } else {
        setContentDescription("");
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:19,代码来源:BugInfoView.java


示例11: setDetector

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
/**
 * Enables or disables a detector. This can only disable an entire detector (class-level),
 * not just one bug pattern.
 * 
 * @param dotSeperatedDetectorClass
 *            A string with the dot-separated-class of the detector to enable/disable
 * @param enabled
 */
protected void setDetector(String dotSeperatedDetectorClass, boolean enabled) {
    DetectorFactory factory = DetectorFactoryCollection.instance().getFactoryByClassName(dotSeperatedDetectorClass);
    if (factory == null) {
        if (enabled) {
            fail("Could not find a detector with class " + dotSeperatedDetectorClass);
        } else {
            System.err.println("Could not find a detector with class " + dotSeperatedDetectorClass);
        }
        return;
    }
    if (!enabled) {
        detectorsToReenable.add(dotSeperatedDetectorClass);
    }
    FindbugsPlugin.getUserPreferences(testIProject).enableDetector(factory, enabled);
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:24,代码来源:TestHarness.java


示例12: loadUserDetectorPreferences

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public void loadUserDetectorPreferences() {
	Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
	while (i.hasNext()) {
		DetectorFactory factory = i.next();
		Boolean enabled = detectorStateList.get(factory.getShortName());
		if (enabled != null)
			factory.setEnabled(enabled.booleanValue());
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:UserPreferences.java


示例13: storeUserDetectorPreferences

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public void storeUserDetectorPreferences() {
	detectorStateList.clear();
	Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
	while (i.hasNext()) {
		DetectorFactory factory = i.next();
		detectorStateList.put(factory.getShortName(), Boolean.valueOf(factory.isEnabled()));
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:UserPreferences.java


示例14: restoreDefaultsButtonActionPerformed

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
/**
 * reverts the selected state of all the detectors to their defaults as specified in the findbugs.xml file
 *
 * @param evt the swing event corresponding to the mouse click of the Restore Defaults button
 */
private void restoreDefaultsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_restoreDefaultsButtonActionPerformed
	Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
	DefaultSortedTableModel sorter = (DefaultSortedTableModel) detectorTable.getModel();
	TableModel model = sorter.getBaseTableModel();
	int row = 0;
	while (i.hasNext()) {
		DetectorFactory factory = i.next();
		model.setValueAt(factory.isDefaultEnabled() ? Boolean.TRUE : Boolean.FALSE, row++, ENABLED_COLUMN);
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:ConfigureDetectorsDialog.java


示例15: populateTable

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
/**
 * populates the Detector JTable model with all available detectors
 * Due to Netbeans form builder, populate table gets called before the tablesorter is installed, 
 * so it is correct for the model retrieved from the table to be assumed to be the base DefaultTableModel.
 */
private void populateTable() {
	Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
	while (i.hasNext()) {
		DetectorFactory factory = i.next();
		DefaultTableModel model = (DefaultTableModel) detectorTable.getModel();
		model.addRow(new Object[]{factory.getShortName(), factory.getSpeed(), Boolean.valueOf(factory.isEnabled())});
		factoryList.add(factory);
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:ConfigureDetectorsDialog.java


示例16: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	int argCount = 0;

	if (argCount < args.length && args[argCount].equals("-unabridged")) {
		++argCount;
		// Unabridged mode: emit all warnings reported by at least one
		// detector, even for disabled detectors.
		DetectorFactoryCollection factories = DetectorFactoryCollection.instance();
		factories.enableAll();
	}

	String docTitle = "FindBugs Bug Descriptions";
	if (argCount < args.length) {
		docTitle = args[argCount++];
	}
	PrettyPrintBugDescriptions pp = new PrettyPrintBugDescriptions(docTitle, System.out);
	if (argCount < args.length) {
		pp.setHeaderText(args[argCount++]);
	}
	if (argCount < args.length) {
		pp.setBeginBodyText(args[argCount++]);
	}
	if (argCount < args.length) {
		pp.setPrologueText(args[argCount++]);
	}
	if (argCount < args.length) {
		pp.setEndBodyText(args[argCount++]);
	}
	pp.print();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:31,代码来源:PrettyPrintBugDescriptions.java


示例17: main

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
    FindBugs.setNoAnalysis();
    DetectorFactoryCollection dfc = DetectorFactoryCollection.instance();
    UpdateChecker checker = dfc.getUpdateChecker();
    if (checker.updateChecksGloballyDisabled())
        System.out.println("Update checkes are globally disabled");
    URI redirect = checker.getRedirectURL(false);
    if (redirect != null)
        System.out.println("All update checks redirected to " + redirect);
    checker.writeXml(System.out, dfc.plugins(), "UpdateChecker");
    
    
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:14,代码来源:UpdateChecker.java


示例18: countWarnings

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
private static Collection<SourceLineAnnotation> countWarnings( Collection<BugInstance> warnings,
        @CheckForNull String bugCode,
        int desiredPriority, int rank) {
    Collection<SourceLineAnnotation> matching = new HashSet<SourceLineAnnotation>();
    DetectorFactoryCollection i18n = DetectorFactoryCollection.instance();
    boolean matchPattern = false;
    try {
        i18n.getBugCode(bugCode);
    } catch (IllegalArgumentException e) {
        matchPattern = true;
    }

    if (warnings != null) {
        for (BugInstance warning : warnings) {
            if (warning.getPriority() > desiredPriority)
                continue;
            if (warning.getBugRank() > rank)
                continue;
            if (bugCode == null) {
                matching.add(warning.getPrimarySourceLineAnnotation());
                continue;
            }
            BugPattern pattern = warning.getBugPattern();
            String match;
            if (matchPattern)
                match = pattern.getType();
            else
                match = pattern.getAbbrev();
            if (match.equals(bugCode)) {
                matching.add(warning.getPrimarySourceLineAnnotation());
            }
        }
    }
    return matching;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:36,代码来源:CheckExpectedWarnings.java


示例19: finishPass

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public void finishPass() {
    HashSet<BugPattern> claimedReported = new HashSet<BugPattern>();
    for (DetectorFactory d : DetectorFactoryCollection.instance().getFactories())
        claimedReported.addAll(d.getReportedBugPatterns());
    for (BugPattern b : DetectorFactoryCollection.instance().getBugPatterns()) {
        String category = b.getCategory();
        if (!b.isDeprecated() && !category.equals("EXPERIMENTAL") && !claimedReported.contains(b))
            AnalysisContext.logError("No detector claims " + b.getType());
    }

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:12,代码来源:CheckExpectedWarnings.java


示例20: SuppressionDecorator

import edu.umd.cs.findbugs.DetectorFactoryCollection; //导入依赖的package包/类
public SuppressionDecorator(ComponentPlugin<BugReporterDecorator> plugin, BugReporter delegate) {
    super(plugin, delegate);
    category = plugin.getProperties().getProperty("category");
    if (DetectorFactoryCollection.instance().getBugCategory(category) == null) {
        throw new IllegalArgumentException("Unable to find category " + category);
    }

    final String adjustmentSource = plugin.getProperties().getProperty("packageSource");
    String packageList = plugin.getProperties().getProperty("packageList");

    try {
        if (packageList != null) {
            processPackageList(new StringReader(packageList));
        }
        if (adjustmentSource != null) {
            URL u;

            if (adjustmentSource.startsWith("file:") || adjustmentSource.startsWith("http:")
                    || adjustmentSource.startsWith("https:"))
                u = new URL(adjustmentSource);
            else {
                u = plugin.getPlugin().getResource(adjustmentSource);
                if (u == null)
                    u = DetectorFactoryCollection.getCoreResource(adjustmentSource);

            }
            if (u != null) {
                Reader rawIn =  UserTextFile.bufferedReader(u.openStream());
                processPackageList(rawIn);
            }

        }
    } catch (IOException e) {
        throw new RuntimeException("Unable to load " + category + " filters from " + adjustmentSource, e);
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:37,代码来源:SuppressionDecorator.java



注:本文中的edu.umd.cs.findbugs.DetectorFactoryCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AudioRenderer类代码示例发布时间:2022-05-22
下一篇:
Java XQPreparedExpression类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap