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

3 participants
@Godin
Member

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

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jun 22, 2016

Member

@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.

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 this to the Java 9 milestone Jun 22, 2016

@Godin Godin removed the feedback pending label Jun 22, 2016

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jun 22, 2016

Member

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

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

@Horcrux7

This comment has been minimized.

Show comment
Hide comment
@Horcrux7

Horcrux7 Jun 22, 2016

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

Horcrux7 commented Jun 22, 2016

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

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jun 22, 2016

Member

@marchof could you please review?

Member

Godin commented Jun 22, 2016

@marchof could you please review?

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Jun 22, 2016

Member

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

Member

marchof commented Jun 22, 2016

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

Fix instrumentation of interfaces with default methods
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

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jun 23, 2016

Member

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

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

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@marchof marchof deleted the issue-428 branch Jun 24, 2016

@Godin

This comment has been minimized.

Show comment
Hide comment
@Godin

Godin Jun 25, 2016

Member

@Horcrux7 thank you for reporting about this issue

Member

Godin commented Jun 25, 2016

@Horcrux7 thank you for reporting about this issue

@Horcrux7

This comment has been minimized.

Show comment
Hide comment
@Horcrux7

Horcrux7 Jun 27, 2016

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

Horcrux7 commented Jun 27, 2016

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

openstreetmap-mirror pushed a commit to openstreetmap/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.