EMMA Coverage Report (generated Sat Jun 02 16:47:50 EDT 2012)
[all classes][net.sf.madmap]

COVERAGE SUMMARY FOR SOURCE FILE [ThreadComparator.java]

nameclass, %method, %block, %line, %
ThreadComparator.java100% (1/1)100% (3/3)85%  (41/48)94%  (10.4/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ThreadComparator100% (1/1)100% (3/3)85%  (41/48)94%  (10.4/11)
<static initializer> 100% (1/1)75%  (6/8)75%  (0.8/1)
compare (Object, Object): int 100% (1/1)86%  (32/37)95%  (9.5/10)
ThreadComparator (): void 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * Copyright 2008 Eric Caspole
3 * 
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
5 * file except in compliance with the License. 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 distributed under
10 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11 * KIND, either express or implied. See the License for the specific language governing
12 * permissions and limitations under the License.
13 */
14package net.sf.madmap;
15 
16import java.util.Comparator;
17 
18public class ThreadComparator implements Comparator {
19 
20  public int compare( Object aa, Object bb ) {
21    
22    HprofThreadData a = (HprofThreadData) aa;
23    HprofThreadData b = (HprofThreadData) bb;
24 
25    long aVal = a.addr();
26    long bVal = b.addr();
27 
28    if ( aVal < bVal ) {
29      return -1;
30    } else if ( aVal == bVal ) {
31    
32      assert aa.equals(bb) : "should not have 2 threads with same address";
33    
34      return 0; 
35    } else {
36      return 1;
37    }
38  }
39}

[all classes][net.sf.madmap]
EMMA 2.0.5312 (C) Vladimir Roubtsov