Skip to content

Commit

Permalink
Refactor ComDb to a more general SocialDb. Planning on doing this wit…
Browse files Browse the repository at this point in the history
…h technical as well. We were getting too much fragmented database classes and it was getting to be too much of a hassle. Splitting into Social and technical shared dbs then overriding those if need be is better
  • Loading branch information
Braden Simpson committed Jun 27, 2012
1 parent ac5ba5c commit d0c02d5
Show file tree
Hide file tree
Showing 36 changed files with 41 additions and 1,736 deletions.
1 change: 0 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<classpathentry kind="lib" path="libs/httpcore-4.2.jar"/>
<classpathentry kind="lib" path="libs/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="libs/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="libs/commons-lang3-3.1.jar"/>
<classpathentry kind="lib" path="libs/jazzy.jar"/>
<classpathentry kind="lib" path="libs/ostermillerutils-1.08.02.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
Expand Down
Binary file removed libs/commons-lang3-3.1.jar
Binary file not shown.
11 changes: 5 additions & 6 deletions src/bugzilla/Bugzilla.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
import models.Silent;

import comm.ComResources;
import comm.ComResources.CommType;

import db.ComDb;
import db.Resources.CommType;
import db.SocialDb;

public class Bugzilla
{
private ComDb comDB;
private SocialDb comDB;
private BugzillaDb bugzillaDB;

public Bugzilla(ComDb comDB) {
public Bugzilla(SocialDb comDB) {
this.comDB = comDB;
}

public Bugzilla(ComDb comDB, String dbName)
public Bugzilla(SocialDb comDB, String dbName)
{
this.comDB = comDB;

Expand Down
1 change: 0 additions & 1 deletion src/bugzilla/BugzillaDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import models.Person;

import comm.ComResources;
import comm.ComResources.CommType;

import db.DbConnection;

Expand Down
4 changes: 2 additions & 2 deletions src/bugzilla/linker/BugzillaLinker.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import models.Commit;
import models.Pair;

import db.ComDb;
import db.SocialDb;
import db.LinkerDb;

public class BugzillaLinker extends Linker
{

public BugzillaLinker(ComDb comDb, LinkerDb linkerDb)
public BugzillaLinker(SocialDb comDb, LinkerDb linkerDb)
{
super(comDb, linkerDb);
}
Expand Down
9 changes: 0 additions & 9 deletions src/comm/ComResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,14 @@ public enum TrackerProject {
HIBERNATE, ECLIPSE, AGILEFANT
}

public enum CommType {
EMAIL, BUGZILLA, JIRA, ISSUE, GITHUB, FORUM
}
public enum TextType {
PATCH, SOURCE, TRACE, NAME, KEYWORD, COMMITID
}

public static final boolean LINK_FROM_COMMIT_MSGS = true;
public static final SimpleDateFormat JiraDateFormat = new SimpleDateFormat("yyyy-mm-dd kk:mm:ss.SSSZ");
public static final Pattern SHA1_REGEX = Pattern.compile("[0-9a-f]{5,40}");
public static final Pattern BUG_NUMBER_REGEX = Pattern.compile("([A-Z]{2,4}-[0-9]{2,4})|(\\[([A-Z]{2,4}-[0-9]{2,4})\\])"); // TODO add cases for bugzilla
public static final Pattern NUMBER = Pattern.compile("([0-9]+)");
public static final Pattern COMMIT_KEYWORDS = Pattern.compile("fix(e[ds])?|bugs?|defects|patch");
public static final Pattern BUG_NUMBER_BUGZILLA_REGEX = Pattern.compile("bug[#\\s]*([0-9]+{1})");

public static final int JIRA_MAX_RESULTS = 50;
public static int DB_LIMIT = 2000;

public static final int COMMIT_DATE_MAX_RANGE = 7;

Expand Down
6 changes: 3 additions & 3 deletions src/comm/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import org.apache.commons.cli.Options;

import bugzilla.Bugzilla;
import db.ComDb;
import db.SocialDb;
import db.LinkerDb;
import db.Resources;

public class Main
{
public static ComDb db;
public static SocialDb db;
public static LinkerDb linkdb;
public static Jira jira;

Expand Down Expand Up @@ -61,7 +61,7 @@ public static void main(String[] args)

CommandLine line = parser.parse(options, args);

db = new ComDb();
db = new SocialDb();
linkdb = new LinkerDb();

// Check for database
Expand Down
Loading

0 comments on commit d0c02d5

Please sign in to comment.