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

testPropertyGetMonthOfYear failures with CLDR 39 #674

Closed
cushon opened this issue Nov 21, 2022 · 0 comments
Closed

testPropertyGetMonthOfYear failures with CLDR 39 #674

cushon opened this issue Nov 21, 2022 · 0 comments

Comments

@cushon
Copy link

cushon commented Nov 21, 2022

Key information

  • Joda-Time version: 48b3002
  • Result of TimeZone.getDefault(): sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
  • Result of DateTimeZone.getDefault(): America/Los_Angeles

Problem description

When running on JDK 17, several Joda tests fail due to a change to the JDK's CLDR data: JDK-8265308

Test case

$ java -fullversion
openjdk full version "17.0.2+8-86"
$ mvn clean test
...
[ERROR] Tests run: 4232, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 2.129 s <<< FAILURE! - in org.joda.time.TestAllPackages
[ERROR] testPropertyGetMonthOfYear(org.joda.time.TestDateTime_Properties)  Time elapsed: 0.004 s  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<3> but was:<4>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotEquals(Assert.java:280)
        at junit.framework.Assert.assertEquals(Assert.java:64)
        at junit.framework.Assert.assertEquals(Assert.java:198)
        at junit.framework.Assert.assertEquals(Assert.java:204)
        at org.joda.time.TestDateTime_Properties.testPropertyGetMonthOfYear(TestDateTime_Properties.java:361)

[ERROR] testPropertyGetMonthOfYear(org.joda.time.TestMutableDateTime_Properties)  Time elapsed: 0 s  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<3> but was:<4>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotEquals(Assert.java:280)
        at junit.framework.Assert.assertEquals(Assert.java:64)
        at junit.framework.Assert.assertEquals(Assert.java:198)
        at junit.framework.Assert.assertEquals(Assert.java:204)
        at org.joda.time.TestMutableDateTime_Properties.testPropertyGetMonthOfYear(TestMutableDateTime_Properties.java:247)

[ERROR] testPropertyGetMonthOfYear(org.joda.time.TestDateMidnight_Properties)  Time elapsed: 0 s  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<3> but was:<4>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotEquals(Assert.java:280)
        at junit.framework.Assert.assertEquals(Assert.java:64)
        at junit.framework.Assert.assertEquals(Assert.java:198)
        at junit.framework.Assert.assertEquals(Assert.java:204)
        at org.joda.time.TestDateMidnight_Properties.testPropertyGetMonthOfYear(TestDateMidnight_Properties.java:238)

[ERROR] testPropertyGetMonthOfYear(org.joda.time.TestMonthDay_Properties)  Time elapsed: 0.001 s  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<Sep[]> but was:<Sep[t]>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at junit.framework.Assert.assertEquals(Assert.java:87)
        at org.joda.time.TestMonthDay_Properties.testPropertyGetMonthOfYear(TestMonthDay_Properties.java:93)

Since the JDK 17 javac doesn't support -source 5 -target 5 I had to update the build to use Java 8, but compiling the tests as Java 5 and running on JDK 17 would reproduce the same issue:

git diff
diff --git a/pom.xml b/pom.xml
index 486dd702..d6e60402 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1069,8 +1069,8 @@
     <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
     <!-- Properties for maven-compiler-plugin -->
     <maven.compiler.compilerVersion>1.5</maven.compiler.compilerVersion>
-    <maven.compiler.source>1.5</maven.compiler.source>
-    <maven.compiler.target>1.5</maven.compiler.target>
+    <maven.compiler.source>8</maven.compiler.source>
+    <maven.compiler.target>8</maven.compiler.target>
     <maven.compiler.fork>true</maven.compiler.fork>
     <maven.compiler.verbose>false</maven.compiler.verbose>
     <maven.compiler.optimize>true</maven.compiler.optimize>
jodastephen added a commit that referenced this issue Mar 5, 2023
jodastephen added a commit that referenced this issue Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants