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

Make Boopickle compiled with Java 9+ compatible with Java 8, close #124 #125

Closed
wants to merge 1 commit into from

Conversation

slandelle
Copy link
Contributor

Motivation:

Java 9 introduced several overloads to Buffer methods in ByteBuffer:

  • position​(int newPosition)
  • limit​(int newLimit)
  • flip​()
  • clear​()
  • mark​()
  • reset​()
  • rewind​()

Compiling such code with Java 9+ with cause it to crash at runtime with Java 8 with NoSuchMethodError.

Modifications:

Introduce a Java8BufferCompat helper to force linking to java.nio.Buffer methods.

Result:

Boopickle can be compiled with Java 9+ and executed with Java 8.

Motivation:

Java 9 introduced several overloads to Buffer methods in ByteBuffer:

* position​(int newPosition)
* limit​(int newLimit)
* flip​()
* clear​()
* mark​()
* reset​()
* rewind​()

Compiling such code with Java 9+ with cause it to crash at runtime with Java 8 with NoSuchMethodError.

Modifications:

Introduce a `Java8BufferCompat` helper to force linking to `java.nio.Buffer` methods.

Result:

Boopickle can be compiled with Java 9+ and executed with Java 8.
@slandelle
Copy link
Contributor Author

slandelle commented May 17, 2020

javac has a --release 8 option to handle this. I have no idea if scalac has such option too.

@slandelle
Copy link
Contributor Author

It has. Closing this PR.

@slandelle slandelle closed this May 17, 2020
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.

None yet

1 participant