Skip to content

Fix compatibility with Java 8 for ByteBuffer#3545

Merged
garyrussell merged 1 commit into
spring-projects:mainfrom
artembilan:Java8_compatibility
Apr 9, 2021
Merged

Fix compatibility with Java 8 for ByteBuffer#3545
garyrussell merged 1 commit into
spring-projects:mainfrom
artembilan:Java8_compatibility

Conversation

@artembilan

Copy link
Copy Markdown
Member

When we build with Java 9+ and target for Java 8,
we get an incompatible bytecode around these method for ByteBuffer:

position(int)
limit(int)
mark()
reset()
clear()
flip()
rewind()

The recommendation is to cast to Buffer when we call these methods

  • Fix all the production code using ByteBuffer for recommended cast to Buffer

Related to https://build.spring.io/browse/INTEXT-AWS-306

See more info in this Jetty issue: jetty/jetty.project#3244

When we build with Java 9+ and target for Java 8,
we get an incompatible bytecode around these method for `ByteBuffer`:

```
position(int)
limit(int)
mark()
reset()
clear()
flip()
rewind()
```

The recommendation is to cast to `Buffer` when we call these methods

* Fix all the production code using `ByteBuffer` for recommended cast to `Buffer`

Related to https://build.spring.io/browse/INTEXT-AWS-306

See more info in this Jetty issue: jetty/jetty.project#3244
@garyrussell

Copy link
Copy Markdown
Contributor

Also #3470

We must not have any samples that hit any of these other classes 😦

@artembilan

Copy link
Copy Markdown
Member Author

Yeah... Doesn't matter. It's great to catch it sooner than later. Plus it is just in time for for upcoming RC 😄

@artembilan artembilan requested a review from garyrussell April 9, 2021 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants