Analyzing JCov coverage using DataMethod functionality
Alexander Kouznetsov
alexander.kouznetsov at oracle.com
Wed Nov 5 19:27:42 UTC 2014
Alexandre,
Maybe.
I didn't look into those method and field. Instead, I've followed
MethodCoverage.detectItems() approach. It doesn't look too
straightforward to me but at least it matches the report generator.
Best regards,
Alexander Kouznetsov
(408) 276-0387
On 5 ноя 2014 1:53, Alexandre (Shura) Iline wrote:
> Alexander,
>
> I am guessing this is because the blocks are nested.
>
> I am assuming you've noticed
> public BasicBlock[] DataMethodWithBlocks.getBasicBlocks()
> and
> public final Map<DataBlock, LabelNode> BasicBlock.blockMap
>
> Shura
>
> On 10/31/14, 10:31 PM, Alexander Kouznetsov wrote:
>> Team,
>>
>> I'm confused. DataMethod has getBlocks() method that returns list of
>> blocks. My simple method has 4 blocks. But getBlocks() method returns
>> only one.
>>
>> 18
>>
>> public T dequeue() {
>>
>> 19 Block: 1/1
>>
>> if (head.isEmpty()) {
>>
>> 20 Block: 1/1 Branch: 1/1
>>
>> while (!tail.isEmpty()) {
>>
>> 21 Block: 1/1 Branch: 1/1
>>
>> head.push(tail.pop());
>>
>> 22
>>
>> }
>>
>> 23
>>
>> }
>>
>> 24 Block: 1/1 Branch: 2/2
>>
>> return head.pop();
>>
>> 25
>>
>> }
>>
>>
>> dataMethod.getBlocks().toString() = [methenter(0,9)@7cbd213e]
>>
>> Am I misinterpreting the API?
>>
>> Internally its basicBlocks inside has correct amount of 4 blocks that
>> matches to template.xml file however it doesn't help.
>>
>> I have similar issues with branches and lines.
>>
>> I've also found this comment in MethodCoverage.java. Could somebody
>> please clarify what exactly is legacy and what is the replacement?
>>
>> /**
>> * Finds coverage items in terms of legacy jcov (blocks and
>> branches)
>> */
>>
>> --
>> Best regards,
>> Alexander Kouznetsov
>> (408) 276-0387
>>
>
More information about the jcov-dev
mailing list