Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Java 17-EA #1148

Closed
garydgregory opened this issue Dec 29, 2020 · 5 comments
Closed

Add support for Java 17-EA #1148

garydgregory opened this issue Dec 29, 2020 · 5 comments
Labels
declined: duplicate ❌ This issue or pull request already exists

Comments

@garydgregory
Copy link

Running Maven on a Java 17-EA project on GitHub throws an exception rooted with the cause Unsupported class file major version 61:

java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
	at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:94)
	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:565)
	at java.base/java.lang.ClassLoader.defineClass2(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1101)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:814)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:735)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:616)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:631)
	at java.base/java.lang.Class.forName(Class.java:543)
	at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:852)
	at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1076)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1383)
	at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89)
	at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
	at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.<init>(CLDRLocaleProviderAdapter.java:86)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188)
	at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287)
	at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258)
	at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180)
	at java.base/java.util.Formatter.getZero(Formatter.java:2453)
	at java.base/java.util.Formatter.<init>(Formatter.java:1972)
	at java.base/java.util.Formatter.<init>(Formatter.java:1994)
	at java.base/java.lang.String.format(String.java:3290)
	at org.junit.platform.engine.UniqueIdFormat.<init>(UniqueIdFormat.java:74)
	at org.junit.platform.engine.UniqueIdFormat.<clinit>(UniqueIdFormat.java:42)
	at org.junit.platform.engine.UniqueId.root(UniqueId.java:80)
	at org.junit.platform.engine.UniqueId.forEngine(UniqueId.java:68)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:100)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:85)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:92)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:67)
	at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:56)
	at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:102)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:147)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
Caused by: java.io.IOException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
	at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)
	at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:110)
	at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:92)
	... 48 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
	at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:196)
	at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:177)
	at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:163)
	at org.jacoco.agent.rt.internal_f3994fa.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
	at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:76)
	at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:108)
	... 49 more

For example, our build at Apache Commons BCEL: https://github.com/apache/commons-bcel/runs/1623906918?check_suite_focus=true

TY!

@marchof
Copy link
Member

marchof commented Dec 30, 2020

This is already implemented in #1132 but not yet released.

See change log: https://www.jacoco.org/jacoco/trunk/doc/changes.html

You can try the current snapshot version from our snapshot repo: https://www.jacoco.org/jacoco/trunk/doc/repo.html

@marchof marchof closed this as completed Dec 30, 2020
@marchof marchof added declined: duplicate ❌ This issue or pull request already exists and removed type: enhancement labels Dec 30, 2020
@garydgregory
Copy link
Author

Thanks for the info @marchof

@DJViking
Copy link

This is already implemented in #1132 but not yet released.

See change log: https://www.jacoco.org/jacoco/trunk/doc/changes.html

You can try the current snapshot version from our snapshot repo: https://www.jacoco.org/jacoco/trunk/doc/repo.html

When will there be a final non-experimental implementation?
Now that Java 17 has been released.

@garydgregory
Copy link
Author

And Java 18-EA 😉

@Godin
Copy link
Member

Godin commented Sep 24, 2021

When will there be a final non-experimental implementation?

see https://www.jacoco.org/jacoco/trunk/doc/faq.html

When will feature X be released?

JaCoCo is maintained by volunteers in their free time. Since we cannot guarantee free capacity, we do not commit to particular release dates. Typically, you can expect a couple of releases every year.

In the change log, you can see all features that have been implemented in master branch and will be available with the next release. And in the meantime you can test latest build of master branch (Maven SNAPSHOT) and provide feedback to us.


Also as far as our testing shows
despite word "experimental" in released JaCoCo version 0.8.7,
you won't notice any differences in behaviour with unreleased 0.8.8 in regards of Java 17 class files - see https://twitter.com/_godin_/status/1438922086899126278

@jacoco jacoco locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
declined: duplicate ❌ This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants