Package Torello.Java

Class UnreachableError

  • All Implemented Interfaces:
    java.io.Serializable

    public class UnreachableError
    extends java.lang.Error
    If a code-block that was theoretically unreachable is actually reached, this error is a great class to make use-of during any debugging-phase of the development-process. The detail message in this class may not be configured using the constructors to this class - it is set inside this class' constructor, and cannot be modified! It's a pre-defined message, and informs the reader that the problem that's been encountered is with programing logic itself (and it needs to be addressed by the progrmmer).

    NOTE: This class extends java.lang.Error because it should be used and 'thought-of' in a way similar to a Java assert-statement. Such coding practice is usually restricted to the debugging phase of development, and extra care should be taken to ensure that the final version of releasable-code would never be capable of throwing UnreachableError, unless some here-to-fore unrecognized constraints are reached or broken.

    The build code for the Java HTML '.jar' makes quite a bit of use of this Error. It should not be thrown, but when it is, it means the code has to be changed.
    See Also:
    Serialized Form


    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        🡇    
        public static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation 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's java.lang.Exception and java.lang.Error classes implement the Serializable 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

      • UnreachableError

        🡅  🡇    
        public UnreachableError()
        Constructs a UnreachableError with a pre-defined detail-message.
        Code:
        Exact Constructor Body:
         super(
             "This code path has reached a point that was theoretically, or thought-to-be " +
             "unreachable.  This is the fault of the developer of this class or package."
         );
        
      • UnreachableError

        🡅    
        public UnreachableError​(java.lang.Throwable cause)
        Constructs a new exception with the specified 'cause' and a pre-defined
        Parameters:
        cause - The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        Code:
        Exact Constructor Body:
         super(
             "This code path has reached a point that was theoretically, or thought-to-be " +
             "unreachable.  This is the fault of the developer of this class package.  A cause " +
             "Throwable has been provided.  Please see this.getCause() for more information.",
             cause
         );