Skip to content

Commit

Permalink
Build with Java 21 (#3570)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Sep 21, 2023
1 parent 0c7474a commit 8f05798
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
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.22.0</errorprone.version>
<errorprone.javac.version>9+181-r4173-1</errorprone.javac.version>
Expand Down

0 comments on commit 8f05798

Please sign in to comment.