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

Test on JDK 21 #13083

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
- name: "Compile Dubbo (Linux)"
run: |
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
- uses: actions/cache@v3
name: "Cache local Maven repository"
with:
Expand Down Expand Up @@ -328,11 +328,11 @@ jobs:
with:
repository: 'apache/dubbo-samples'
path: "./dubbo-samples"
- name: "Set up JDK 17"
- name: "Set up JDK 21"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21
- name: "Restore class result"
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -372,11 +372,11 @@ jobs:
ref: main
path: "./dubbo-test-tools"

- name: "Set up JDK 17"
- name: "Set up JDK 21"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: "Compile Dubbo (Linux)"
run: |
Expand Down
251 changes: 0 additions & 251 deletions .github/workflows/build-and-test-scheduled-3.0.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/build-and-test-scheduled-3.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 19, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
steps:
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 19, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
DUBBO_DEFAULT_SERIALIZATION: fastjson2
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 19, 21 ]
job_id: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
JAVA_VER: ${{matrix.jdk}}
strategy:
matrix:
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 19, 21 ]
steps:
- uses: actions/checkout@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public class MemorySafeLinkedBlockingQueue<E> extends LinkedBlockingQueue<E> {

public static int THE_256_MB = 256 * 1024 * 1024;

private int maxFreeMemory;
private long maxFreeMemory;

private Rejector<E> rejector;

public MemorySafeLinkedBlockingQueue() {
this(THE_256_MB);
}

public MemorySafeLinkedBlockingQueue(final int maxFreeMemory) {
public MemorySafeLinkedBlockingQueue(final long maxFreeMemory) {
super(Integer.MAX_VALUE);
this.maxFreeMemory = maxFreeMemory;
//default as DiscardPolicy to ensure compatibility with the old version
Expand Down Expand Up @@ -74,7 +74,7 @@ public void setMaxFreeMemory(final int maxFreeMemory) {
*
* @return the max free memory limit
*/
public int getMaxFreeMemory() {
public long getMaxFreeMemory() {
return maxFreeMemory;
}

Expand Down
14 changes: 14 additions & 0 deletions dubbo-common/src/main/java/org/apache/dubbo/common/utils/JRE.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ public enum JRE {

JAVA_19,

JAVA_20,

JAVA_21,

JAVA_22,

JAVA_23,

OTHER;

private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(JRE.class);
Expand Down Expand Up @@ -113,6 +121,12 @@ private static JRE getJre() {
return JAVA_18;
case 19:
return JAVA_19;
case 20:
return JAVA_20;
case 21:
return JAVA_21;
case 22:
return JAVA_22;
default:
return OTHER;
}
Expand Down
Loading
Loading