Skip to content

Fix NoSuchMethodError when Buffer.clear() is called #216

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 1 commit into from
Aug 30, 2019

Conversation

highpower
Copy link

@highpower highpower commented Aug 7, 2019

Tarantool client uses java.nio.ByteBuffer to represent a payload to be
sent through the network. JDK 9 introduces a number of new methods that
override java.nio.Buffer methods in order to return ByteBuffer instead
of Buffer. Because of overriding, those methods are available in JRE 8
or below but cannot be invoked if the connector is built using JDK 9 or
above using new signatures for methods overridden. To be compatible
with JREs before 9, it possible to cast ByteBuffer to Buffer class
explicitly. As a result, a method will be called which is available in
older versions but it breaks conciseness of the code.

Closes: #215

@nicktorwald nicktorwald force-pushed the highpower/issue-215-fix branch from 49447f1 to a5d441c Compare August 22, 2019 11:37
@nicktorwald nicktorwald changed the title Highpower/issue 215 fix Fix NoSuchMethodError when Buffer.clear() is called Aug 22, 2019
@nicktorwald nicktorwald requested a review from Totktonada August 22, 2019 11:39
Tarantool client uses java.nio.ByteBuffer to represent a payload to be
sent through the network. JDK 9 introduces a number of new methods that
override java.nio.Buffer methods in order to return ByteBuffer instead
of Buffer. Because of overriding, those methods are available in JRE 8
or below but cannot be invoked if the connector is built using JDK 9 or
above using new signatures for methods overridden. To be compatible
with JREs before 9, it possible to cast ByteBuffer to Buffer class
explicitly. As a result, a method will be called which is available in
older versions but it breaks conciseness of the code.

Closes: #215
@nicktorwald nicktorwald force-pushed the highpower/issue-215-fix branch from a5d441c to 43d72df Compare August 22, 2019 11:40
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Totktonada Totktonada merged commit 1f5c92d into master Aug 30, 2019
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.

Exception is thrown while connecting to tarantool instance
2 participants