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

java.lang.IncompatibleClassChangeError: Method $jacocoInit()[Z must be InterfaceMethodref constant #428

Merged
merged 1 commit into from Jun 24, 2016

Conversation

Godin
Copy link
Member

@Godin Godin commented Jun 22, 2016

Steps to reproduce

I receive with Java 9 the follow error:

java.lang.IncompatibleClassChangeError: Method com.inet.error.ErrorCode.$jacocoInit()[Z must be InterfaceMethodref constant
    at com.inet.error.ErrorCode.getMsg(ErrorCode.java)
    at com.inet.error.BaseErrorTest.testErrorCodeHasDefaultTranslation(BaseErrorTest.java:16)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:533)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)

The code look like:

public interface ErrorCode {
    default String getMsg( Object... params ) {
        String baseName = getClass().getName();
        baseName = baseName.substring( 0, baseName.lastIndexOf( '.' ) ) + ".LanguageResources";

        ResourceBundle bundle = LoaderUtils.getBundle( baseName, ClientLocale.getThreadLocale(), getClass() );
        String msg = name();
        try {
            msg = bundle.getString( msg );
        } catch( Exception e ) {/* ignore */
        }
        try {
            msg = java.text.MessageFormat.format( msg, params );
        } catch( Exception t ) {/*ignore*/
        }
        return msg;
    }
}

JaCoCo version: 0.7.5.201505241946
Operating system: Windows 10
Tool integration: Gradle

@Godin
Copy link
Member

Godin commented Jun 22, 2016

@Horcrux7 experimental support for Java 9 has been added in JaCoCo version 0.7.7.

If you are really using early access and hence unstable build of Java 9, then please provide full version, including its build number.

@Godin Godin self-assigned this Jun 22, 2016
@Godin Godin added the feedback pending Further information is requested label Jun 22, 2016
@Godin Godin added this to the Java 9 milestone Jun 22, 2016
@Godin Godin removed the feedback pending Further information is requested label Jun 22, 2016
@Godin
Copy link
Member

Godin commented Jun 22, 2016

Our test suite reproduces this issue on JDK 9 EA b123. Most likely this relates to changes in b122 - https://bugs.openjdk.java.net/browse/JDK-8145148

@Godin Godin added type: bug 🐛 Something isn't working component: core labels Jun 22, 2016
@Godin Godin modified the milestones: 0.7.8, Java 9 Jun 22, 2016
@Horcrux7
Copy link
Author

Sorry, the JDK version was not part of your support template. I use the version from today 9 Build 123.

@Godin
Copy link
Member

Godin commented Jun 22, 2016

@marchof could you please review?

@marchof
Copy link
Member

marchof commented Jun 22, 2016

@Godin Shouldn't we add a verification for this in ProbeArrayStrategyFactoryTest?

Without this change instrumented classes can't pass consistency
checks for a constant pool and cause IncompatibleClassChangeError
starting with OpenJDK 9 EA b122
(see https://bugs.openjdk.java.net/browse/JDK-8145148).
@Godin
Copy link
Member

Godin commented Jun 23, 2016

@marchof you right, added. I was too fast after saw that integration tests pass.

@marchof marchof merged commit 7056530 into master Jun 24, 2016
@marchof marchof deleted the issue-428 branch June 24, 2016 09:23
@Godin
Copy link
Member

Godin commented Jun 25, 2016

@Horcrux7 thank you for reporting about this issue

@Horcrux7
Copy link
Author

i have test it and it works for me now. Thanks.

openstreetmap-mirror pushed a commit to JOSM/josm that referenced this pull request Jul 24, 2016
@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: core type: bug 🐛 Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants