Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.DetectorFactory$ReflectionDetectorCreator


        html.append("<li>").append(annotation.toString(bugInstance.getPrimaryClass())).append("</li>");
      }
      html.append("</ul>");
    }

    final DetectorFactory detectorFactory = bugInstance.getDetectorFactory();
    if (detectorFactory != null) {
      html.append("<li>");
      html.append(detectorFactory.getShortName());
      html.append(" <font color='gray'>(");
      html.append(DetectorConfiguration.createBugsAbbreviation(detectorFactory));
      html.append(")</font>");
      html.append("</li>");
    }
View Full Code Here


  public void applyDetectors() {
    final DetectorFactoryCollection detectorFactoryCollection = FindBugsPreferences.getDetectorFactorCollection();

    final Iterator<DetectorFactory> iterator = detectorFactoryCollection.factoryIterator();
    while (iterator.hasNext()) {
      final DetectorFactory factory = iterator.next();
      final Plugin plugin = factory.getPlugin();
      final boolean enabledByUser = Boolean.valueOf(getDetectors().get(factory.getShortName()));
      final boolean enable = enabledByUser && plugin.isGloballyEnabled();
      getUserPreferences().enableDetector(factory, enable);
    }

    // DO NOT DO THIS HERE:
View Full Code Here

  public static Map<String, String> getAvailableDetectors(final UserPreferences userPrefs) {
    final Map<String, String> detectorsAvailableList = new HashMap<String, String>();
    //final Map<DetectorFactory, String> factoriesToBugAbbrev = new HashMap<DetectorFactory, String>();
    final Iterator<DetectorFactory> iterator = FindBugsPreferences.getDetectorFactorCollection().factoryIterator();
    while (iterator.hasNext()) {
      final DetectorFactory factory = iterator.next();

      // Only configure non-hidden factories
      /*if (factory.isHidden()) {
        //continue;
      }*/

      detectorsAvailableList.put(factory.getShortName(), String.valueOf(userPrefs.isDetectorEnabled(factory)));
      //addBugsAbbreviation(factory);
    }
    return detectorsAvailableList;
  }
View Full Code Here

        _preferences.setProperty(key, state.getBasePreferences().get(key));
      }

      _preferences.setDetectors(detectors);
      for (final Entry<String, String> entry : detectors.entrySet()) {
        final DetectorFactory detectorFactory = FindBugsPreferences.getDetectorFactorCollection().getFactory(entry.getKey());
        if (detectorFactory != null) {
          _preferences.getUserPreferences().enableDetector(detectorFactory, Boolean.valueOf(entry.getValue()));
        }
      }
View Full Code Here

    if (registrar == null) {
      return;
    }
    if (!SEARCH_INDEX_CREATED.getAndSet(true)) {
      for (final Entry<String, String> entry : _preferences.getDetectors().entrySet()) {
        final DetectorFactory factory = FindBugsPreferences.getDetectorFactorCollection().getFactory(entry.getKey());
        if (factory != null) {
          addToSearchIndex(registrar, factory.getShortName()); // eg: FindFieldSelfAssignment
          final Set<BugPattern> patterns = factory.getReportedBugPatterns();
          for (final BugPattern pattern : patterns) {
            addToSearchIndex(registrar, pattern.getType()); // eg: SA_FIELD_SELF_ASSIGNMENT
          }
        }
      }
View Full Code Here

  int[] getCheckedRows() {
    synchronized (_guardedLock) {
      final int[] result = new int[_entries.size()];
      for (int i = 0; i < _entries.size(); i++) {
        final DetectorFactory entry = _entries.get(i);
        final boolean selected = _preferences.getUserPreferences().isDetectorEnabled(entry);
        if (selected) {
          result[i] = i;
        }
      }
View Full Code Here

      }

      final Map<String, String> detectors = state.getDetectors();
      _preferences.setDetectors(detectors);
      for (final Entry<String, String> entry : detectors.entrySet()) {
        final DetectorFactory detectorFactory = FindBugsPreferences.getDetectorFactorCollection().getFactory(entry.getKey());
        if (detectorFactory != null) {
          _preferences.getUserPreferences().enableDetector(detectorFactory, Boolean.valueOf(entry.getValue()));
        }
      }
View Full Code Here

      _bugPatternModel.addTableModelListener(new TableModelListener() {
        public void tableChanged(final TableModelEvent e) {
          if (e.getColumn() == 0 && TableModelEvent.UPDATE == e.getType()) {
            final List<DetectorFactory> detectorFactoryList = _bugPatternModel.getEntries();
            final DetectorFactory detectorFactory = detectorFactoryList.get(e.getFirstRow());
            updatePreferences(detectorFactory);

            /*if(detectorFactoryList.size() <= getModel().getCheckedEntries().size()) {
              getEnableAllBox().setSelected(true);
            } else {
              getEnableAllBox().setSelected(false);
            }*/
          }
        }
      });

      final ListSelectionModel selectionModel = _detectorsTable.getSelectionModel();
      selectionModel.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(final ListSelectionEvent e) {
          if (!e.getValueIsAdjusting() && _detectorsTable.getSelectedRow() > -1) {
            final int modelIndex = _tableSorter.modelIndex(_detectorsTable.getSelectedRow());
            final DetectorFactory detectorFactory = _bugPatternModel.getEntries().get(modelIndex);
            final String description = getDetailedText(detectorFactory);
            getTextArea().setText(description);
            SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                getTextArea().scrollRectToVisible(new Rectangle(0, 0));
View Full Code Here


  private void populateAvailableRulesTable() {
    final DetectorFactoryCollection detectorFactoryCollection = FindBugsPreferences.getDetectorFactorCollection();
    for (final Entry<String, String> entry : _preferences.getDetectors().entrySet()) {
      final DetectorFactory factory = detectorFactoryCollection.getFactory(entry.getKey());
      if (factory != null) {
        // Only configure non-hidden factories
        if (factory.isHidden() && !getHiddenCheckBox().isSelected()) {
          continue;
        }
        final Plugin plugin = factory.getPlugin();
        if (!plugin.isCorePlugin() && !plugin.isGloballyEnabled()) {
          continue;
        }
        _bugPatternModel.add(factory);
      }
View Full Code Here

    }


    public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
      final int modelIndex = _tableSorter.modelIndex(row);
      final DetectorFactory factory = _model.getEntries().get(modelIndex);
      if (value != null) {
        setText(value.toString());
      }

      if (isSelected) {
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.DetectorFactory$ReflectionDetectorCreator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.