Skip to content

Conversation

@zrlw
Copy link
Contributor

@zrlw zrlw commented Nov 5, 2025

What's Changed

  1. Remove jdk9-compile profile configuration from pom.xml. For now, Unsafe will be considered as nonexistent package if set maven.compiler.release, no matter the release is set to 8 or not. see details at There are difference between maven.compiler.release and maven.compiler.target during compiling projects which use sun.misc.Unsafe with JDK17+ maven-compiler-plugin#990
  2. Call position method of java.nio.Buffer instead of java.nio.ByteBuffer for the sake of jdk8 compatibility since position method had been moved from java.nio.Buffer to its subclass java.nio.ByteBuffer since jdk9+.

What is the purpose of the change?

The release configuration of jdk9-compile profile will cause trouble if we compile dubbo with jdk17+ and use sun.misc.Unsafe like this,

import sun.misc.Unsafe;

import static org.apache.dubbo.common.constants.CommonConstants.ThirdPartyProperty.GRAALVM_NATIVEIMAGE_IMAGECODE;

public abstract class NativeDetector {
    private Unsafe UNSAFE;
    ...
ea662096be573fa8a1eda6ec827d166c

Cause

sun.misc.Unsafe had been moved to jdk.unsupported module since jdk9+, it could not be added if set maven.compiler.release

When using --release to specify a release that supports the Java Platform Module System, the --add-exports option cannot be used to enlarge the set of packages exported by the Java SE, JDK, and standard modules in the specified release.

see details at https://docs.oracle.com/en/java/javase/25/docs/specs/man/javac.html#option-release

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.72%. Comparing base (84c4802) to head (445c86c).

Additional details and impacted files
@@            Coverage Diff            @@
##                3.3   #15755   +/-   ##
=========================================
  Coverage     60.72%   60.72%           
- Complexity    11695    11708   +13     
=========================================
  Files          1938     1938           
  Lines         88637    88637           
  Branches      13380    13380           
=========================================
+ Hits          53825    53828    +3     
+ Misses        29288    29285    -3     
  Partials       5524     5524           
Flag Coverage Δ
integration-tests-java21 32.40% <100.00%> (+0.01%) ⬆️
integration-tests-java8 32.52% <100.00%> (+0.06%) ⬆️
samples-tests-java21 32.03% <100.00%> (+0.03%) ⬆️
samples-tests-java8 29.61% <100.00%> (-0.04%) ⬇️
unit-tests-java11 59.02% <100.00%> (-0.01%) ⬇️
unit-tests-java17 58.53% <100.00%> (+0.02%) ⬆️
unit-tests-java21 58.50% <100.00%> (-0.02%) ⬇️
unit-tests-java25 58.47% <100.00%> (-0.03%) ⬇️
unit-tests-java8 58.99% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw zrlw force-pushed the 3.3-remove-jdk-compile-profile branch 2 times, most recently from e3333f1 to 9a3e96c Compare November 5, 2025 15:52
@zrlw zrlw changed the title Remove jdk9-compile profile from pom.xml Replace jdk9-compile profile release configuration with maven.compiler.target property Nov 5, 2025
@zrlw zrlw changed the title Replace jdk9-compile profile release configuration with maven.compiler.target property Replace jdk9-compile profile maven release configuration with maven.compiler.target property Nov 5, 2025
@zrlw zrlw changed the title Replace jdk9-compile profile maven release configuration with maven.compiler.target property Replace jdk9-compile profile maven compiler release configuration with maven.compiler.target property Nov 5, 2025
@zrlw zrlw force-pushed the 3.3-remove-jdk-compile-profile branch from 9a3e96c to fc46032 Compare November 6, 2025 01:53
@zrlw zrlw changed the title Replace jdk9-compile profile maven compiler release configuration with maven.compiler.target property Remove jdk9-compile profile from pom.xml Nov 6, 2025
@zrlw zrlw force-pushed the 3.3-remove-jdk-compile-profile branch from fc46032 to 1f76507 Compare November 6, 2025 02:47
@zrlw zrlw force-pushed the 3.3-remove-jdk-compile-profile branch from 1f76507 to 31feb7e Compare November 6, 2025 02:50
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.

2 participants