Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
6   63   5   2
4   18   0.83   3
3     1.67  
1    
 
  EqualsUtility       Line # 26 6 5 92.3% 0.9230769
 
  (91)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.base.utility;
17   
18    import java.util.Arrays;
19   
20   
21    /**
22    * A collection of useful static methods for equality.
23    *
24    * @author Michael Meyling
25    */
 
26    public final class EqualsUtility {
27   
28    /**
29    * Constructor, should never be called.
30    */
 
31  0 toggle private EqualsUtility() {
32    // don't call me
33    }
34   
35    /**
36    * Compare two objects, each of them could be <code>null</code>.
37    *
38    * @param a First parameter.
39    * @param b Second parameter.
40    * @return Are <code>a</code> and <code>b</code> equal?
41    */
 
42  48104992 toggle public static boolean equals(final Object a, final Object b) {
43  48104992 if (a == null) {
44  2003 if (b == null) {
45  1832 return true;
46    }
47  171 return false;
48    }
49  48102989 return a.equals(b);
50    }
51   
52    /**
53    * Compare two objects, each of them could be <code>null</code>.
54    *
55    * @param a First parameter.
56    * @param b Second parameter.
57    * @return Are <code>a</code> and <code>b</code> equal?
58    */
 
59  15 toggle public static boolean equals(final byte[] a, final byte[] b) {
60  15 return Arrays.equals(a, b);
61    }
62   
63    }