- ArrayList<Location> locs = new ArrayList<Location>();
-
- /*
- Somewhat unfortunate special case.
- The primary "location" for a bug instance is split between tags.
- Most bugs have a pattern like this:
- <BugInstance>
- ...
- <Method>
- <SourceLine .../>
- </Method>
- ...
- <SourceLine .../>
- </BugInstance>
-
- The primary location for a bug is given by the <Method> with no role attribute,
- but the <SourceLine/> inside that method describes the whole range of lines
- covered by that Method, not the spot where the bug is located--that is given
- by the <SourceLine/> that is a direct child fo the <BugInstance/>.
- */
-
- BugMethod primaryMethod = null;
- SourceLine primaryLine = null;
-
- for (BugMethod method : bug.getMethods()) {
- if (null != method.getRole()) {
- primaryMethod = method;
- break;
- }
- }
- if (bug.getLines().size() > 0) {
- primaryLine = bug.getLines().get(0);
- }
+ Column[] columns = { CfbSchema.TYPE };
+ Table[] tables = { CfbSchema.BUGS };
+ Condition[] conditions = { new Condition(CfbSchema.BUGID, bugPatternId, Operation.EQUAL) };
+ Row row = m_driver.selectExactlyOne(m_con, columns, tables, conditions);
+ String type = row.getString(0);
+ return type;
+ }
+
+ String getCategoryName(Long categoryId) throws SQLException, TypeMismatchException
+ {
+ Column[] columns = { CfbSchema.CATEGORY };
+ Table[] tables = { CfbSchema.CATEGORIES };
+ Condition[] conditions = { new Condition(CfbSchema.CATEGORYID, categoryId, Operation.EQUAL) };
+ Row row = m_driver.selectExactlyOne(m_con, columns, tables, conditions);
+ String name = row.getString(0);
+ return name;
+ }
+
+
+ Location getLoc(Long locId) throws SQLException, TypeMismatchException
+ {
+ Column[] columns = { CfbSchema.CLASSNAME, CfbSchema.METHODNAME, CfbSchema.METHODROLE, CfbSchema.STARTLINE, CfbSchema.ENDLINE };
+ Table[] tables = { CfbSchema.LOCATIONS };
+ Condition[] conditions = { new Condition(CfbSchema.LOCID, locId, Operation.EQUAL) };