Changeset 1051

Show
Ignore:
Timestamp:
06/29/08 16:48:36 (4 years ago)
Author:
amandel
Message:

Also mark classes as not covered if there is no coverage information (but analysis information) available.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/java/org/jcoderz/phoenix/report/EmmaReportReader.java

    r1047 r1051  
    119119        { 
    120120            ClassDescriptor clazz = (ClassDescriptor) i.next(); 
    121             DataHolder coverage = mEmmaCoverageData.getCoverage(clazz); 
    122             if (coverage != null) 
    123             { 
    124                 final String classname 
    125                     = clazz.getClassVMName().substring( 
    126                         clazz.getClassVMName().lastIndexOf('/') + 1); 
    127                 final ResourceInfo source 
    128                     = ResourceInfo.lookup( 
    129                         clazz.getPackageVMName().replaceAll("/", "."), 
    130                         classname); 
    131                 if (source != null) 
    132                 { 
    133                     processClazz(itemMap, source, clazz, coverage); 
    134                 } 
    135                 else 
    136                 { 
    137                     logger.finer( 
    138                         "Ignoring coverage info for resource " 
    139                             + clazz.getPackageVMName().replaceAll("/", ".") 
    140                             + classname); 
    141                 } 
     121            final String classname 
     122                = clazz.getClassVMName().substring( 
     123                    clazz.getClassVMName().lastIndexOf('/') + 1); 
     124            final ResourceInfo source 
     125                = ResourceInfo.lookup( 
     126                    clazz.getPackageVMName().replaceAll("/", "."), classname); 
     127            if (source != null) 
     128            { 
     129                processClazz(itemMap, source, clazz, 
     130                    mEmmaCoverageData.getCoverage(clazz)); 
     131            } 
     132            else 
     133            { 
     134                logger.finer( 
     135                    "Ignoring coverage info for resource " 
     136                        + clazz.getPackageVMName().replaceAll("/", ".") 
     137                        + classname); 
    142138            } 
    143139        } 
     
    191187                && method.getBlockMap() != null) 
    192188            { 
    193                 final boolean[] methodCoverage 
    194                     = coverage.m_coverage[methodNr]; 
     189                boolean[] methodCoverage = null; 
     190                if (coverage!= null) 
     191                { 
     192                    methodCoverage = coverage.m_coverage[methodNr]; 
     193                } 
    195194                final int[][] map = method.getBlockMap(); 
    196195                for (int blockNr = 0; 
    197                     blockNr < methodCoverage.length; blockNr++) 
     196                    blockNr < map.length; blockNr++) 
    198197                { 
    199198                    int[] blockLines = map[blockNr]; 
    200                     if (methodCoverage[blockNr]) 
     199                    if (methodCoverage != null && methodCoverage[blockNr]) 
    201200                    { 
    202201                        markCovered(lineCoverage, blockLines);