diff src/org/tmatesoft/hg/internal/RevisionLookup.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 46f29b73e51e
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RevisionLookup.java	Tue May 21 20:17:33 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/RevisionLookup.java	Wed May 22 15:52:31 2013 +0200
@@ -21,7 +21,10 @@
 import java.util.Arrays;
 
 import org.tmatesoft.hg.core.Nodeid;
+import org.tmatesoft.hg.repo.HgInvalidControlFileException;
+import org.tmatesoft.hg.repo.HgInvalidRevisionException;
 import org.tmatesoft.hg.repo.HgRevisionMap;
+import org.tmatesoft.hg.repo.HgRuntimeException;
 
 /**
  * Lite alternative to {@link HgRevisionMap}, to speed up nodeid to index conversion without consuming too much memory.
@@ -42,7 +45,7 @@
 		content = stream;
 	}
 	
-	public static RevisionLookup createFor(RevlogStream stream) {
+	public static RevisionLookup createFor(RevlogStream stream) throws HgRuntimeException {
 		RevisionLookup rv = new RevisionLookup(stream);
 		int revCount = stream.revisionCount();
 		rv.prepare(revCount);
@@ -62,7 +65,7 @@
 	public void next(int index, Nodeid nodeid) {
 		nodeidHashes[index] = nodeid.hashCode();
 	}
-	public int findIndex(Nodeid nodeid) {
+	public int findIndex(Nodeid nodeid) throws HgInvalidControlFileException, HgInvalidRevisionException {
 		final int hash = nodeid.hashCode();
 		for (int i = 0; i < nodeidHashes.length; i++) {
 			if (nodeidHashes[i] == hash) {