public BugCategory addOrCreateBugCategory(String id) { BugCategory c = bugCategories.get(id); if (c != null) { return c; } c = new BugCategory(id); bugCategories.put(id, c); return c; }
private void addCategoryKey(String argument) { DetectorFactoryCollection i18n = DetectorFactoryCollection.instance(); for (String x : argument.split("[,|]")) { for (BugCategory category : i18n.getBugCategoryObjects()) { if (category.getAbbrev().equals(x) || category.getCategory().equals(x)) { this.categoryKey.add(category.getCategory()); break; } } } }
/** * Get the description of a bug category. Returns the category if no * description can be found. * * @param category * the category * @return the description of the category */ public String getBugCategoryDescription(String category) { BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); return (bc != null ? bc.getShortDescription() : category); } }
/** * Get a Collection containing all known bug category keys. E.g., * "CORRECTNESS", "MT_CORRECTNESS", "PERFORMANCE", etc. * * Excludes hidden bug categories * * @return Collection of bug category keys. */ public Collection<String> getBugCategories() { ArrayList<String> result = new ArrayList<>(categoryDescriptionMap.size()); for(BugCategory c : categoryDescriptionMap.values()) { if (!c.isHidden()) { result.add(c.getCategory()); } } return result; }
bc.setHidden(hidden); bc.setShortDescription(shortDesc); try { String abbrev = getChildText(categoryNode, "Abbreviation"); if (bc.getAbbrev() == null) { bc.setAbbrev(abbrev); if (DEBUG) { System.out.println("category " + key + " abbrev -> " + abbrev); System.out.println("rejected abbrev '" + abbrev + "' for category " + key + ": " + bc.getAbbrev()); if (bc.getDetailText() == null) { bc.setDetailText(details); if (DEBUG) { System.out.println("category " + key + " details -> " + details); System.out.println("rejected details [" + details + "] for category " + key + ": [" + bc.getDetailText() + ']');
/** * Add BugCategory elements. * * @param bugCategorySet * all bug categories referenced in the BugCollection */ private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.addElement("Description"); description.setText(I18N.instance().getBugCategoryDescription(category)); BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); if (bc != null) { // shouldn't be null String s = bc.getAbbrev(); if (s != null) { Element abbrev = element.addElement("Abbreviation"); abbrev.setText(s); } s = bc.getDetailText(); if (s != null) { Element details = element.addElement("Details"); details.setText(s); } } } }
protected boolean unRegisterBugCategory(BugCategory bc) { String category = bc.getCategory(); categoryDescriptionMap.remove(category); return true; }
public String getCategoryAbbrev() { String categoryAbbrev = null; BugCategory bcat = DetectorFactoryCollection.instance().getBugCategory(getCategory()); if (bcat != null) { categoryAbbrev = bcat.getAbbrev(); } if (categoryAbbrev == null) { categoryAbbrev = TextUIBugReporter.OTHER_CATEGORY_ABBREV; } return categoryAbbrev; }
bc.setHidden(hidden); bc.setShortDescription(shortDesc); try { String abbrev = getChildText(categoryNode, "Abbreviation"); if (bc.getAbbrev() == null) { bc.setAbbrev(abbrev); if (DEBUG) { System.out.println("category " + key + " abbrev -> " + abbrev); System.out.println("rejected abbrev '" + abbrev + "' for category " + key + ": " + bc.getAbbrev()); if (bc.getDetailText() == null) { bc.setDetailText(details); if (DEBUG) { System.out.println("category " + key + " details -> " + details); System.out.println("rejected details [" + details + "] for category " + key + ": [" + bc.getDetailText() + ']');
/** * Get a Collection containing all known bug category keys. E.g., * "CORRECTNESS", "MT_CORRECTNESS", "PERFORMANCE", etc. * * Excludes hidden bug categories * * @return Collection of bug category keys. */ public Collection<String> getBugCategories() { ArrayList<String> result = new ArrayList<String>(categoryDescriptionMap.size()); for(BugCategory c : categoryDescriptionMap.values()) { if (!c.isHidden()) { result.add(c.getCategory()); } } return result; }
/** * Add BugCategory elements. * * @param bugCategorySet * all bug categories referenced in the BugCollection */ private void addBugCategories(Set<String> bugCategorySet) { Element root = document.getRootElement(); for (String category : bugCategorySet) { Element element = root.addElement("BugCategory"); element.addAttribute("category", category); Element description = element.addElement("Description"); description.setText(I18N.instance().getBugCategoryDescription(category)); BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); if (bc != null) { // shouldn't be null String s = bc.getAbbrev(); if (s != null) { Element abbrev = element.addElement("Abbreviation"); abbrev.setText(s); } s = bc.getDetailText(); if (s != null) { Element details = element.addElement("Details"); details.setText(s); } } } }
/** * Add a BugCategory reported by the Plugin. * * @param bugCategory */ public void addBugCategory(BugCategory bugCategory) { BugCategory old = bugCategories.get(bugCategory.getCategory()); if (old != null) { throw new IllegalArgumentException("Category already exists"); } bugCategories.put(bugCategory.getCategory(), bugCategory); }
BugCategory bcat = DetectorFactoryCollection.instance().getBugCategory(pattern.getCategory()); if (bcat != null) { categoryAbbrev = bcat.getAbbrev();
private void addCategoryKey(String argument) { DetectorFactoryCollection i18n = DetectorFactoryCollection.instance(); for (String x : argument.split("[,|]")) { for (BugCategory category : i18n.getBugCategoryObjects()) { if (category.getAbbrev().equals(x) || category.getCategory().equals(x)) { this.categoryKey.add(category.getCategory()); break; } } } }
/** * Set the metadata for a bug category. If the category's metadata has * already been set, this does nothing. * @param bc * the BugCategory object holding the metadata for the category * * @return false if the category's metadata has already been set, true * otherwise */ public boolean registerBugCategory(BugCategory bc) { String category = bc.getCategory(); if (categoryDescriptionMap.get(category) != null) { return false; } categoryDescriptionMap.put(category, bc); return true; }
public String getCategoryAbbrev() { String categoryAbbrev = null; BugCategory bcat = DetectorFactoryCollection.instance().getBugCategory(getCategory()); if (bcat != null) { categoryAbbrev = bcat.getAbbrev(); } if (categoryAbbrev == null) { categoryAbbrev = TextUIBugReporter.OTHER_CATEGORY_ABBREV; } return categoryAbbrev; }
public BugCategory addOrCreateBugCategory(String id) { BugCategory c = bugCategories.get(id); if (c != null) { return c; } c = new BugCategory(id); bugCategories.put(id, c); return c; }
/** * Get the description of a bug category. Returns the category if no * description can be found. * * @param category * the category * @return the description of the category */ public String getBugCategoryDescription(String category) { BugCategory bc = DetectorFactoryCollection.instance().getBugCategory(category); return (bc != null ? bc.getShortDescription() : category); }
protected boolean unRegisterBugCategory(BugCategory bc) { String category = bc.getCategory(); categoryDescriptionMap.remove(category); return true; }
BugCategory bcat = DetectorFactoryCollection.instance().getBugCategory(pattern.getCategory()); if (bcat != null) { categoryAbbrev = bcat.getAbbrev();