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

Check for problems with ByteBuffer covariant return types when building with JDK 9+ #113

Closed
cpovirk opened this issue Aug 21, 2020 · 3 comments
Assignees
Labels
P2 type=defect Bug, not working as expected

Comments

@cpovirk
Copy link
Member

cpovirk commented Aug 21, 2020

jimfs uses ByteBuffer, so building it with JDK 9+ may make it fail at runtime under Java 8 or lower, similar to:

But I haven't checked any more detail than that.

@cpovirk cpovirk added type=defect Bug, not working as expected P3 labels Aug 21, 2020
@cpovirk
Copy link
Member Author

cpovirk commented Aug 21, 2020

Probably at least one affected line:

@raboof
Copy link

raboof commented Jan 11, 2021

I can confirm starting with jimfs 1.2, RegularFile no longer works on JDK8 for us because it references the JDK9+ signature.

https://github.com/google/jimfs/blob/v1.2/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L573

akka/akka#29942 (comment)

@cpovirk cpovirk added P2 and removed P3 labels May 25, 2023
copybara-service bot pushed a commit that referenced this issue May 30, 2023
- Set `-source 8 -target 8`. We already have a depencdency on `guava-android`, which began requiring Java 8 a while back, so we might as well unlock the ability to use Java 8 language features ourselves. (I also found I had to set `-source 8` in `maven-javadoc-plugin` to prevent it from trying to pass a `--module-path`, which leads to problems with our usages of `@NullableDecl`, which isn't in a module. That's probably unrelated: We probably just haven't run Javadoc since some `maven-javadoc-plugin` upgrade.) Work toward #240, and fixes #229
- Don't refer to Java 9+ `ByteBuffer` methods, and set up Error Prone enforcement of future such mistakes. Compare google/guava#6334. Fixes #113

RELNOTES=Officially dropped support for Java 7, and restored accidentally dropped support for Java 8.
PiperOrigin-RevId: 535378262
@cpovirk cpovirk self-assigned this Jun 1, 2023
@cpovirk
Copy link
Member Author

cpovirk commented Jul 6, 2023

This is fixed in 1.3.0, now on Maven Central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 type=defect Bug, not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants