-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternalException.java
More file actions
70 lines (61 loc) · 2.35 KB
/
InternalException.java
File metadata and controls
70 lines (61 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package EDU.bmrb.starlibj;
import java.lang.*;
import java.util.*;
/** This is thrown when there is some internal problem with
* the starlibj that was not expected. Whenever this exception
* appears it indicates an error on the part of the starlibj
* programmer. A bug needs to be reported. The starlibj
* programmer(s) put this exception in as a keep-us-honest check.
* (If we think a condition is a "can't-happen-ever" condition,
* we throw this exception from that point just to be sure. If
* we are right in our assumptions, a user will never see this
* message.)
*/
public class InternalException extends RuntimeException
{
public InternalException( )
{
additionalStr = null;
}
/** Allow the thrower to make additional information about the
* exception appear in the message:
*/
public InternalException( String msg)
{
additionalStr = new String(msg);
}
/** The message that will be printed at runtime if this exception
* 'bubbles up' all the way to the Java Runtime Environment and
* is not caught along the way.
* @return the message to be printed by the JVM.
*/
public String getMessage()
{
return System.getProperty("line.separator") +
"If you see this message, then there is a bug in the" +
System.getProperty("line.separator") +
StarValidity.pkgName() +
" package. This exception is deliberately " +
System.getProperty("line.separator") +
"thrown in parts of the code where the programmer believed" +
System.getProperty("line.separator") +
"it was impossible to reach a certain line of code. " +
System.getProperty("line.separator") +
"If you see this message in a user-program, then a bug " +
System.getProperty("line.separator") +
"report should be reported to the developers. (Include " +
System.getProperty("line.separator") +
"the following output in the message.)" +
System.getProperty("line.separator") +
( ( additionalStr == null ) ?
"" :
( "ADDITIONAL INFORMATION: " +
additionalStr +
System.getProperty("line.separator") )
) ;
// (After the message above prints, the stack trace will
// typically be printed, which the programmer can use to
// track down the problem.)
}
String additionalStr;
}