Orbital library

Class SuspiciousError

  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by java.lang.VirtualMachineError
              extended by java.lang.InternalError
                  extended by orbital.util.SuspiciousError
All Implemented Interfaces:

public class SuspiciousError
extends java.lang.InternalError

This class is a SuspiciousError thrown like an InternalError whenever logical errors raise which should not normally occur for correct semantics.

This particular error should raise if a cautious assumption fails even after it should have already been tested.

As an example for distinction consider:

 if (a.still_available())
     try {
         assert a.count()!=0 : "still_available() and count() consistent";
         assert a.count()==0 : "all data processed";
     // exceptions which simply cannot occur semantically correct
     catch(SemanticallyUnavailableException oops) {throw new SuspiciousError("exception unavailable");}
     // exceptions that are semantically and pragmatically impossible
     catch(ImpossibleException imp) {throw new InternalError("panic");}
     assert a.count()==0 : "still_available() and count() consistent";
So you should distinguish two situations:

 try {
     if (a instanceof Thing)
 } // exceptions that are semantically and pragmatically impossible
 catch(ClassCastException imp) {throw new InternalError("panic: classcast garbage");}
 Object arg;
 arg = new Thing("something");
 try {
     // could do assert a instanceof Thing,"a Thing remains a Thing");
 // exceptions which simply cannot occur semantically correct
 catch(ClassCastException oops) {throw new SuspiciousError("should not happen");}

André Platzer
See Also:
InternalError, Serialized Form

Constructor Summary
SuspiciousError(java.lang.String message)
Method Summary
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public SuspiciousError(java.lang.String message)


public SuspiciousError()

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.