Package Torello.Browser.JsonAST
Class LinkingStateError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- Torello.Browser.JsonAST.LinkingStateError
-
- All Implemented Interfaces:
java.io.Serializable
public class LinkingStateError extends java.lang.Error
This error is used in place of the common'UnreachableError'. The code in the AST parsing routines can sometimes be suspiciously difficult to debug, when an error sets in. The first use of thisThrowableis going to be in preventing a certain aspect of thePPR.CTAS()andPPR.CTAB()fields from being improperly initialized.
In that example & usage, there is currently no way for the relevant fields, which are the'ctas'and'ctab'fields, to be improperly initialized. However, explaining what could go wrong is somewhat difficult, and salient ennough to let go of the commonly used'UnreachableError', and instead dedicate this specially tailored error message instead.
This is literally because breaking code can sometimes be completely unnoticed and invisble. Please review the classPPRto understand what can go wrong when initializing the'ctas'and'ctab'fields.Almost instantly, after using this error, I noticed other places where this throwable could be used to signify other internal errors. It is not just being used for the CTAS / CTAB issues.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Browser/JsonAST/LinkingStateError.java
- Open New Browser-Tab: Torello/Browser/JsonAST/LinkingStateError.java
File Size: 3,264 Bytes Line Count: 73 '\n' Characters Found
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description LinkingStateError()Constructs an'LinkingStateError'with no detail message.LinkingStateError(String message)Constructs an'LinkingStateError'with the specified detail message.LinkingStateError(String message, Throwable cause)Constructs a new error with the specified detail'message'and'cause'.LinkingStateError(Throwable cause)Constructs a new error with the specified'cause'and a detail message of(cause==null ? null : cause.toString())(which typically contains the class and detail message of cause).
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable. Using theSerializableImplementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Note that Java'sjava.lang.Exceptionandjava.lang.Errorclasses implement theSerializable interface, and a warning-free build expects this field be defined here.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final long serialVersionUID = 1;
-
-
Constructor Detail
-
LinkingStateError
public LinkingStateError()
Constructs an'LinkingStateError'with no detail message.
-
LinkingStateError
public LinkingStateError(java.lang.String message)
Constructs an'LinkingStateError'with the specified detail message.- Parameters:
message- the detail message.
-
LinkingStateError
public LinkingStateError(java.lang.String message, java.lang.Throwable cause)
Constructs a new error with the specified detail'message'and'cause'.Note: The detail message associated with cause is not automatically incorporated into this exception's detail message.- Parameters:
message- The detail message (which is saved for later retrieval by thThrowable.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
LinkingStateError
public LinkingStateError(java.lang.Throwable cause)
Constructs a new error with the specified'cause'and a detail message of(cause==null ? null : cause.toString())(which typically contains the class and detail message of cause). This constructor is useful for errors that are little more than wrappers for other throwables.- Parameters:
cause- The cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
-