diff options
author | Chris Aniszczyk <caniszczyk@gmail.com> | 2010-08-31 15:46:58 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-09-01 15:27:43 -0700 |
commit | 38327a54a86697458a1b326278e04833c105c00e (patch) | |
tree | 07f7fb8a462c4ef4def71c07dd19190e1a7eaf8a /org.eclipse.jgit | |
parent | ea4ff61ad3de3f5742905c7a92e99cf041d19596 (diff) | |
download | jgit-38327a54a86697458a1b326278e04833c105c00e.tar.gz jgit-38327a54a86697458a1b326278e04833c105c00e.zip |
Refactor Git API exceptions to a new package
Create a new 'org.eclipse.jgit.api.errors' package to contain
exceptions related to using the Git porcelain API.
Change-Id: Iac1781bd74fbd520dffac9d347616c3334994470
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
16 files changed, 102 insertions, 28 deletions
diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index a8f39d93bf..0c4d102e7f 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF @@ -7,10 +7,11 @@ Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: org.eclipse.jgit;version="0.9.0", org.eclipse.jgit.api;version="0.9.0", + org.eclipse.jgit.api.errors;version="0.9.0", org.eclipse.jgit.diff;version="0.9.0", org.eclipse.jgit.dircache;version="0.9.0", - org.eclipse.jgit.events;version="0.9.0", org.eclipse.jgit.errors;version="0.9.0", + org.eclipse.jgit.events;version="0.9.0", org.eclipse.jgit.fnmatch;version="0.9.0", org.eclipse.jgit.ignore;version="0.9.0", org.eclipse.jgit.lib;version="0.9.0", diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java index 29c520c172..7a01e74b06 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java @@ -49,6 +49,8 @@ import java.util.Collection; import java.util.LinkedList; import org.eclipse.jgit.JGitText; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.api.errors.NoFilepatternException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuildIterator; import org.eclipse.jgit.dircache.DirCacheBuilder; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index e385e7cb81..1f59dfdbdb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -48,6 +48,12 @@ import java.util.LinkedList; import java.util.List; import org.eclipse.jgit.JGitText; +import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.api.errors.NoFilepatternException; +import org.eclipse.jgit.api.errors.NoHeadException; +import org.eclipse.jgit.api.errors.NoMessageException; +import org.eclipse.jgit.api.errors.WrongRepositoryStateException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.errors.UnmergedPathException; import org.eclipse.jgit.lib.CommitBuilder; @@ -57,9 +63,9 @@ import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; +import org.eclipse.jgit.lib.RefUpdate.Result; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryState; -import org.eclipse.jgit.lib.RefUpdate.Result; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java index 61a87b416a..aa1cdea7d4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java @@ -46,6 +46,8 @@ import java.io.IOException; import java.text.MessageFormat; import org.eclipse.jgit.JGitText; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.api.errors.NoHeadException; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.lib.AnyObjectId; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java index 48920fe42e..b2e0175e36 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java @@ -52,16 +52,23 @@ import java.util.Map; import org.eclipse.jgit.JGitText; import org.eclipse.jgit.api.MergeResult.MergeStatus; +import org.eclipse.jgit.api.errors.CheckoutConflictException; +import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; +import org.eclipse.jgit.api.errors.InvalidMergeHeadsException; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.api.errors.NoHeadException; +import org.eclipse.jgit.api.errors.NoMessageException; +import org.eclipse.jgit.api.errors.WrongRepositoryStateException; import org.eclipse.jgit.dircache.DirCacheCheckout; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectIdRef; import org.eclipse.jgit.lib.Ref; -import org.eclipse.jgit.lib.RefUpdate; -import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Ref.Storage; +import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.lib.RefUpdate.Result; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.merge.MergeStrategy; import org.eclipse.jgit.merge.ResolveMerger; import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java index 77a8825d0c..27248529f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java @@ -46,6 +46,10 @@ import java.io.IOException; import java.text.MessageFormat; import org.eclipse.jgit.JGitText; +import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; +import org.eclipse.jgit.api.errors.InvalidTagNameException; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.api.errors.NoHeadException; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutConflictException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java index 09dda6f61d..de45c1d8e2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutConflictException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; import java.util.LinkedList; import java.util.List; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ConcurrentRefUpdateException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java index 2a5f7f9225..0321ae4224 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ConcurrentRefUpdateException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; import java.text.MessageFormat; @@ -54,7 +54,13 @@ public class ConcurrentRefUpdateException extends GitAPIException { private RefUpdate.Result rc; private Ref ref; - ConcurrentRefUpdateException(String message, Ref ref, + /** + * @param message + * @param ref + * @param rc + * @param cause + */ + public ConcurrentRefUpdateException(String message, Ref ref, RefUpdate.Result rc, Throwable cause) { super((rc == null) ? message : message + ". " + MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc), cause); @@ -62,7 +68,12 @@ public class ConcurrentRefUpdateException extends GitAPIException { this.ref = ref; } - ConcurrentRefUpdateException(String message, Ref ref, + /** + * @param message + * @param ref + * @param rc + */ + public ConcurrentRefUpdateException(String message, Ref ref, RefUpdate.Result rc) { super((rc == null) ? message : message + ". " + MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc)); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/GitAPIException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/GitAPIException.java index 9991502aaa..ba38529ab3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/GitAPIException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/GitAPIException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Superclass of all exceptions thrown by the API classes in diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/InvalidMergeHeadsException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidMergeHeadsException.java index 7748853910..e56cbc438e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/InvalidMergeHeadsException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidMergeHeadsException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** @@ -47,7 +47,10 @@ package org.eclipse.jgit.api; public class InvalidMergeHeadsException extends GitAPIException { private static final long serialVersionUID = 1L; - InvalidMergeHeadsException(String msg) { + /** + * @param msg + */ + public InvalidMergeHeadsException(String msg) { super(msg); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/InvalidTagNameException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidTagNameException.java index ceff637845..1779c45e2c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/InvalidTagNameException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidTagNameException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when a tag command was called with an invalid tag name (or @@ -44,7 +44,10 @@ package org.eclipse.jgit.api; public class InvalidTagNameException extends GitAPIException { private static final long serialVersionUID = 1L; - InvalidTagNameException(String msg) { + /** + * @param msg + */ + public InvalidTagNameException(String msg) { super(msg); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/JGitInternalException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/JGitInternalException.java index a0475da135..9042daddcc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/JGitInternalException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/JGitInternalException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when during command execution a low-level exception from the @@ -59,11 +59,18 @@ package org.eclipse.jgit.api; public class JGitInternalException extends RuntimeException { private static final long serialVersionUID = 1L; - JGitInternalException(String message, Throwable cause) { + /** + * @param message + * @param cause + */ + public JGitInternalException(String message, Throwable cause) { super(message, cause); } - JGitInternalException(String message) { + /** + * @param message + */ + public JGitInternalException(String message) { super(message); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoFilepatternException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoFilepatternException.java index 8a845d5153..1130c256f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoFilepatternException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoFilepatternException.java @@ -37,7 +37,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when the options given to a command don't include a @@ -47,11 +47,18 @@ public class NoFilepatternException extends GitAPIException { private static final long serialVersionUID = 1L; - NoFilepatternException(String message, Throwable cause) { + /** + * @param message + * @param cause + */ + public NoFilepatternException(String message, Throwable cause) { super(message, cause); } - NoFilepatternException(String message) { + /** + * @param message + */ + public NoFilepatternException(String message) { super(message); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoHeadException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoHeadException.java index 5d79233cf5..50c4dc96b3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoHeadException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoHeadException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when a command expected the {@code HEAD} reference to exist @@ -44,11 +44,18 @@ package org.eclipse.jgit.api; public class NoHeadException extends GitAPIException { private static final long serialVersionUID = 1L; - NoHeadException(String message, Throwable cause) { + /** + * @param message + * @param cause + */ + public NoHeadException(String message, Throwable cause) { super(message, cause); } - NoHeadException(String message) { + /** + * @param message + */ + public NoHeadException(String message) { super(message); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoMessageException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoMessageException.java index ab5652e24c..b7d8dc8db3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/NoMessageException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoMessageException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when the options given to a command don't include a @@ -46,11 +46,18 @@ package org.eclipse.jgit.api; public class NoMessageException extends GitAPIException { private static final long serialVersionUID = 1L; - NoMessageException(String message, Throwable cause) { + /** + * @param message + * @param cause + */ + public NoMessageException(String message, Throwable cause) { super(message, cause); } - NoMessageException(String message) { + /** + * @param message + */ + public NoMessageException(String message) { super(message); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/WrongRepositoryStateException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/WrongRepositoryStateException.java index 833cf8d6ed..dd2b3998ea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/WrongRepositoryStateException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/WrongRepositoryStateException.java @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.api; +package org.eclipse.jgit.api.errors; /** * Exception thrown when the state of the repository doesn't allow the execution @@ -45,11 +45,18 @@ package org.eclipse.jgit.api; public class WrongRepositoryStateException extends GitAPIException { private static final long serialVersionUID = 1L; - WrongRepositoryStateException(String message, Throwable cause) { + /** + * @param message + * @param cause + */ + public WrongRepositoryStateException(String message, Throwable cause) { super(message, cause); } - WrongRepositoryStateException(String message) { + /** + * @param message + */ + public WrongRepositoryStateException(String message) { super(message); } } |