View Javadoc
1   /*
2    * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
3    * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>
4    * Copyright (C) 2009, Vasyl' Vavrychuk <vvavrychuk@gmail.com> and others
5    *
6    * This program and the accompanying materials are made available under the
7    * terms of the Eclipse Distribution License v. 1.0 which is available at
8    * https://www.eclipse.org/org/documents/edl-v10.php.
9    *
10   * SPDX-License-Identifier: BSD-3-Clause
11   */
12  
13  package org.eclipse.jgit.errors;
14  
15  
16  /**
17   * This signals a revision or object reference was not
18   * properly formatted.
19   */
20  public class RevisionSyntaxException extends IllegalArgumentException {
21  	private static final long serialVersionUID = 1L;
22  
23  	private final String revstr;
24  
25  	/**
26  	 * Construct a RevisionSyntaxException indicating a syntax problem with a
27  	 * revision (or object) string.
28  	 *
29  	 * @param revstr The problematic revision string
30  	 */
31  	public RevisionSyntaxException(String revstr) {
32  		this.revstr = revstr;
33  	}
34  
35  	/**
36  	 * Construct a RevisionSyntaxException indicating a syntax problem with a
37  	 * revision (or object) string.
38  	 *
39  	 * @param message a specific reason
40  	 * @param revstr The problematic revision string
41  	 */
42  	public RevisionSyntaxException(String message, String revstr) {
43  		super(message);
44  		this.revstr = revstr;
45  	}
46  
47  	/** {@inheritDoc} */
48  	@Override
49  	public String toString() {
50  		return super.toString() + ":" + revstr; //$NON-NLS-1$
51  	}
52  }