* @param dbCriteria the criteria to use against the database
* @param t the analysis task to run
*/
public static void run(DatabasePlugin plugin, List dbCriteria,
DefectAnalyzer.Task t) {
QueryRunner queryRunner = plugin.getObject(QueryRunner.class);
if (queryRunner == null)
return;
StringBuilder query = new StringBuilder(DEFECT_HQL_QUERY);
List args = QueryUtils.addCriteriaToHql(query, "d", null, dbCriteria);
List<DefectToAnalyze> defects = new ArrayList();
List<Object[]> rawData = queryRunner.queryHql(query.toString(),
args.toArray());
for (Object[] oneRow : rawData) {
String path = getDefectPathFromHqlResultRow(oneRow);
Defect d = getDefectFromHqlResultRow(oneRow);
defects.add(new DefectToAnalyze(path, d));