Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgBundle.java @ 628:6526d8adbc0f
Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 22 May 2013 15:52:31 +0200 |
parents | 5daa42067e7c |
children | 14dac192aa26 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgBundle.java Tue May 21 20:17:33 2013 +0200 +++ b/src/org/tmatesoft/hg/repo/HgBundle.java Wed May 22 15:52:31 2013 +0200 @@ -143,7 +143,7 @@ To recreate 30bd..e5, one have to take content of 9429..e0, not its p1 f1db..5e */ - public boolean element(GroupElement ge) { + public boolean element(GroupElement ge) throws HgRuntimeException { emptyChangelog = false; HgChangelog changelog = hgRepo.getChangelog(); try { @@ -194,24 +194,24 @@ // callback to minimize amount of Strings and Nodeids instantiated @Callback public interface Inspector { - void changelogStart(); - - void changelogEnd(); + void changelogStart() throws HgRuntimeException; - void manifestStart(); + void changelogEnd() throws HgRuntimeException; - void manifestEnd(); + void manifestStart() throws HgRuntimeException; - void fileStart(String name); + void manifestEnd() throws HgRuntimeException; - void fileEnd(String name); + void fileStart(String name) throws HgRuntimeException; + + void fileEnd(String name) throws HgRuntimeException; /** * XXX desperately need exceptions here * @param element data element, instance might be reused, don't keep a reference to it or its raw data * @return <code>true</code> to continue */ - boolean element(GroupElement element); + boolean element(GroupElement element) throws HgRuntimeException; } /** @@ -355,7 +355,7 @@ flowControl = null; } - private void internalInspectChangelog(DataAccess da, Inspector inspector) throws IOException { + private void internalInspectChangelog(DataAccess da, Inspector inspector) throws IOException, HgRuntimeException { if (da.isEmpty()) { return; } @@ -370,7 +370,7 @@ inspector.changelogEnd(); } - private void internalInspectManifest(DataAccess da, Inspector inspector) throws IOException { + private void internalInspectManifest(DataAccess da, Inspector inspector) throws IOException, HgRuntimeException { if (da.isEmpty()) { return; } @@ -385,7 +385,7 @@ inspector.manifestEnd(); } - private void internalInspectFiles(DataAccess da, Inspector inspector) throws IOException { + private void internalInspectFiles(DataAccess da, Inspector inspector) throws IOException, HgRuntimeException { while (!da.isEmpty()) { int fnameLen = da.readInt(); if (fnameLen <= 4) { @@ -406,7 +406,7 @@ } } - private static void readGroup(DataAccess da, Inspector inspector) throws IOException { + private static void readGroup(DataAccess da, Inspector inspector) throws IOException, HgRuntimeException { int len = da.readInt(); boolean good2go = true; Nodeid prevNodeid = Nodeid.NULL;