From 3356925c7aa0de6928c82b95308e7a11f0dc8276 Mon Sep 17 00:00:00 2001 From: David Perez Date: Wed, 10 Sep 2025 08:41:41 -0500 Subject: [PATCH] Update to Java 21 (#5835) --- .github/workflows/build-authenticator.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- README.md | 6 +++--- .../FlightRecorderDataSetExtensionsTest.kt | 2 +- .../LoginApprovalViewModelTest.kt | 2 +- .../FlightRecorderDataSetExtensionsTest.kt | 2 +- .../settings/other/OtherViewModelTest.kt | 4 ++-- .../PasswordHistoryViewModelTest.kt | 2 +- .../send/util/SendDataExtensionsTest.kt | 4 ++-- .../viewsend/util/SendViewExtensionsTest.kt | 4 ++-- .../addedit/util/CipherViewExtensionsTest.kt | 4 ++-- .../feature/item/util/VaultItemTestUtil.kt | 12 +++++------ .../FlightRecorderDataSetExtensionsTest.kt | 2 +- .../util/TemporalAccessorExtensionsTest.kt | 20 +++++++++---------- gradle/libs.versions.toml | 2 +- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build-authenticator.yml b/.github/workflows/build-authenticator.yml index 5b6e1c10ba..cb687089db 100644 --- a/.github/workflows/build-authenticator.yml +++ b/.github/workflows/build-authenticator.yml @@ -28,7 +28,7 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JAVA_VERSION: 17 + JAVA_VERSION: 21 permissions: contents: read diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ae3888413..f24a2662f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JAVA_VERSION: 17 + JAVA_VERSION: 21 GITHUB_ACTION_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" permissions: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87625aca4d..d4ed74b40a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - _JAVA_VERSION: 17 + _JAVA_VERSION: 21 _GITHUB_ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }} diff --git a/README.md b/README.md index 4056b40537..1014da08a8 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,12 @@ Please avoid mixing formatting and logical changes in the same commit/PR. When possible, fix any large formatting issues in a separate PR before opening one to make logical changes to the same code. This helps others focus on the meaningful code changes when reviewing the code. -4. Setup JDK `Version` `17`: +4. Setup JDK `Version` `21`: - Navigate to `Preferences > Build, Execution, Deployment > Build Tools > Gradle`. - Hit the selected Gradle JDK next to `Gradle JDK:`. - - Select a `17.x` version or hit `Download JDK...` if not present. - - Select `Version` `17`. + - Select a `21.x` version or hit `Download JDK...` if not present. + - Select `Version` `21`. - Select your preferred `Vendor`. - Hit `Download`. - Hit `Apply`. diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/about/util/FlightRecorderDataSetExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/about/util/FlightRecorderDataSetExtensionsTest.kt index 70b364c082..7b7e5883f5 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/about/util/FlightRecorderDataSetExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/about/util/FlightRecorderDataSetExtensionsTest.kt @@ -46,7 +46,7 @@ class FlightRecorderDataSetExtensionsTest { ), ) val result = dataset.getStopsLoggingStringForActiveLog(clock = FIXED_CLOCK) - assertEquals(BitwardenString.stops_logging_on.asText("1/21/70", "4:27 AM"), result) + assertEquals(BitwardenString.stops_logging_on.asText("1/21/70", "4:27\u202FAM"), result) } } diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt index 6724f0d98d..ef75d74486 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt @@ -195,7 +195,7 @@ class LoginApprovalViewModelTest : BaseViewModelTest() { email = EMAIL, fingerprint = AUTH_REQUEST.fingerprint, ipAddress = AUTH_REQUEST.ipAddress, - time = "9/13/24, 12:00 AM", + time = "9/13/24, 12:00\u202FAM", ), ) val viewModel = createViewModel() diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/flightrecorder/recordedlogs/util/FlightRecorderDataSetExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/flightrecorder/recordedlogs/util/FlightRecorderDataSetExtensionsTest.kt index bd80f315aa..f7a3e50234 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/flightrecorder/recordedlogs/util/FlightRecorderDataSetExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/flightrecorder/recordedlogs/util/FlightRecorderDataSetExtensionsTest.kt @@ -124,7 +124,7 @@ class FlightRecorderDataSetExtensionsTest { id = "51", title = "2015-10-10T02:55:52 – 2015-10-10T03:55:52".asText(), subtextStart = "1.00 KB".asText(), - subtextEnd = BitwardenString.expires_at.asText("10:15 PM"), + subtextEnd = BitwardenString.expires_at.asText("10:15\u202FPM"), isDeletedEnabled = true, ), RecordedLogsState.DisplayItem( diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherViewModelTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherViewModelTest.kt index d38ffe0c59..c9afd7f26f 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherViewModelTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/other/OtherViewModelTest.kt @@ -157,7 +157,7 @@ class OtherViewModelTest : BaseViewModelTest() { mutableVaultLastSyncStateFlow.tryEmit(newSyncTime) assertEquals( DEFAULT_STATE.copy( - lastSyncTime = "Oct 27, 2023, 12:00 PM", + lastSyncTime = "Oct 27, 2023, 12:00\u202FPM", dialogState = null, ), awaitItem(), @@ -236,6 +236,6 @@ private val DEFAULT_STATE = OtherState( allowScreenCapture = false, allowSyncOnRefresh = false, clearClipboardFrequency = ClearClipboardFrequency.NEVER, - lastSyncTime = "Oct 26, 2023, 12:00 PM", + lastSyncTime = "Oct 26, 2023, 12:00\u202FPM", dialogState = null, ) diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt index 85ddd0a2db..0e0af360ef 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt @@ -172,7 +172,7 @@ class PasswordHistoryViewModelTest : BaseViewModelTest() { passwords = listOf( PasswordHistoryState.GeneratedPassword( password = "mockPassword-1", - date = "10/27/23, 12:00 PM", + date = "10/27/23, 12:00\u202FPM", ), ), ), diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/util/SendDataExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/util/SendDataExtensionsTest.kt index 564caf40d2..394ea37509 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/util/SendDataExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/util/SendDataExtensionsTest.kt @@ -78,7 +78,7 @@ class SendDataExtensionsTest { SendState.ViewState.Content.SendItem( id = "mockId-1", name = "mockName-1", - deletionDate = "Oct 27, 2023, 12:00 PM", + deletionDate = "Oct 27, 2023, 12:00\u202FPM", type = SendState.ViewState.Content.SendItem.Type.FILE, iconList = DEFAULT_SEND_STATUS_ICONS, shareUrl = "www.test.com/#/send/mockAccessId-1/mockKey-1", @@ -87,7 +87,7 @@ class SendDataExtensionsTest { SendState.ViewState.Content.SendItem( id = "mockId-2", name = "mockName-2", - deletionDate = "Oct 27, 2023, 12:00 PM", + deletionDate = "Oct 27, 2023, 12:00\u202FPM", type = SendState.ViewState.Content.SendItem.Type.TEXT, iconList = DEFAULT_SEND_STATUS_ICONS, shareUrl = "www.test.com/#/send/mockAccessId-2/mockKey-2", diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/viewsend/util/SendViewExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/viewsend/util/SendViewExtensionsTest.kt index 023fc99e17..0c7833f7e9 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/viewsend/util/SendViewExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/viewsend/util/SendViewExtensionsTest.kt @@ -48,7 +48,7 @@ class SendViewExtensionsTest { ), shareLink = sendUrl, sendName = "mockName-1", - deletionDate = "Oct 27, 2023, 12:00 PM", + deletionDate = "Oct 27, 2023, 12:00\u202FPM", maxAccessCount = 1, currentAccessCount = 1, notes = "mockNotes-1", @@ -76,7 +76,7 @@ class SendViewExtensionsTest { ), shareLink = sendUrl, sendName = "mockName-2", - deletionDate = "Oct 27, 2023, 12:00 PM", + deletionDate = "Oct 27, 2023, 12:00\u202FPM", maxAccessCount = 1, currentAccessCount = 1, notes = "mockNotes-2", diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt index f3a411a775..5e248b4f18 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt @@ -217,7 +217,7 @@ class CipherViewExtensionsTest { totp = "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example", canViewPassword = false, fido2CredentialCreationDateTime = BitwardenString.created_x.asText( - "Oct 27, 2023, 12:00 PM", + "Oct 27, 2023, 12:00\u202FPM", ), ), ), @@ -278,7 +278,7 @@ class CipherViewExtensionsTest { totp = totp, canViewPassword = false, fido2CredentialCreationDateTime = BitwardenString.created_x.asText( - "Oct 27, 2023, 12:00 PM", + "Oct 27, 2023, 12:00\u202FPM", ), ), ), diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt index 1bb6a2f29a..a077925634 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/util/VaultItemTestUtil.kt @@ -170,8 +170,8 @@ fun createCommonContent( if (isEmpty) { VaultItemState.ViewState.Content.Common( name = "mockName", - created = BitwardenString.created.asText("Jan 1, 1970, 12:16 AM"), - lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16 AM"), + created = BitwardenString.created.asText("Jan 1, 1970, 12:16\u202FAM"), + lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16\u202FAM"), notes = null, customFields = emptyList(), requiresCloneConfirmation = false, @@ -188,8 +188,8 @@ fun createCommonContent( } else { VaultItemState.ViewState.Content.Common( name = "mockName", - created = BitwardenString.created.asText("Jan 1, 1970, 12:16 AM"), - lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16 AM"), + created = BitwardenString.created.asText("Jan 1, 1970, 12:16\u202FAM"), + lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16\u202FAM"), notes = "Lots of notes", customFields = listOf( FieldView( @@ -271,7 +271,7 @@ fun createLoginContent(isEmpty: Boolean): VaultItemState.ViewState.Content.ItemT ) }, passwordRevisionDate = BitwardenString.password_last_updated - .asText("Jan 1, 1970, 12:16 AM") + .asText("Jan 1, 1970, 12:16\u202FAM") .takeUnless { isEmpty }, isPremiumUser = true, totpCodeItemData = TotpCodeItemData( @@ -281,7 +281,7 @@ fun createLoginContent(isEmpty: Boolean): VaultItemState.ViewState.Content.ItemT ) .takeUnless { isEmpty }, fido2CredentialCreationDateText = BitwardenString.created_x - .asText("Oct 27, 2023, 12:00 PM") + .asText("Oct 27, 2023, 12:00\u202FPM") .takeUnless { isEmpty }, canViewTotpCode = true, ) diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/FlightRecorderDataSetExtensionsTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/FlightRecorderDataSetExtensionsTest.kt index 3fa1576e2e..327e3bdb04 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/FlightRecorderDataSetExtensionsTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/FlightRecorderDataSetExtensionsTest.kt @@ -69,7 +69,7 @@ class FlightRecorderDataSetExtensionsTest { assertEquals( BitwardenSnackbarData( message = BitwardenString.flight_recorder_banner_message - .asText("4/12/25", "9:15 AM"), + .asText("4/12/25", "9:15\u202FAM"), messageHeader = BitwardenString.flight_recorder_banner_title.asText(), actionLabel = BitwardenString.go_to_settings.asText(), withDismissAction = true, diff --git a/core/src/test/kotlin/com/bitwarden/core/data/util/TemporalAccessorExtensionsTest.kt b/core/src/test/kotlin/com/bitwarden/core/data/util/TemporalAccessorExtensionsTest.kt index 507c1c99d2..5790e0e123 100644 --- a/core/src/test/kotlin/com/bitwarden/core/data/util/TemporalAccessorExtensionsTest.kt +++ b/core/src/test/kotlin/com/bitwarden/core/data/util/TemporalAccessorExtensionsTest.kt @@ -102,7 +102,7 @@ class TemporalAccessorExtensionsTest { // US locale assertEquals( - "3:30 PM", + "3:30\u202FPM", instant.toFormattedTimeStyle( timeStyle = FormatStyle.SHORT, locale = Locale.US, @@ -110,7 +110,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "3:30:00 PM", + "3:30:00\u202FPM", instant.toFormattedTimeStyle( timeStyle = FormatStyle.MEDIUM, locale = Locale.US, @@ -118,7 +118,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "3:30:00 PM Z", + "3:30:00\u202FPM Z", instant.toFormattedTimeStyle( timeStyle = FormatStyle.LONG, locale = Locale.US, @@ -126,7 +126,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "3:30:00 PM Z", + "3:30:00\u202FPM Z", instant.toFormattedTimeStyle( timeStyle = FormatStyle.FULL, locale = Locale.US, @@ -175,7 +175,7 @@ class TemporalAccessorExtensionsTest { // US locale assertEquals( - "12/10/23, 3:30 PM", + "12/10/23, 3:30\u202FPM", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.SHORT, timeStyle = FormatStyle.SHORT, @@ -184,7 +184,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "Dec 10, 2023, 3:30:00 PM", + "Dec 10, 2023, 3:30:00\u202FPM", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.MEDIUM, timeStyle = FormatStyle.MEDIUM, @@ -193,7 +193,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "December 10, 2023 at 3:30:00 PM Z", + "December 10, 2023, 3:30:00\u202FPM Z", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.LONG, timeStyle = FormatStyle.LONG, @@ -202,7 +202,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "Sunday, December 10, 2023 at 3:30:00 PM Z", + "Sunday, December 10, 2023, 3:30:00\u202FPM Z", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.FULL, timeStyle = FormatStyle.FULL, @@ -231,7 +231,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "10 December 2023 at 15:30:00 Z", + "10 December 2023, 15:30:00 Z", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.LONG, timeStyle = FormatStyle.LONG, @@ -240,7 +240,7 @@ class TemporalAccessorExtensionsTest { ), ) assertEquals( - "Sunday, 10 December 2023 at 15:30:00 Z", + "Sunday, 10 December 2023, 15:30:00 Z", instant.toFormattedDateTimeStyle( dateStyle = FormatStyle.FULL, timeStyle = FormatStyle.FULL, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b7571790a6..b0a6662bc5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -41,7 +41,7 @@ googleServices = "4.4.3" googleReview = "2.0.2" hilt = "2.57.1" junit5 = "5.13.4" -jvmTarget = "17" +jvmTarget = "21" # kotlin and ksp **must** use compatible versions, do not update either without the other. kotlin = "2.2.10" kotlinxCollectionsImmutable = "0.4.0"