Skip to content

Commit

Permalink
Merge pull request #520 from keynmol/special-case-Z-ZoneOffset
Browse files Browse the repository at this point in the history
ZoneOffset.of("Z") must return UTC
  • Loading branch information
cquiroz authored Nov 6, 2024
2 parents f3b5cd0 + 8ed982f commit 3f25107
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ val scala3 = "3.3.3"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3)

ThisBuild / tlBaseVersion := "2.5"
ThisBuild / tlBaseVersion := "2.6"

ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false)

Expand Down
4 changes: 3 additions & 1 deletion core/shared/src/main/scala/org/threeten/bp/ZoneOffset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ object ZoneOffset {
var _offsetId = offsetId
Objects.requireNonNull(_offsetId, "offsetId")

// "Z" is always in the cache
if (_offsetId == "Z")
return ZoneOffset.UTC

val offset: ZoneOffset = ID_CACHE.get(_offsetId)
if (offset != null)
return offset
Expand Down

0 comments on commit 3f25107

Please sign in to comment.