openclover/clover

Unexpected token: switch

Closed this issue · 8 comments

Seems that the switch case for Java 17 is not supported with version 4.5.2:

15:26:52,870 [INFO] --- clover-maven-plugin:4.5.2:setup (default-cli) @ xwiki-platform-eventstream-api ---

15:26:52,876 [INFO] OpenClover Version 4.5.2, built on 2024-01-31

15:26:52,877 [INFO] Updating existing database at '/root/workspace/Clover/clover-data/clover.db'.

15:26:53,206 [INFO] Processing files at JAVA_17 source level.

15:26:53,268 [INFO] /root/workspace/Clover/xwiki-platform/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-api/src/main/java/org/xwiki/eventstream/internal/AbstractAsynchronousEventStore.java:211:13:unexpected token: switch

15:26:53,269 [INFO] Instrumentation error

com.atlassian.clover.api.CloverException: /root/workspace/Clover/xwiki-platform/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-api/src/main/java/org/xwiki/eventstream/internal/AbstractAsynchronousEventStore.java:211:13:unexpected token: switch

    at com.atlassian.clover.instr.java.Instrumenter.instrument (Instrumenter.java:160)

    at com.atlassian.clover.CloverInstr.execute (CloverInstr.java:110)

    at com.atlassian.clover.CloverInstr.mainImpl (CloverInstr.java:86)

    at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrumentSources (AbstractInstrumenter.java:205)

    at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrument (AbstractInstrumenter.java:80)

    at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.execute (CloverInstrumentInternalMojo.java:278)

    at com.atlassian.maven.plugin.clover.CloverSetupMojo.execute (CloverSetupMojo.java:31)

    at jdk.internal.reflect.GeneratedMethodAccessor26.invoke (Unknown Source)

    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:568)
...

See https://github.com/xwiki/xwiki-platform/blob/c5cfe3211e3945dc3af4382d956c285d65e023d8/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-api/src/main/java/org/xwiki/eventstream/internal/AbstractAsynchronousEventStore.java#L211

Thanks!

I'm also getting:

[INFO] /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/SolrEventStore.java:747:22:expecting COLON, found ','
[INFO] Instrumentation error
com.atlassian.clover.api.CloverException: /Users/vmassol/dev/xwiki/xwiki-platform/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/SolrEventStore.java:747:22:expecting COLON, found ','
    at com.atlassian.clover.instr.java.Instrumenter.instrument (Instrumenter.java:160)
    at com.atlassian.clover.CloverInstr.execute (CloverInstr.java:110)
    at com.atlassian.clover.CloverInstr.mainImpl (CloverInstr.java:86)
    at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrumentSources (AbstractInstrumenter.java:205)
    at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrument (AbstractInstrumenter.java:80)
    at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.execute (CloverInstrumentInternalMojo.java:278)
    at com.atlassian.maven.plugin.clover.CloverSetupMojo.execute (CloverSetupMojo.java:31)
    at jdk.internal.reflect.GeneratedMethodAccessor22.invoke (Unknown Source)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)

For https://github.com/xwiki/xwiki-platform/blob/da9cfa6636f0a3ba0c576924af41d6547eb517c5/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/SolrEventStore.java#L747

I think it's a duplicate of #246, it's already fixed on the master branch. I just didn't release OpenClover 5.0.0 yet, as I'm doing large refactoring.

@marek-parfianowicz oh great ! Sorry for the duplication. Great to hear it's fixed on master. Will wait for 5.0.0.

I wasn't sure if openclover was still being developer so I'm happy to hear it's the case and that a major work is in the works. Any rough ETA for a release of 5.0.0 (is there a lot of work remaining for the release)?

Thanks a lot

Yeah, I'm still maintaining it, unfortunately summer time and vacation wasn't helpful to sit and code :) With autumn weather it's more likely that I'll push the project forward. Code on master is stable, you could build your own 5.0.0 version from it.

As a matter of fact, I could release 5.0.0 any time, with full Java 17 support. I did not release it, because I want to not only add Java 17 support, but also the latest Groovy 5 as well as resurrect Eclipse and IDEA plugins, which are currently incompatible with latest IDE versions.

:)

As a matter of fact, I could release 5.0.0 any time, with full Java 17 support. I did not release it, because I want to not only add Java 17 support, but also the latest Groovy 5 as well as resurrect Eclipse and IDEA plugins, which are currently incompatible with latest IDE versions.

I guess you could do it in 2 steps: Do a first 5.0.0 release with full java 17 support and put it in the hands of users to see if there are still bugs with it, and then in parallel continue your work to support Groovy 5 and release it in a 5.1.0 version (with the bugs founds by users too for java 17) when it's ready. Just an idea! :)

Thx again

to see if there are still bugs with it

It was already done with 4.5.0, 4.5.1 and 4.5.2. See https://openclover.org/blog. I think bugs were fleshed out as I didn't receive any new reports since.

then in parallel continue your work to support Groovy 5 and release it in a 5.1.0 version

That's a valid point. I'll think about it!

to see if there are still bugs with it

It was already done with 4.5.0, 4.5.1 and 4.5.2. See https://openclover.org/blog. I think bugs were fleshed out as I didn't receive any new reports since.

well, you got #246 & my issue report at least :)