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

Build with Java 21 #3570

Merged
merged 2 commits into from Sep 21, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [11, 17]
java_version: [11, 17, 21]
os:
- ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-release.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'maven'
server-id: ossrh
server-username: ${{ secrets.CI_DEPLOY_USERNAME }}
Expand Down
6 changes: 6 additions & 0 deletions metrics-core/pom.xml
Expand Up @@ -66,5 +66,11 @@
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -1,5 +1,7 @@
package com.codahale.metrics;

import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -42,9 +44,12 @@ public void setUp() throws Exception {
when(clock.getTime()).thenReturn(1363568676000L);
// JDK9 has changed the java.text.DateFormat API implementation according to Unicode.
// See http://mail.openjdk.java.net/pipermail/jdk9-dev/2017-April/005732.html
dateHeader = System.getProperty("java.version").startsWith("1.8") ?
dateHeader = SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8) ?
"3/17/13 6:04:36 PM =============================================================" :
"3/17/13, 6:04:36 PM ============================================================";
// https://bugs.openjdk.org/browse/JDK-8304925
SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_20) ?
"3/17/13, 6:04:36\u202FPM ============================================================" :
"3/17/13, 6:04:36 PM ============================================================";
}

@Test
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -67,6 +67,7 @@
<mockito.version>5.5.0</mockito.version>
<junit.version>4.13.1</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<errorprone.version>2.21.1</errorprone.version>
<errorprone.javac.version>9+181-r4173-1</errorprone.javac.version>
Expand Down