@Override public String toString() { String expireTime = "<unavailable>"; try { expireTime = String.valueOf(getExpirationTime()); } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; } catch (Throwable e) { // Whenever you catch Error or Throwable, you must also // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); } return super.toString() + " for " + getLocalRegion().getFullPath() + ", expiration time: " + expireTime + " [now: " + getNow() + "]"; } }
@Override public String toString() { String expireTime = "<unavailable>"; try { expireTime = String.valueOf(getExpirationTime()); } catch (Throwable e) { Error err; if (e instanceof Error && SystemFailure.isJVMFailureError( err = (Error)e)) { SystemFailure.initiateFailure(err); // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; } // Whenever you catch Error or Throwable, you must also // check for fatal JVM error (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); } return super.toString() + " for " + getLocalRegion().getFullPath() + ", expiration time: " + expireTime + " [now: " + getNow() + "]"; } }