From alexander.kouznetsov at oracle.com Wed Nov 5 19:27:42 2014 From: alexander.kouznetsov at oracle.com (Alexander Kouznetsov) Date: Wed, 05 Nov 2014 11:27:42 -0800 Subject: Analyzing JCov coverage using DataMethod functionality In-Reply-To: <5459F391.2070009@oracle.com> References: <5453E39D.5020706@oracle.com> <5459F391.2070009@oracle.com> Message-ID: <545A7A2E.9050500@oracle.com> 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 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 >> > From mikhail.ershov at oracle.com Thu Nov 20 15:35:45 2014 From: mikhail.ershov at oracle.com (mikhail.ershov at oracle.com) Date: Thu, 20 Nov 2014 15:35:45 +0000 Subject: hg: code-tools/jcov: CODETOOLS-7901084, CODETOOLS-7901078, CODETOOLS-7901071, CODETOOLS-7900971 Message-ID: <201411201535.sAKFZkLS015398@aojmv0008> Changeset: cd6626baaedd Author: afedorch Date: 2014-11-20 18:24 +0400 URL: http://hg.openjdk.java.net/code-tools/jcov/rev/cd6626baaedd CODETOOLS-7901084, CODETOOLS-7901078, CODETOOLS-7901071, CODETOOLS-7900971 ! src/classes/com/sun/tdk/jcov/JREInstr.java ! src/classes/com/sun/tdk/jcov/ant/Report.java ! src/classes/com/sun/tdk/jcov/instrument/OverriddenClassWriter.java ! src/classes/com/sun/tdk/jcov/report/html/resources/style.css ! src/classes/com/sun/tdk/jcov/report/javap/JavapClass.java ! src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java ! src/classes/com/sun/tdk/jcov/runtime/Collect.java ! src/classes/com/sun/tdk/jcov/runtime/JCovSESocketSaver.java