Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Simpson committed Jul 3, 2012
1 parent 541e6fe commit bbb95b1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/db/LinkerDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import models.Commit;

public class LinkerDb extends DbConnection
public class LinkerDb extends TechnicalDb
{
public LinkerDb() { }

Expand Down
21 changes: 4 additions & 17 deletions src/extractor/Extractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,15 @@ private List<Extraction> extractItemBody(Item item, FilterPatches patchFilter, F
* Extracts the technical information from the given {@link models.Issue}
* and parses it into <br>
* the technical extractions {@link models.Extraction}.
*
* <h3>UNIMPLEMENTED</h3>
* @param {@link models.Issue} item
* @return
*/
public List<Extraction> ExtractKeys(Issue issue)
{

// TODO @braden FIXME this needs fixing to be similar to #ExtractKeys(Item item)

// get all item keys.
List<Extraction> keys = new LinkedList<Extraction>();

// First search through the title.
List<Extraction> titleKeys = matchSHA1(issue.getTitle(), issue.getCreationTS());
titleKeys.addAll(matchBugNumber(issue.getTitle(), issue.getCreationTS()));

List<Extraction> bodyKeys = matchSHA1(issue.getDescription(), issue.getCreationTS());
bodyKeys.addAll(matchBugNumber(issue.getDescription(), issue.getCreationTS()));

keys.addAll(titleKeys);
keys.addAll(bodyKeys);
return keys;
// This is currently unused because we aren't using any extra logic for an issue,
// write this code in the future if the issues need more logic.
return null;
}

private List<Extraction> matchBugNumber(String input, Timestamp timestamp)
Expand Down
2 changes: 2 additions & 0 deletions src/jira/Jira.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public void parseJira(String location, LinkerDb linkerDb, SocialDb comDb) throws
for (TemporaryIssueLink tLink : this.tempLinks)
{
int dependsID = comDb.findItemIDFromJiraKey(tLink.DependsKey);
if (dependsID == -1)
continue;
comDb.insertDependency(new Dependency(tLink.getItemID(), dependsID));
}

Expand Down
7 changes: 0 additions & 7 deletions src/test/extractor/ExtractorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,4 @@ public void TestStacktrace()
List<Extraction> results = extractor.ExtractKeys(data.StackTraceItem);
assertEquals(results.size(), 2);
}

@Test
public void TestFindBugNumber()
{
List<Extraction> results = extractor.ExtractKeys(data.jiraIssueTest);
assertEquals(results.size(), 1);
}
}

0 comments on commit bbb95b1

Please sign in to comment.