/** * Find set of classes referenced in given BugCollection. * * @param bugCollection * @return set of classes referenced in the BugCollection */ private Set<String> buildClassSet(BugCollection bugCollection) { Set<String> classSet = new HashSet<>(); for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { BugInstance warning = i.next(); for (Iterator<BugAnnotation> j = warning.annotationIterator(); j.hasNext();) { BugAnnotation annotation = j.next(); if (!(annotation instanceof ClassAnnotation)) { continue; } classSet.add(((ClassAnnotation) annotation).getClassName()); } } return classSet; }
/** * @param newCollection */ private void discardUnwantedBugs(BugCollection newCollection) { BugRanker.trimToMaxRank(newCollection, maxRank); if (sloppyMatch) { TreeSet<BugInstance> sloppyUnique = new TreeSet<>(new SloppyBugComparator()); for(Iterator<BugInstance> i = newCollection.iterator(); i.hasNext(); ) { if (!sloppyUnique.add(i.next())) { i.remove(); } } } }
Iterator<BugInstance> bugInstanceIter = bugCollection.iterator();
diedAfter = new int[(int) bugCollection.getSequenceNumber() + 1]; for (Iterator<BugInstance> j = bugCollection.iterator(); j.hasNext();) { BugInstance bugInstance = j.next();
warningsByField = new HashMap<>(); for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { BugInstance warning = i.next(); MethodAnnotation method = warning.getPrimaryMethod();
BugSet(BugCollection bugCollection) { this(Collections.<BugLeafNode> emptyList()); for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { mainList.add(new BugLeafNode(i.next())); } }
/** * Find set of classes referenced in given BugCollection. * * @param bugCollection * @return set of classes referenced in the BugCollection */ private Set<String> buildClassSet(BugCollection bugCollection) { Set<String> classSet = new HashSet<String>(); for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { BugInstance warning = i.next(); for (Iterator<BugAnnotation> j = warning.annotationIterator(); j.hasNext();) { BugAnnotation annotation = j.next(); if (!(annotation instanceof ClassAnnotation)) { continue; } classSet.add(((ClassAnnotation) annotation).getClassName()); } } return classSet; }
/** * @param newCollection */ private void discardUnwantedBugs(BugCollection newCollection) { BugRanker.trimToMaxRank(newCollection, maxRank); if (sloppyMatch) { TreeSet<BugInstance> sloppyUnique = new TreeSet<BugInstance>(new SloppyBugComparator()); for(Iterator<BugInstance> i = newCollection.iterator(); i.hasNext(); ) { if (!sloppyUnique.add(i.next())) { i.remove(); } } } }
/** * Scan bug instances contained in given bug collection, reporting those * whose text annotations contain at least one of the keywords in the query. * * @param bugCollection * the bug collection * @param filename * the XML file from which the bug collection was read */ public void scan(BugCollection bugCollection, String filename) throws Exception { Iterator<BugInstance> i = bugCollection.iterator(); while (i.hasNext()) { BugInstance bugInstance = i.next(); Set<String> contents = bugInstance.getTextAnnotationWords(); for (String aKeywordSet : keywordSet) { if (contents.contains(aKeywordSet)) { match(bugInstance, filename); break; } } } }
diedAfter = new int[(int) bugCollection.getSequenceNumber() + 1]; for (Iterator<BugInstance> j = bugCollection.iterator(); j.hasNext();) { BugInstance bugInstance = j.next();
Iterator<BugInstance> bugInstanceIter = bugCollection.iterator();
warningsByField = new HashMap<FieldDescriptor, Collection<BugInstance>>(); for (Iterator<BugInstance> i = bugCollection.iterator(); i.hasNext();) { BugInstance warning = i.next(); MethodAnnotation method = warning.getPrimaryMethod();