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

Specify optional dependency on sun.misc.Unsafe #1999

Closed

Conversation

Marcono1234
Copy link
Collaborator

Resolves #1695 (though maybe Gson documentation could be improved to mention usage of Unsafe)
(Hopefully) resolves #1981

I have marked this as draft because I am not very familiar with OSGi. To be tested:

  • works for OGSi deployments without Unsafe
  • works for OSGi deployments with Unsafe and Gson is able to construct instances of class without default constructor (by using Unsafe)
    • With System property org.osgi.framework.bootdelegation=sun.misc.*
    • With System property org.osgi.framework.system.packages.extra=sun.misc
    • Using extension bundle from https://github.com/diffplug/osgiX (?)

See also this StackOverflow answer and diffplug/osgiX README.

Ideally a test as proposed by #1993 should be added as well (with some adjustments), but the class from #1993 cannot be reused because the CLA is not signed.

@Marcono1234 Marcono1234 force-pushed the marcono1234/sun-misc-dependency branch from 00ae6d0 to 91a780a Compare October 22, 2021 00:02
@JaroslavTulach
Copy link

Ideally a test as proposed by #1993 should be added as well (with some adjustments)

I have signed the CLA meanwhile. Thanks for your fix. I merged your commit 91a780a into #1993 and adjusted the test.

@Marcono1234 Marcono1234 deleted the marcono1234/sun-misc-dependency branch October 22, 2021 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Constraint: Import-Package: sun.misc Undeclared module dependency for Java 9
2 participants