From alexandre.iline at oracle.com Thu Aug 2 21:21:42 2018 From: alexandre.iline at oracle.com (Alexandre (Shura) Iline) Date: Thu, 2 Aug 2018 14:21:42 -0700 Subject: RFR 7902258: Only one parametrized ANC filter is allowed simultaneously Message-ID: Hi, Please review this fix for https://bugs.openjdk.java.net/browse/CODETOOLS-7902258 Webrev: http://cr.openjdk.java.net/~shurailine/7902258/webrev.01/ The fix adds new concept: AncFilterFactory. Instances of that factory are loaded as services. ANC filters themselves are no longer loaded as services. This makes this change functionally incompatible. Since there is no longer a need to distinguish ANC filters by name, there is no longer any need in DefaultANCFilter (which should have probably been called ?named ANC filter? in the first place). There is one possible additional fix which will need to be done later: get rid of ParameterizedAncFilter class. If the instantiation are done by a factory, there is no need for that class as factory should be able to instantiate the filter using parameter value passed as an additional parameter or just as a part of parameter to instantiate(String) method. Thank you Shura From alexandre.iline at oracle.com Fri Aug 3 18:01:30 2018 From: alexandre.iline at oracle.com (alexandre.iline at oracle.com) Date: Fri, 03 Aug 2018 18:01:30 +0000 Subject: hg: code-tools/jcov: 7902258: Only one parametrized ANC filter is allowed simultaneously Message-ID: <201808031801.w73I1USc009774@aojmv0008.oracle.com> Changeset: 996f55f99d75 Author: shurailine Date: 2018-08-03 04:01 -0700 URL: http://hg.openjdk.java.net/code-tools/jcov/rev/996f55f99d75 7902258: Only one parametrized ANC filter is allowed simultaneously Reviewed-by: lkuskov ! build/build.xml ! plugins/simple_methods_anc/test/openjdk/jcov/filter/simplemethods/MainTest.java ! src/classes/com/sun/tdk/jcov/RepGen.java + src/classes/com/sun/tdk/jcov/report/AncFilterFactory.java + src/classes/com/sun/tdk/jcov/report/ancfilters/BuiltInAncFilters.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/CatchANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/DeprecatedANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/EmptyANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/GetterANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/ListANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/SetterANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/SyntheticANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/ThrowANCFilter.java ! src/classes/com/sun/tdk/jcov/report/ancfilters/ToStringANCFilter.java + test/unit/com/sun/tdk/jcov/report/ancfilters/BuiltInAncFiltersTest.java ! test/unit/com/sun/tdk/jcov/report/ancfilters/ListANCFilterTest.java From jonathan.gibbons at oracle.com Tue Aug 7 15:37:19 2018 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 7 Aug 2018 08:37:19 -0700 Subject: RFR [jcov, unfilled]: jcov does not instrument files with NestHost/NestMembers attributes In-Reply-To: <5B69B9D2.5010404@oracle.com> References: <5B69B9D2.5010404@oracle.com> Message-ID: <185f14cd-6cb6-b341-4509-25b2e6654acf@oracle.com> Ooops, wrong list (asmtools-dev) cc: jcov-dev -- Jon On 8/7/18 8:25 AM, 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 From Leonid.Kuskov at Oracle.com Fri Aug 3 17:59:31 2018 From: Leonid.Kuskov at Oracle.com (Leonid Kuskov) Date: Fri, 03 Aug 2018 17:59:31 -0000 Subject: RFR 7902258: Only one parametrized ANC filter is allowed simultaneously In-Reply-To: References: Message-ID: Hi, The fix looks good. Thanks, Leonid On 8/2/18 14:21, Alexandre (Shura) Iline wrote: > Hi, > > Please review this fix for https://bugs.openjdk.java.net/browse/CODETOOLS-7902258 > Webrev: http://cr.openjdk.java.net/~shurailine/7902258/webrev.01/ > > The fix adds new concept: AncFilterFactory. Instances of that factory are loaded as services. ANC filters themselves are no longer loaded as services. This makes this change functionally incompatible. Since there is no longer a need to distinguish ANC filters by name, there is no longer any need in DefaultANCFilter (which should have probably been called ?named ANC filter? in the first place). > > There is one possible additional fix which will need to be done later: get rid of ParameterizedAncFilter class. If the instantiation are done by a factory, there is no need for that class as factory should be able to instantiate the filter using parameter value passed as an additional parameter or just as a part of parameter to instantiate(String) method. > > Thank you > > Shura > > From Leonid.Kuskov at Oracle.com Tue Aug 7 17:42:30 2018 From: Leonid.Kuskov at Oracle.com (Leonid Kuskov) Date: Tue, 07 Aug 2018 17:42:30 -0000 Subject: RFR [jcov, unfilled]: jcov does not instrument files with NestHost/NestMembers attributes In-Reply-To: <185f14cd-6cb6-b341-4509-25b2e6654acf@oracle.com> References: <5B69B9D2.5010404@oracle.com> <185f14cd-6cb6-b341-4509-25b2e6654acf@oracle.com> Message-ID: Hi Jan, These fixes look good. We already use the same approach in private jcov build for instrumenting JDK 12. Please apply the patch further I will add couple cosmetic fixes that I have for JDK 12 classfiles. Thanks, Leonid On 8/7/18 08:37, Jonathan Gibbons wrote: > Ooops, wrong list (asmtools-dev) > > cc: jcov-dev > > -- Jon > > On 8/7/18 8:25 AM, 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 >