Clover coverage report - Code Coverage for hivemind release 1.0
Coverage timestamp: Wed Sep 22 2004 08:05:25 EDT
file stats: LOC: 91   Methods: 9
NCLOC: 49   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ApplicationRuntimeException.java - 91.7% 88.9% 90.5%
coverage coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind;
 16   
 
 17   
 /**
 18   
  *  General wrapper for any exception (normal or runtime) that may occur during
 19   
  *  runtime processing for the application.  This is exception is used
 20   
  *  when the intent is to communicate a low-level failure to the user or
 21   
  *  developer; it is not expected to be caught.  The {@link #getRootCause() rootCause}
 22   
  *  property is a <em>nested</em> exception.
 23   
  *
 24   
  *  @author Howard Lewis Ship
 25   
  */
 26   
 
 27   
 public class ApplicationRuntimeException extends RuntimeException implements Locatable
 28   
 {
 29   
     private Throwable _rootCause;
 30   
     private transient Location _location;
 31   
     private transient Object _component;
 32   
 
 33  1
     public ApplicationRuntimeException(Throwable rootCause)
 34   
     {
 35  1
         this(rootCause.getMessage(), rootCause);
 36   
     }
 37   
 
 38  37
     public ApplicationRuntimeException(String message)
 39   
     {
 40  37
         this(message, null, null, null);
 41   
     }
 42   
 
 43  21
     public ApplicationRuntimeException(String message, Throwable rootCause)
 44   
     {
 45  21
         this(message, null, null, rootCause);
 46   
     }
 47   
 
 48  91
     public ApplicationRuntimeException(
 49   
         String message,
 50   
         Object component,
 51   
         Location location,
 52   
         Throwable rootCause)
 53   
     {
 54  91
         super(message);
 55   
 
 56  91
         _rootCause = rootCause;
 57  91
         _component = component;
 58   
 
 59  91
         _location = HiveMind.findLocation(new Object[] { location, rootCause, component });
 60   
     }
 61   
 
 62  21
     public ApplicationRuntimeException(String message, Location location, Throwable rootCause)
 63   
     {
 64  21
         this(message, null, location, rootCause);
 65   
     }
 66   
 
 67  7
     public Throwable getRootCause()
 68   
     {
 69  7
         return _rootCause;
 70   
     }
 71   
 
 72  11
     public Location getLocation()
 73   
     {
 74  11
         return _location;
 75   
     }
 76   
 
 77  7
     public Object getComponent()
 78   
     {
 79  7
         return _component;
 80   
     }
 81   
 
 82   
     /**
 83   
      * This method is for compatibility with JDK 1.4 ... under 1.4, this will look like
 84   
      * an override, allowing <code>printStackTrace()</code> to descending into the root cause
 85   
      * exception and print its stack trace too.
 86   
      */
 87  0
     public Throwable getCause()
 88   
     {
 89  0
         return _rootCause;
 90   
     }
 91   
 }