RFR [jcov, unfilled]: jcov does not instrument files with NestHost/NestMembers attributes

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Oct 11 17:41:05 UTC 2018

I've pushed these changes.

I had to apply an intermediate patch to build/build.properties to 
convert it from Windows newlines to Unix newlines, before the second 
patch would apply.
This was done with the following command:

sed --in-place -e 's/^M//' build/build.properties

In addition, I edited the changesets to include "Contributed-by: 
jan.lahoda at oracle.com"

-- Jon

On 10/10/2018 05:19 AM, Jan Lahoda wrote:
> Hello,
> I apologize, I forgot to do this. I've filled:
> https://bugs.openjdk.java.net/browse/CODETOOLS-7902334
> (for the NestHost problem)
> https://bugs.openjdk.java.net/browse/CODETOOLS-7902335
> (for enhancing the build script with tests)
> And put patches that might be suitable for commit here, respectivelly:
> http://cr.openjdk.java.net/~jlahoda/jcov-nesthost/webrev.allow.nesthost.00/7902334 
> http://cr.openjdk.java.net/~jlahoda/jcov-nesthost/webrev.test.00/7902335
> I am not a committer on the code-tools project, so I'd like to ask if 
> Jon could take a look whether it is fine to apply these commits.
> Thanks,
>     Jan
> On 9.10.2018 18:52, Leonid Kuskov wrote:
>> Hi Jan,
>> Could you please file the bug and apply your changes to
>> http://hg.openjdk.java.net/code-tools/jcov/.
>> I need to switch jcov to the next version of asm and upload couple fixes
>> that needed for JCK.
>> This is best done after your fixes.
>> Thanks,
>> Leonid
>> On 8/7/18 08:25, Jan Lahoda wrote:
>>> Hi,
>>> It seems that jcov cannot instrument files with NestHost/NestMembers
>>> attributes (JDK 11 classfiles), and silently uses the original
>>> version. The reason appears to be that even though it uses ASM 6.2,
>>> which knows about those attributes, the visitors are using "ASM6"
>>> compatibility flag, which does not support these attributes.
>>> My proposal here is to upgrade the compatibility flag to
>>> "ASM7_EXPERIMENTAL" compatibility level. It might be better to define
>>> a constant for the compatibility level constant, so that on next
>>> upgrade, we don't need to modify so many files. The proposed patch is
>>> here:
>>> http://cr.openjdk.java.net/~jlahoda/jcov-nesthost/webrev.allow.nesthost.00/ 
>>> Also, we could enhance the build script to allow running tests:
>>> http://cr.openjdk.java.net/~jlahoda/jcov-nesthost/webrev.test.00/
>>> If these would seem to go in a reasonable direction, I'll file bugs.
>>> It may be necessary to do a few more changes to support JDK 12
>>> classfiles.
>>> Any feedback is welcome!
>>> Thanks,
>>>     Jan

More information about the code-tools-dev mailing list