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

Use supermethod instead of ByteBuffer#clear for binary compatibility #9666

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Aug 3, 2023

Since we build with java >8 but without -release 8, ByteBuffer.clear() and some similar methods use the new overrides that are not available for java 8.

Fixes #9637

Since we build with java >8 but without `-release 8`, `ByteBuffer.clear()` and some similar methods use the new overrides that are not available for java 8.

Fixes #9637
@yawkat yawkat requested a review from melix August 3, 2023 08:46
@yawkat
Copy link
Member Author

yawkat commented Aug 3, 2023

@melix ive checked and this configuration detects this failure (and confirms it's fixed):

Index: http/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/http/build.gradle b/http/build.gradle
--- a/http/build.gradle	(revision b78e7ba8be97f8971b8b83f5fd3883677749ca41)
+++ b/http/build.gradle	(date 1691052181820)
@@ -1,6 +1,7 @@
 plugins {
     id "io.micronaut.build.internal.convention-library"
     id "org.jetbrains.kotlin.jvm"
+    id 'ru.vyarus.animalsniffer' version '1.7.1'
 }
 
 dependencies {
@@ -19,6 +20,8 @@
     testImplementation project(":inject")
     testImplementation project(":runtime")
     testImplementation(libs.managed.logback)
+
+    signature 'org.codehaus.mojo.signature:java18:1.0@signature'
 }
 
 tasks.named("compileKotlin") {

do you think we could add something like this to the project?

Copy link
Contributor

@melix melix left a comment

Choose a reason for hiding this comment

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

I'm not super keen on adding the plugin to detect such issues. 2 reasons:

  1. we don't know how it behaves in general, it's easy to add a plugin which breaks caching, up-to-date checking, etc...
  2. we don't need this in Micronaut 4, because we build with the required JDKs

@yawkat
Copy link
Member Author

yawkat commented Aug 3, 2023

@sdelamo is 3.10.x fine for this or do you think a further backport is necessary?

@sonarcloud
Copy link

sonarcloud bot commented Aug 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.19) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@sdelamo
Copy link
Contributor

sdelamo commented Aug 3, 2023

@sdelamo is 3.10.x fine for this or do you think a further backport is necessary?

We probably should backport at least to 3.8.x which is the branch originally mentioned in the issue.

@sdelamo sdelamo merged commit ea62a1d into 3.10.x Aug 3, 2023
11 checks passed
@sdelamo sdelamo deleted the java8-buffer branch August 3, 2023 10:13
sdelamo pushed a commit that referenced this pull request Aug 3, 2023
…9666)

* Use supermethod instead of ByteBuffer#clear for binary compatibility
Since we build with java >8 but without `-release 8`, `ByteBuffer.clear()` and some similar methods use the new overrides that are not available for java 8.

Fixes #9637

* add comment
@sdelamo
Copy link
Contributor

sdelamo commented Aug 3, 2023

@yawkat I cherry picked into 3.8.x

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

3 participants