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

Fix to avoid incompatibility if compile with jdk9 #114

Open
wants to merge 10,000 commits into
base: trunk
Choose a base branch
from
Open

Fix to avoid incompatibility if compile with jdk9 #114

wants to merge 10,000 commits into from

Conversation

nroduit
Copy link

@nroduit nroduit commented Jul 31, 2017

Java 9 introduces overridden methods with covariant return types for the following methods in java.nio.ByteBuffer:

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

In Java 9 they all now return ByteBuffer, whereas the methods they override return Buffer,
resulting in exceptions like this when executing on Java 8 and lower:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer
This is because the generated byte code includes the static return type of the method, which is not found on Java 8 and lower because the overloaded methods with covariant return types don't exist (the issue appears even with source and target 8 or lower in compilation parameters).
The solution is to cast ByteBuffer instances to Buffer before calling the method.

stefanseifert and others added 30 commits March 9, 2017 21:04
Also fixed an issue in which sometimes objects were considered as JavaBeans when they shouldn't have.


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1786376 13f79535-47bb-0310-9956-ffa450edef68
…Add new mapping rule for 20$ to hyphen

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1787016 13f79535-47bb-0310-9956-ffa450edef68
…for multiple cardinality reference with multiple component instances

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1787202 13f79535-47bb-0310-9956-ffa450edef68
…tion.Annotation methods properly

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1787280 13f79535-47bb-0310-9956-ffa450edef68
…ttributes containing non color attributes

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1788071 13f79535-47bb-0310-9956-ffa450edef68
Patch applied on behalf of Kerry Billingham with many thanks!
This closes #98


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1788110 13f79535-47bb-0310-9956-ffa450edef68
@DCNick3 DCNick3 mentioned this pull request Jun 15, 2023
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.

7 participants