summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.iplog
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2010-06-14 19:59:48 -0400
committerCode Review <codereview-daemon@eclipse.org>2010-06-14 19:59:48 -0400
commit86fcdc53ad29d850f0831636038ef56a981c98e5 (patch)
treebc96b3498ca16def7da9b8470799f0e9b61fad29 /org.eclipse.jgit.iplog
parent44ba1bc78ce0c00fd970f39a93128de061e83e01 (diff)
parent6d5241110bc22f69287dc285a6793301075bb3dc (diff)
downloadjgit-86fcdc53ad29d850f0831636038ef56a981c98e5.tar.gz
jgit-86fcdc53ad29d850f0831636038ef56a981c98e5.zip
Merge changes I53f71dc0,I3a899a3a,I3e8bd245,Ie7c9db83,If396326e,I6f4cf8da,I3bf96dd0,I3a2a43a1,I292fe88c,Ia1cf40cf
* changes: git-servlet: Fix comparing uploadFactory with the wrong DISABLED instance Prefer static inner classes Override equals for SwingLane since super class PlotLane defines it Make sure a Stream is closed upon errors in IpLogGenerator Make constant static in RebuildCommitGraph Make inner classes static in http code Cache filemode in GitIndex Remove unused parent field in PlotLane Removed unused repo field in WorkDirCheckout Extend DiffFormatter API to simplify styling
Diffstat (limited to 'org.eclipse.jgit.iplog')
-rw-r--r--org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java60
1 files changed, 32 insertions, 28 deletions
diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
index 28df8b7f53..f64c329847 100644
--- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
+++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
@@ -236,36 +236,40 @@ public class IpLogGenerator {
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
File list = new File(repo.getDirectory(), "gerrit_committers");
BufferedReader br = new BufferedReader(new FileReader(list));
- String line;
-
- while ((line = br.readLine()) != null) {
- String[] field = line.trim().split(" *\\| *");
- String user = field[1];
- String name = field[2];
- String email = field[3];
- Date begin = parseDate(dt, field[4]);
- Date end = parseDate(dt, field[5]);
-
- if (user.startsWith("username:"))
- user = user.substring("username:".length());
-
- Committer who = committersById.get(user);
- if (who == null) {
- who = new Committer(user);
- int sp = name.indexOf(' ');
- if (0 < sp) {
- who.setFirstName(name.substring(0, sp).trim());
- who.setLastName(name.substring(sp + 1).trim());
- } else {
- who.setFirstName(name);
- who.setLastName(null);
+ try {
+ String line;
+
+ while ((line = br.readLine()) != null) {
+ String[] field = line.trim().split(" *\\| *");
+ String user = field[1];
+ String name = field[2];
+ String email = field[3];
+ Date begin = parseDate(dt, field[4]);
+ Date end = parseDate(dt, field[5]);
+
+ if (user.startsWith("username:"))
+ user = user.substring("username:".length());
+
+ Committer who = committersById.get(user);
+ if (who == null) {
+ who = new Committer(user);
+ int sp = name.indexOf(' ');
+ if (0 < sp) {
+ who.setFirstName(name.substring(0, sp).trim());
+ who.setLastName(name.substring(sp + 1).trim());
+ } else {
+ who.setFirstName(name);
+ who.setLastName(null);
+ }
+ committersById.put(who.getID(), who);
}
- committersById.put(who.getID(), who);
- }
- who.addEmailAddress(email);
- who.addActiveRange(new ActiveRange(begin, end));
- committersByEmail.put(email, who);
+ who.addEmailAddress(email);
+ who.addActiveRange(new ActiveRange(begin, end));
+ committersByEmail.put(email, who);
+ }
+ } finally {
+ br.close();
}
}