diff src/org/tmatesoft/hg/core/HgChangesetHandler.java @ 423:9c9c442b5f2e

Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 23 Mar 2012 22:51:18 +0100
parents f9f3e9b67ccc
children 31a89587eb04
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgChangesetHandler.java	Fri Mar 23 21:26:01 2012 +0100
+++ b/src/org/tmatesoft/hg/core/HgChangesetHandler.java	Fri Mar 23 22:51:18 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 TMate Software Ltd
+ * Copyright (c) 2011-2012 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
  */
 package org.tmatesoft.hg.core;
 
+import org.tmatesoft.hg.internal.Callback;
 import org.tmatesoft.hg.util.CancelledException;
 
 /**
@@ -24,12 +25,12 @@
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
+@Callback
 public interface HgChangesetHandler/*XXX perhaps, shall parameterize with exception clients can throw, like: <E extends Exception>*/ {
 	/**
 	 * @param changeset not necessarily a distinct instance each time, {@link HgChangeset#clone() clone()} if need a copy.
+	 * @throws HgCallbackTargetException wrapper for any exception user code may produce 
 	 * @throws CancelledException if handler is not interested in more changesets and iteration shall stop
-	 * @throws RuntimeException or any subclass thereof to indicate error. General contract is that RuntimeExceptions 
-	 * will be re-thrown wrapped into {@link HgCallbackTargetException}.  
 	 */
-	void next(HgChangeset changeset) throws CancelledException;
+	void next(HgChangeset changeset) throws HgCallbackTargetException, CancelledException;
 }