Cleaned up WLDataModel.java.

This commit is contained in:
Winston Li 2014-11-08 12:08:06 +00:00
parent ea34136fe7
commit f245e583b4

View file

@ -13,21 +13,10 @@ public class WLDataModel implements SnapshotDBAPI {
private final Map<String, WLProject> projects;
public WLDataModel(Map<String, WLProject> projects) {
this.projects = projects;
}
public WLDataModel() {
projects = new HashMap<String, WLProject>();
}
private List<Snapshot> updateProjectWithName(String name) throws Throwable {
if (!projects.containsKey(name)) {
projects.put(name, new WLProject(name));
}
return projects.get(name).fetchNewSnapshots();
}
@Override
public boolean repositoryExists(String name) {
if (!projects.containsKey(name)) {
@ -41,4 +30,11 @@ public class WLDataModel implements SnapshotDBAPI {
return updateProjectWithName(name);
}
private List<Snapshot> updateProjectWithName(String name) throws Throwable {
if (!projects.containsKey(name)) {
projects.put(name, new WLProject(name));
}
return projects.get(name).fetchNewSnapshots();
}
}