Skip to content

Commit fa79336

Browse files
author
rcartwright
committed
*** empty log message ***
git-svn-id: file:///tmp/test-svn/trunk@3434 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 9dc40dd commit fa79336

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* DynamicJava - Copyright (C) 1999-2001
2+
*
3+
* Permission is hereby granted, free of charge, to any person obtaining a
4+
* copy of this software and associated documentation files
5+
* (the "Software"), to deal in the Software without restriction, including
6+
* without limitation the rights to use, copy, modify, merge, publish,
7+
* distribute, sublicense, and/or sell copies of the Software, and to permit
8+
* persons to whom the Software is furnished to do so, subject to the
9+
* following conditions:
10+
* The above copyright notice and this permission notice shall be included
11+
* in all copies or substantial portions of the Software.links
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
* IN NO EVENT SHALL DYADE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19+
* DEALINGS IN THE SOFTWARE.
20+
*
21+
* Except as contained in this notice, the name of Dyade shall not be
22+
* used in advertising or otherwise to promote the sale, use or other
23+
* dealings in this Software without prior written authorization from
24+
* Dyade.
25+
*
26+
*/
27+
28+
package koala.dynamicjava.interpreter.context;
29+
30+
public class NoSuchKeyException extends Exception {
31+
NoSuchKeyException(String msg) { super(msg); }
32+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*BEGIN_COPYRIGHT_BLOCK
2+
*
3+
* This file is part of DrJava. Download the current version of this project:
4+
* http://sourceforge.net/projects/drjava/ or http://www.drjava.org/
5+
*
6+
* DrJava Open Source License
7+
*
8+
* Copyright (C) 2001-2003 JavaPLT group at Rice University (javaplt@rice.edu)
9+
* All rights reserved.
10+
*
11+
* Developed by: Java Programming Languages Team
12+
* Rice University
13+
* http://www.cs.rice.edu/~javaplt/
14+
*
15+
* Permission is hereby granted, free of charge, to any person obtaining a
16+
* copy of this software and associated documentation files (the "Software"),
17+
* to deal with the Software without restriction, including without
18+
* limitation the rights to use, copy, modify, merge, publish, distribute,
19+
* sublicense, and/or sell copies of the Software, and to permit persons to
20+
* whom the Software is furnished to do so, subject to the following
21+
* conditions:
22+
*
23+
* - Redistributions of source code must retain the above copyright
24+
* notice, this list of conditions and the following disclaimers.
25+
* - Redistributions in binary form must reproduce the above copyright
26+
* notice, this list of conditions and the following disclaimers in the
27+
* documentation and/or other materials provided with the distribution.
28+
* - Neither the names of DrJava, the JavaPLT, Rice University, nor the
29+
* names of its contributors may be used to endorse or promote products
30+
* derived from this Software without specific prior written permission.
31+
* - Products derived from this software may not be called "DrJava" nor
32+
* use the term "DrJava" as part of their names without prior written
33+
* permission from the JavaPLT group. For permission, write to
34+
* javaplt@rice.edu.
35+
*
36+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
39+
* THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
40+
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
41+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42+
* OTHER DEALINGS WITH THE SOFTWARE.
43+
*
44+
END_COPYRIGHT_BLOCK*/
45+
46+
package koala.dynamicjava.util;
47+
48+
/**
49+
* An exception which DrJava throws on an unexpected error.
50+
* Many times, we have to catch BadLocationExceptions in
51+
* code that accesses DefinitionDocument, even if we know for a
52+
* fact that a BadLocationException cannot occur. In that case,
53+
* and in other similar cases where we know that an exception should not
54+
* occur, we throw this on the off chance that something does go wrong.
55+
* This aids us in debugging the code.
56+
* @version $Id$
57+
*/
58+
public class UnexpectedException extends RuntimeException {
59+
60+
private Throwable _value;
61+
62+
/** Constructs an unexpected exception with <code>value.toString()</code> as it's message. */
63+
public UnexpectedException(Throwable value) {
64+
super(value.toString());
65+
_value = value;
66+
}
67+
68+
/** Constructs an unexpected exception with a custom message string in addition to <code>value.toString()</code>. */
69+
public UnexpectedException(Throwable value, String msg) {
70+
super(msg + ": " + value.toString());
71+
_value = value;
72+
}
73+
74+
/** Constructs a new RuntimeException to report that unreachable point in code has been reached */
75+
public UnexpectedException() {
76+
this(new RuntimeException("Unreachable point in code has been reached!"));
77+
}
78+
79+
/** Returns the contained exception. */
80+
public Throwable getCause() { return _value; }
81+
}

0 commit comments

Comments
 (0)