KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > exception > RuntimeExceptionHelper


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.exception;
5
6 public class RuntimeExceptionHelper implements ExceptionHelper {
7
8   public boolean accepts(Throwable JavaDoc t) {
9     return t instanceof RuntimeException JavaDoc;
10   }
11   
12   public Throwable JavaDoc getProximateCause(Throwable JavaDoc t) {
13     return (t instanceof RuntimeException JavaDoc && ((RuntimeException JavaDoc) t).getCause() != null) ? ((RuntimeException JavaDoc) t)
14         .getCause() : t;
15   }
16
17   public Throwable JavaDoc getUltimateCause(Throwable JavaDoc t) {
18     throw new AssertionError JavaDoc();
19   }
20
21 }
22
Popular Tags