diff src/org/tmatesoft/hg/internal/DataAccess.java @ 421:fdd7d756dea0 v0.8.5

Allow IOException from DataAccess methods for subclasses with non-trivial implementations, to avoid exception dumps when inapropriate
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 22 Mar 2012 23:09:11 +0100
parents 6c22bdc0bdfd
children 48f993aa2f41
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DataAccess.java	Thu Mar 22 22:56:01 2012 +0100
+++ b/src/org/tmatesoft/hg/internal/DataAccess.java	Thu Mar 22 23:09:11 2012 +0100
@@ -29,19 +29,19 @@
  * @author TMate Software Ltd.
  */
 public class DataAccess {
-	public boolean isEmpty() {
+	public boolean isEmpty() throws IOException {
 		return true;
 	}
-	// TODO throws IOException (few subclasses have non-trivial length() operation)
+	// IOException due to few subclasses that have non-trivial length() operation
 	// long length and offset are needed only in RevlogStream, makes no sense elsewhere
 	// because chunks Mercurial operates with fit into int (4 bytes actualLength field)
 	// For those that may face large pieces of data (actual data streams) there are #longLength 
 	// and #longSeek() to implement
-	public int length() {
+	public int length() throws IOException {
 		return 0;
 	}
 	
-	public long longLength() {
+	public long longLength() throws IOException {
 		return length();
 	}