comparison src/org/tmatesoft/hg/repo/HgInvalidControlFileException.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 src/org/tmatesoft/hg/core/HgInvalidControlFileException.java@0ae53c32ecef
children 51d682cf9cdc
comparison
equal deleted inserted replaced
422:5d1cc7366d04 423:9c9c442b5f2e
1 /*
2 * Copyright (c) 2011-2012 TMate Software Ltd
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * For information on how to redistribute this software under
14 * the terms of a license other than GNU General Public License
15 * contact TMate Software at support@hg4j.com
16 */
17 package org.tmatesoft.hg.repo;
18
19 import java.io.File;
20
21 import org.tmatesoft.hg.core.Nodeid;
22 import org.tmatesoft.hg.internal.Experimental;
23 import org.tmatesoft.hg.util.Path;
24
25 /**
26 * Subclass of {@link HgInvalidFileException} to indicate failure to deal with one of <b>Mercurial</b> control files
27 * (most likely those under .hg/, but also those residing in the repository, with special meaning to the Mercurial, like .hgtags or .hgignore)
28 *
29 * XXX Perhaps, HgInvalidRevlogException? and parent HgInvalidRepositoryFileException?
30 * @author Artem Tikhomirov
31 * @author TMate Software Ltd.
32 */
33 @SuppressWarnings("serial")
34 @Experimental(reason="WORK IN PROGRESS. Name is likely to change")
35 public class HgInvalidControlFileException extends HgInvalidFileException {
36
37 public HgInvalidControlFileException(String message, Throwable th, File file) {
38 super(message, th, file);
39 }
40
41 @Override
42 public HgInvalidControlFileException setFile(File file) {
43 super.setFile(file);
44 return this;
45 }
46
47 @Override
48 public HgInvalidControlFileException setRevision(Nodeid r) {
49 return (HgInvalidControlFileException) super.setRevision(r);
50 }
51
52 @Override
53 public HgInvalidControlFileException setRevisionIndex(int rev) {
54 return (HgInvalidControlFileException) super.setRevisionIndex(rev);
55 }
56
57 @Override
58 public HgInvalidControlFileException setFileName(Path name) {
59 return (HgInvalidControlFileException) super.setFileName(name);
60 }
61 }