Skip to content

Implement missing, and/or unlinked native methods in Unsafe #105

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

Merged
merged 2 commits into from
Jul 20, 2018

Conversation

gayanW
Copy link
Collaborator

@gayanW gayanW commented Jul 20, 2018

This implements the missing methods in Unsafe model class to prevent NoSuchMethodError(s), and their respective NativePeer methods in JPF_jdk_internal_misc_Unsafe to prevent UnsatisfiedLinkError(s).

[junit] java.lang.NoSuchMethodError: jdk.internal.misc.Unsafe.objectFieldOffset(Ljava/lang/Class;Ljava/lang/String;)J
[junit] java.lang.UnsatisfiedLinkError: cannot find native jdk.internal.misc.Unsafe.objectFieldOffset

Fixes: #99

gayanW added 2 commits July 20, 2018 21:12
Rename JPF_sun_misc_Unsafe.java to JPF_jdk_internal_misc_Unsafe

This implements the missing methods in Unsafe model class to prevent:
[junit] java.lang.NoSuchMethodError: jdk.internal.misc.Unsafe.objectFieldOffset(Ljava/lang/Class;Ljava/lang/String;)J

And implement respective NativePeer methods in JPF_jdk_internal_misc_Unsafe, to prevent:
[junit] java.lang.UnsatisfiedLinkError: cannot find native jdk.internal.misc.Unsafe.objectFieldOffset
This exports java.base/jdk.internal.misc to the UNNAMED module (in ant
target --compile-tests), so to be able to reference
gov.nasa.jpf.test.java.misc.UnsafeTest within UnsafeTest

So to prevent:
    [javac] src/tests/gov/nasa/jpf/test/java/misc/UnsafeTest.java:4: error: package jdk.internal.misc is not visible
    [javac] import jdk.internal.misc.Unsafe;
    [javac]                    ^
    [javac]   (package jdk.internal.misc is declared in module java.base, which does not export it to the unnamed module)
@cyrille-artho cyrille-artho merged commit 5145473 into javapathfinder:java-10 Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants