Clover coverage report - PicoContainer - 1.0
Coverage timestamp: Sat Jun 5 2004 21:34:14 EDT
file stats: LOC: 59   Methods: 5
NCLOC: 33   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
UnsatisfiableDependenciesException.java 0% 26.3% 60% 25%
coverage coverage
 1   
 /*****************************************************************************
 2   
  * Copyright (C) PicoContainer Organization. All rights reserved.            *
 3   
  * ------------------------------------------------------------------------- *
 4   
  * The software in this package is published under the terms of the BSD      *
 5   
  * style license a copy of which has been included with this distribution in *
 6   
  * the LICENSE.txt file.                                                     *
 7   
  *                                                                           *
 8   
  * Original code by                                                          *
 9   
  *****************************************************************************/
 10   
 package org.picocontainer.defaults;
 11   
 
 12   
 import org.picocontainer.ComponentAdapter;
 13   
 import org.picocontainer.PicoIntrospectionException;
 14   
 
 15   
 import java.util.Set;
 16   
 
 17   
 /**
 18   
  * @author Aslak Hellesøy
 19   
  * @version $Revision: 1.6 $
 20   
  */
 21   
 public class UnsatisfiableDependenciesException extends PicoIntrospectionException {
 22   
 
 23   
     private final ComponentAdapter instantiatingComponentAdapter;
 24   
     private final Set failedDependencies;
 25   
 
 26  16
     public UnsatisfiableDependenciesException(ComponentAdapter instantiatingComponentAdapter, Set failedDependencies) {
 27  16
         super(instantiatingComponentAdapter.getComponentImplementation().getName() + " doesn't have any satisfiable constructors. Unsatisfiable dependencies: " + failedDependencies);
 28  16
         this.instantiatingComponentAdapter = instantiatingComponentAdapter;
 29  16
         this.failedDependencies = failedDependencies;
 30   
     }
 31   
 
 32  2
     public ComponentAdapter getUnsatisfiableComponentAdapter() {
 33  2
         return instantiatingComponentAdapter;
 34   
     }
 35   
 
 36  6
     public Set getUnsatisfiableDependencies() {
 37  6
         return failedDependencies;
 38   
     }
 39   
 
 40  0
     public boolean equals(Object o) {
 41  0
         if (this == o) return true;
 42  0
         if (!(o instanceof UnsatisfiableDependenciesException)) return false;
 43   
 
 44  0
         final UnsatisfiableDependenciesException noSatisfiableConstructorsException = (UnsatisfiableDependenciesException) o;
 45   
 
 46  0
         if (!instantiatingComponentAdapter.equals(noSatisfiableConstructorsException.instantiatingComponentAdapter)) return false;
 47  0
         if (!failedDependencies.equals(noSatisfiableConstructorsException.failedDependencies)) return false;
 48   
 
 49  0
         return true;
 50   
     }
 51   
 
 52  0
     public int hashCode() {
 53  0
         int result;
 54  0
         result = instantiatingComponentAdapter.hashCode();
 55  0
         result = 29 * result + failedDependencies.hashCode();
 56  0
         return result;
 57   
     }
 58   
 }
 59