diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java index cc4cf6a80..e28e4eeb2 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java @@ -185,7 +185,7 @@ public class GitServlet extends MetaServlet { initialized = true; - if (uploadPackFactory != ReceivePackFactory.DISABLED) { + if (uploadPackFactory != UploadPackFactory.DISABLED) { serve("*/git-upload-pack")// .with(new UploadPackServlet(uploadPackFactory)); } diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java index ea937481d..2650db2fa 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java @@ -112,7 +112,7 @@ public class AsIsServiceTest extends LocalDiskRepositoryTestCase { service.access(new R("bob", "1.2.3.4"), db); } - private final class R extends HttpServletRequestWrapper { + private static final class R extends HttpServletRequestWrapper { private final String user; private final String host; diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java index 5338caaa4..4d05a085c 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java @@ -174,7 +174,7 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase { assertNotNull("have ReceivePack", rp); } - private final class R extends HttpServletRequestWrapper { + private static final class R extends HttpServletRequestWrapper { private final String user; private final String host; diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java index 8f57d40af..423361e06 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java @@ -136,7 +136,7 @@ public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase { assertSame(db, up.getRepository()); } - private final class R extends HttpServletRequestWrapper { + private static final class R extends HttpServletRequestWrapper { private final String user; private final String host; 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 28df8b7f5..f64c32984 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(); } } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java index 38df04101..1681dbc96 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java @@ -96,7 +96,7 @@ import org.eclipse.jgit.revwalk.RevWalk; *
*/
class RebuildCommitGraph extends TextBuiltin {
- private final String REALLY = "--destroy-this-repository";
+ private static final String REALLY = "--destroy-this-repository";
@Option(name = REALLY, usage = "usage_approveDestructionOfRepository")
boolean really;
diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
index effe6e575..13d408f19 100644
--- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
+++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
@@ -176,7 +176,7 @@ public class CommitGraphPane extends JTable {
}
}
- class NameCellRender extends DefaultTableCellRenderer {
+ static class NameCellRender extends DefaultTableCellRenderer {
private static final long serialVersionUID = 1L;
public Component getTableCellRendererComponent(final JTable table,
@@ -194,7 +194,7 @@ public class CommitGraphPane extends JTable {
}
}
- class DateCellRender extends DefaultTableCellRenderer {
+ static class DateCellRender extends DefaultTableCellRenderer {
private static final long serialVersionUID = 1L;
private final DateFormat fmt = new SimpleDateFormat(
@@ -215,7 +215,7 @@ public class CommitGraphPane extends JTable {
}
}
- class GraphCellRender extends DefaultTableCellRenderer {
+ static class GraphCellRender extends DefaultTableCellRenderer {
private static final long serialVersionUID = 1L;
private final AWTPlotRenderer renderer = new AWTPlotRenderer(this);
diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
index 4a1196447..b58547a9e 100644
--- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
+++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
@@ -83,5 +83,9 @@ class SwingCommitList extends PlotCommitList