New Upstream Release - libjoda-time-java
Ready changes
Summary
Merged new upstream version: 2.12.5 (was: 2.12.1).
Resulting package
Built on 2023-04-19T14:29 (took 6m34s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases libjoda-time-java
Lintian Result
Diff
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..26aa42f9
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,10 @@
+# Dependabot config
+
+version: 2
+updates:
+- package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: weekly
+ time: "02:30"
+ open-pull-requests-limit: 20
diff --git a/.github/website.sh b/.github/website.sh
index 8dfce3ba..8194de0a 100644
--- a/.github/website.sh
+++ b/.github/website.sh
@@ -16,9 +16,9 @@ cp -R ../site joda-time/
echo "## update..."
git add -A
git status
-git commit --message "Update joda-time from Travis: Build $TRAVIS_BUILD_NUMBER"
+git commit --message "Update joda-time from CI: $GITHUB_ACTION"
echo "## push..."
-git push origin master
+git push origin main
echo "## done"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 232b8ece..cb624287 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,36 +11,47 @@ on:
- 'website*'
pull_request:
branches:
- - 'master'
+ - 'main'
+
+permissions:
+ contents: read
jobs:
build:
+ permissions:
+ security-events: write # for github/codeql-action
runs-on: ubuntu-latest
-
+ env:
+ MAVEN_ARGS: -e -B -DtrimStackTrace=false
+
steps:
- - name: Set up JDK
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- name: Checkout
- uses: actions/checkout@v2
- - name: Maven cache
- uses: actions/cache@v1
+ uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
+
+ - name: Set up JDK
+ uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 #v3.10.0
with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('.github/workflows/build.yml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
+ java-version: 8
+ distribution: 'temurin'
+ cache: 'maven'
+
- name: Maven version
run: |
- mkdir -p ./.mvn
- echo '-e -B -DtrimStackTrace=false' > ./.mvn/maven.config
mvn --version
mkdir -p target
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@8aff97f12c99086bdb92ff62ae06dbbcdf07941b #codeql-bundle-20221105
+ with:
+ languages: java
+
- name: Maven build
run: |
mvn install site
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@8aff97f12c99086bdb92ff62ae06dbbcdf07941b #codeql-bundle-20221105
+
- name: Website
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/website') || startsWith(github.ref, 'refs/tags/v'))
env:
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
new file mode 100644
index 00000000..c079aeea
--- /dev/null
+++ b/.github/workflows/cifuzz.yml
@@ -0,0 +1,31 @@
+name: CIFuzz
+on: [pull_request]
+permissions:
+# to fetch the artifacts
+ actions: read
+# to clone the repo
+ contents: read
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Build Fuzzers
+ id: build
+ uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@01544e953848869e7e359156d2b1a877deb98286
+ with:
+ oss-fuzz-project-name: 'joda-time'
+ dry-run: false
+ language: jvm
+ - name: Run Fuzzers
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@01544e953848869e7e359156d2b1a877deb98286
+ with:
+ oss-fuzz-project-name: 'joda-time'
+ fuzz-seconds: 300
+ dry-run: false
+ language: jvm
+ - name: Upload Crash
+ uses: actions/upload-artifact@v3
+ if: failure() && steps.build.outcome == 'success'
+ with:
+ name: artifacts
+ path: ./out/artifacts
diff --git a/.github/workflows/tzdbupdate.yml b/.github/workflows/tzdbupdate.yml
index 962d24be..770d5dbd 100644
--- a/.github/workflows/tzdbupdate.yml
+++ b/.github/workflows/tzdbupdate.yml
@@ -2,38 +2,38 @@ name: TZDB check
on:
push:
- branches:
- - 'master'
+ tags:
+ - 'tzdb*'
schedule:
- cron: '50 1 * * *'
+permissions:
+ contents: read
+
jobs:
tzdbcheck:
+ permissions:
+ contents: write # for peter-evans/create-pull-request to create branch
+ pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-latest
+ env:
+ MAVEN_ARGS: -e -B -DtrimStackTrace=false
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
with:
token: ${{ secrets.PERSONAL_TOKEN_GH }}
- - name: Maven cache
- uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('.github/workflows/tzdbupdate.yml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
-
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
+ - name: Set up JDK
+ uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 #v3.10.0
with:
- java-version: 1.8
+ java-version: '8'
+ distribution: 'corretto'
+ cache: 'maven'
- name: Maven version
run: |
- mkdir -p ./.mvn
- echo '-e -B -DtrimStackTrace=false' > ./.mvn/maven.config
mvn --version
mkdir -p target
@@ -92,11 +92,12 @@ jobs:
- name: Create Pull Request
if: env.NOOP != 'true'
id: createpr
- uses: peter-evans/create-pull-request@v3.10.1
+ uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad #v3.10.1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN_GH }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
+ base: main
commit-message: 'Update time zone data to ${{ env.LATEST_TZDB }}'
committer: Stephen Colebourne (CI) <scolebourne@joda.org>
author: Stephen Colebourne (CI) <scolebourne@joda.org>
diff --git a/README.md b/README.md
index b4ec31f6..8fa19c42 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,9 @@ public String getBirthMonthText(LocalDate dateOfBirth) {
Joda-Time is licensed under the business-friendly [Apache 2.0 licence](https://www.joda.org/joda-time/licenses.html).
+![Tidelift dependency check](https://tidelift.com/badges/github/JodaOrg/joda-time)
+[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6310/badge)](https://bestpractices.coreinfrastructure.org/projects/6310)
+
### Documentation
Various documentation is available:
@@ -51,7 +54,7 @@ Various documentation is available:
### Releases
-[Release 2.10.14](https://www.joda.org/joda-time/download.html) is the current latest release.
+[Release 2.12.5](https://www.joda.org/joda-time/download.html) is the current latest release.
This release is considered stable and worthy of the 2.x tag.
It depends on JDK 1.5 or later.
@@ -62,17 +65,15 @@ Available in the [Maven Central repository](https://search.maven.org/search?q=g:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>2.10.14</version>
+ <version>2.12.5</version>
</dependency>
```
**Gradle configuration:**
```groovy
-compile 'joda-time:joda-time:2.10.14'
+compile 'joda-time:joda-time:2.12.5'
```
-![Tidelift dependency check](https://tidelift.com/badges/github/JodaOrg/joda-time)
-
### Related projects
Related projects at GitHub:
@@ -105,6 +106,17 @@ To report a security vulnerability, please use the [Tidelift security contact](h
Tidelift will coordinate the fix and disclosure.
+### Development and Contributions
+Joda-Time is developed using standard [GitHub tools](https://github.com/JodaOrg/joda-time).
+A [checkstyle](https://checkstyle.sourceforge.io/) file is available, and PRs must comply with it.
+The project can be built using [Apache Maven](https://maven.apache.org/), such as <code>mvn clean install</code>.
+Continuous Integration takes place using [GitHub Actions](https://github.com/JodaOrg/joda-time/actions).
+Units tests are written in [JUnit](https://junit.org/) and run as part of the build and continuous integration.
+Changes via PR must include appropiate test coverage.
+
+Note that Joda-Time is considered to be a largely “finished” project. No major enhancements are planned. If using Java SE 8, please migrate to java.time (JSR-310).
+
+
### Release process
* Update version (pom.xml, README.md, index.md, MANIFEST.MF, changes.xml)
diff --git a/debian/changelog b/debian/changelog
index a8b4a485..2d6ed0da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libjoda-time-java (2.12.5-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Wed, 19 Apr 2023 14:24:35 -0000
+
libjoda-time-java (2.10.14-1) unstable; urgency=medium
* New upstream release
diff --git a/pom.xml b/pom.xml
index c5250239..e3b0ae18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
<artifactId>joda-time</artifactId>
<packaging>jar</packaging>
<name>Joda-Time</name>
- <version>2.10.14</version>
+ <version>2.12.5</version>
<description>Date and time library to replace JDK date handling</description>
<url>https://www.joda.org/joda-time/</url>
@@ -41,6 +41,10 @@
</developer>
</developers>
<contributors>
+ <contributor>
+ <name>Sergi Almacellas Abellana</name>
+ <url>https://github.com/pokoli</url>
+ </contributor>
<contributor>
<name>Adrian Acala</name>
<url>https://github.com/AdrianAcala</url>
@@ -64,10 +68,18 @@
<name>Mikey Austin</name>
<url>https://github.com/mikey-austin</url>
</contributor>
+ <contributor>
+ <name>Dominik Baláž</name>
+ <url>https://github.com/dombalaz</url>
+ </contributor>
<contributor>
<name>Oren Benjamin</name>
<url>https://github.com/oby1</url>
</contributor>
+ <contributor>
+ <name>Besnik Bleta</name>
+ <url>https://github.com/ujdhesa</url>
+ </contributor>
<contributor>
<name>Fredrik Borgh</name>
</contributor>
@@ -147,6 +159,10 @@
<name>Kaj Hejer</name>
<url>https://github.com/kajh</url>
</contributor>
+ <contributor>
+ <name>Antonio Hernan</name>
+ <url>https://github.com/antoniohernan</url>
+ </contributor>
<contributor>
<name>Rowan Hill</name>
<url>https://github.com/rowanhill</url>
@@ -178,6 +194,10 @@
<name>Martin Kneissl</name>
<url>https://github.com/mkneissl</url>
</contributor>
+ <contributor>
+ <name>Kuunh</name>
+ <url>https://github.com/Kuunh</url>
+ </contributor>
<contributor>
<name>Sebastian Kurten</name>
<url>https://github.com/sebkur</url>
@@ -186,6 +206,10 @@
<name>Fabian Lange</name>
<url>https://github.com/CodingFabian</url>
</contributor>
+ <contributor>
+ <name>Mikel Larreategi</name>
+ <url>https://github.com/erral</url>
+ </contributor>
<contributor>
<name>Vidar Larsen</name>
<url>https://github.com/vlarsen</url>
@@ -225,6 +249,14 @@
<name>Paul Martin</name>
<url>https://github.com/pgpx</url>
</contributor>
+ <contributor>
+ <name>mo20053444</name>
+ <url>https://github.com/mo20053444</url>
+ </contributor>
+ <contributor>
+ <name>Mustofa</name>
+ <url>https://github.com/mustofa-id</url>
+ </contributor>
<contributor>
<name>Katy P</name>
<url>https://github.com/katyp</url>
@@ -262,6 +294,10 @@
<name>Zhanbolat Raimbekov</name>
<url>https://github.com/janbolat</url>
</contributor>
+ <contributor>
+ <name>H. Z. Sababa</name>
+ <url>https://github.com/hb20007</url>
+ </contributor>
<contributor>
<name>Mike Schrag</name>
</contributor>
@@ -291,6 +327,10 @@
<name>Grzegorz Swierczynski</name>
<url>https://github.com/gswierczynski</url>
</contributor>
+ <contributor>
+ <name>syafiqnazim</name>
+ <url>https://github.com/syafiqnazim</url>
+ </contributor>
<contributor>
<name>Dave Syer</name>
<url>https://github.com/dsyer</url>
@@ -379,7 +419,7 @@
<configuration>
<rules>
<requireMavenVersion>
- <version>3.5.0</version>
+ <version>3.6.0</version>
</requireMavenVersion>
</rules>
</configuration>
@@ -390,7 +430,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
- <version>1.4.0</version>
+ <version>3.1.0</version>
<executions>
<execution>
<id>compile-tzdb</id>
@@ -403,7 +443,6 @@
<configuration>
<mainClass>org.joda.time.tz.ZoneInfoCompiler</mainClass>
<classpathScope>compile</classpathScope>
- <verbose>true</verbose>
<systemProperties>
<systemProperty>
<key>org.joda.time.DateTimeZone.Provider</key>
@@ -549,7 +588,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
- <version>2.6.1</version>
+ <version>2.8</version>
<configuration>
<comparisonVersion>2.7</comparisonVersion>
<minSeverity>info</minSeverity>
@@ -851,7 +890,9 @@
</activation>
<properties>
<maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
+ <!-- two diferent ways to turn off doclint -->
<additionalparam>-Xdoclint:none</additionalparam>
+ <doclint>none</doclint>
</properties>
</profile>
<!-- Base deployment profile, activated by -Doss.repo -->
@@ -865,37 +906,61 @@
</activation>
<build>
<plugins>
- <!-- Sign artifacts -->
+ <!-- Use nexus plugin to directly release -->
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>${nexus-staging-maven-plugin.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <serverId>sonatype-joda-staging</serverId>
+ <description>Releasing ${project.groupId}:${project.artifactId}:${project.version}</description>
+ <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
+ <autoReleaseAfterClose>true</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ <!-- Create dist files -->
+ <!-- Since we cannot sign a single file, we put everything in the deploy phase -->
+ <!-- The standard files are signed in the verify phase and then deployed to Maven Central using nexus-staging-maven-plugin -->
+ <!-- Then (and only then) we create and attach the dist files, sign them, and release them to GitHub Releases -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
+ <artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
- <id>sign-artifacts</id>
- <phase>verify</phase>
+ <id>make-assembly</id>
+ <phase>deploy</phase>
<goals>
- <goal>sign</goal>
+ <goal>single</goal>
</goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/dist.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
</execution>
</executions>
</plugin>
- <!-- Create dist files -->
+ <!-- Sign artifacts, which now includes the dist files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <attach>false</attach>
- <descriptors>
- <descriptor>src/main/assembly/dist.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
+ <artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
- <id>make-assembly</id>
- <phase>install</phase>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
<goals>
- <goal>single</goal>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ <!-- this execution must be located after nexus-staging-maven-plugin (see comment above about ordering) -->
+ <execution>
+ <id>sign-dist-artifacts</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>sign</goal>
</goals>
</execution>
</executions>
@@ -905,21 +970,6 @@
<groupId>de.jutzig</groupId>
<artifactId>github-release-plugin</artifactId>
<version>1.4.0</version>
- <configuration>
- <releaseName>Release v${project.version}</releaseName>
- <description>See the [change notes](https://www.joda.org/joda-time/changes-report.html#a${project.version}) for more information.</description>
- <tag>v${project.version}</tag>
- <overwriteArtifact>true</overwriteArtifact>
- <fileSets>
- <fileSet>
- <directory>${project.build.directory}</directory>
- <includes>
- <include>${project.artifactId}*-dist.tar.gz</include>
- <include>${project.artifactId}*-dist.zip</include>
- </includes>
- </fileSet>
- </fileSets>
- </configuration>
<executions>
<execution>
<id>github-releases</id>
@@ -927,23 +977,27 @@
<goals>
<goal>release</goal>
</goals>
+ <configuration>
+ <releaseName>Release v${project.version}</releaseName>
+ <description>See the [change notes](https://www.joda.org/joda-time/changes-report.html#a${project.version}) for more information.</description>
+ <tag>v${project.version}</tag>
+ <overwriteArtifact>true</overwriteArtifact>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.directory}</directory>
+ <includes>
+ <include>${project.artifactId}-${project.version}-dist.tar.gz</include>
+ <include>${project.artifactId}-${project.version}-dist.tar.gz.asc</include>
+ <include>${project.artifactId}-${project.version}-dist.zip</include>
+ <include>${project.artifactId}-${project.version}-dist.zip.asc</include>
+ <include>${project.artifactId}-${project.version}.jar.asc</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </configuration>
</execution>
</executions>
</plugin>
- <!-- Use nexus plugin to directly release -->
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <version>${nexus-staging-maven-plugin.version}</version>
- <extensions>true</extensions>
- <configuration>
- <nexusUrl>https://oss.sonatype.org/</nexusUrl>
- <serverId>sonatype-joda-staging</serverId>
- <description>Releasing ${project.groupId}:${project.artifactId}:${project.version}</description>
- <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
- <autoReleaseAfterClose>true</autoReleaseAfterClose>
- </configuration>
- </plugin>
</plugins>
</build>
<properties>
@@ -990,32 +1044,32 @@
<!-- ==================================================================== -->
<properties>
<!-- Plugin version numbers -->
- <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
- <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
+ <build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
+ <maven-assembly-plugin.version>3.5.0</maven-assembly-plugin.version>
<maven-changes-plugin.version>2.12.1</maven-changes-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
- <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
- <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
- <maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
- <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
- <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
- <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
- <maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
- <maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
- <maven-plugin-plugin.version>3.5.2</maven-plugin-plugin.version>
- <maven-pmd-plugin.version>3.10.0</maven-pmd-plugin.version>
- <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
+ <maven-deploy-plugin.version>3.1.0</maven-deploy-plugin.version>
+ <maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version>
+ <maven-enforcer-plugin.version>3.2.1</maven-enforcer-plugin.version>
+ <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
+ <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
+ <maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
+ <maven-plugin-plugin.version>3.8.1</maven-plugin-plugin.version>
+ <maven-pmd-plugin.version>3.20.0</maven-pmd-plugin.version>
+ <maven-project-info-reports-plugin.version>3.4.2</maven-project-info-reports-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-repository-plugin.version>2.4</maven-repository-plugin.version>
- <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
- <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
- <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-site-plugin.version>3.12.1</maven-site-plugin.version>
+ <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<!-- Stick with this version of surefire, see Java 5 comments above -->
<maven-surefire-report-plugin.version>2.21.0</maven-surefire-report-plugin.version>
- <maven-toolchains-plugin.version>1.1</maven-toolchains-plugin.version>
- <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
+ <maven-toolchains-plugin.version>3.1.0</maven-toolchains-plugin.version>
+ <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>
@@ -1034,6 +1088,6 @@
<!-- Other properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <tz.database.version>2022agtz</tz.database.version>
+ <tz.database.version>2023cgtz</tz.database.version>
</properties>
</project>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 951908c7..5c54e004 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -8,6 +8,83 @@
<body>
<!-- types are add, fix, remove, update -->
+ <release version="2.12.5" date="2023-03-30" description="v2.12.5">
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2023cgtz.
+ </action>
+ </release>
+ <release version="2.12.4" date="2023-03-24" description="v2.12.4">
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2023bgtz.
+ </action>
+ </release>
+ <release version="2.12.3" date="2023-03-23" description="v2.12.3">
+ <action dev="antoniohernan" type="update">
+ Add translation for ga.
+ </action>
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2023agtz.
+ </action>
+ </release>
+ <release version="2.12.2" date="2022-12-01" description="v2.12.2">
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022ggtz.
+ </action>
+ </release>
+ <release version="2.12.1" date="2022-10-29" description="v2.12.1">
+ <action dev="various" type="add">
+ Add/fix translations for iw, sq.
+ </action>
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022fgtz.
+ </action>
+ </release>
+ <release version="2.12.0" date="2022-10-13" description="v2.12.0">
+ <action dev="various" type="add">
+ Add translations for ca, el, eu, fi, hi, hu, in, iw, ms, nn, ro, sk, sv, zh.
+ </action>
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022egtz.
+ </action>
+ </release>
+ <release version="2.11.2" date="2022-09-25" description="v2.11.2">
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022dgtz.
+ </action>
+ <action dev="jodastephen" type="update">
+ Switch LGTM to CodeQL.
+ </action>
+ </release>
+ <release version="2.11.1" date="2022-08-25" description="v2.11.1">
+ <action dev="jodastephen" type="update">
+ Update build scripts and fix static analysis warnings.
+ </action>
+ <action dev="jodastephen" type="update">
+ Switch master to main.
+ </action>
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022cgtz.
+ </action>
+ </release>
+ <release version="2.11.0" date="2022-08-12" description="v2.11.0">
+ <action dev="jodastephen" type="fix">
+ Change DateTimeZone to use 'org.joda.time.DateTimeZone.Timezone' instead of 'user.timezone'.
+ This change causes Joda-Time to query 'TimeZone.getDefault()' in most cases.
+ In most cases this change will have no effect on application code, as 'user.timezone' will be picked up by 'TimeZone.getDefault()' instead.
+ If you specifically need to stop Joda-Time calling 'TimeZone.getDefault()' then you will need to change
+ to use the new system property 'org.joda.time.DateTimeZone.Timezone'.
+ Fixes #587.
+ </action>
+ <action dev="jodastephen" type="fix">
+ Avoid using == on objects.
+ Fixes #581.
+ </action>
+ <action dev="jodastephen" type="update">
+ DateTimeZone data updated to version 2022bgtz.
+ This uses the new global-tz project that reinstates all the data removed by IANA's TZDB.
+ See https://github.com/JodaOrg/joda-time/issues/566
+ </action>
+ </release>
<release version="2.10.14" date="2022-03-20" description="v2.10.14">
<action dev="jodastephen" type="update">
DateTimeZone data updated to version 2022agtz.
diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF
index 60a6e02f..08456ce8 100644
--- a/src/conf/MANIFEST.MF
+++ b/src/conf/MANIFEST.MF
@@ -2,22 +2,22 @@ Package: org.joda.time
Extension-Name: joda-time
Specification-Title: Joda-Time
Specification-Vendor: Joda.org
-Specification-Version: 2.10
+Specification-Version: 2.12
Implementation-Vendor: Joda.org
Implementation-Title: org.joda.time
-Implementation-Version: 2.10.14
+Implementation-Version: 2.12.5
Implementation-Vendor-Id: org.joda
Bundle-ManifestVersion: 2
Bundle-Vendor: Joda.org
Bundle-Name: Joda-Time
Bundle-SymbolicName: joda-time
-Bundle-Version: 2.10.14
-Export-Package: org.joda.time;version=2.10.14,
- org.joda.time.base;version=2.10.14,
- org.joda.time.chrono;version=2.10.14,
- org.joda.time.convert;version=2.10.14,
- org.joda.time.field;version=2.10.14,
- org.joda.time.format;version=2.10.14,
- org.joda.time.tz;version=2.10.14
+Bundle-Version: 2.12.5
+Export-Package: org.joda.time;version=2.12.5,
+ org.joda.time.base;version=2.12.5,
+ org.joda.time.chrono;version=2.12.5,
+ org.joda.time.convert;version=2.12.5,
+ org.joda.time.field;version=2.12.5,
+ org.joda.time.format;version=2.12.5,
+ org.joda.time.tz;version=2.12.5
Bundle-License: Apache 2.0
Bundle-DocURL: https://www.joda.org/joda-time/
diff --git a/src/main/java/org/joda/time/Chronology.java b/src/main/java/org/joda/time/Chronology.java
index 1e49d229..3fdb4f93 100644
--- a/src/main/java/org/joda/time/Chronology.java
+++ b/src/main/java/org/joda/time/Chronology.java
@@ -501,6 +501,7 @@ public abstract class Chronology {
*
* @return a debugging string
*/
+ @Override
public abstract String toString();
}
diff --git a/src/main/java/org/joda/time/DateMidnight.java b/src/main/java/org/joda/time/DateMidnight.java
index addbb1e1..0fbfaed3 100644
--- a/src/main/java/org/joda/time/DateMidnight.java
+++ b/src/main/java/org/joda/time/DateMidnight.java
@@ -134,6 +134,7 @@ public final class DateMidnight
* This uses {@link ISODateTimeFormat#dateTimeParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed date-midnight, not null
* @since 2.0
*/
@FromString
@@ -146,6 +147,7 @@ public final class DateMidnight
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed date-midnight, not null
* @since 2.0
*/
public static DateMidnight parse(String str, DateTimeFormatter formatter) {
@@ -357,6 +359,7 @@ public final class DateMidnight
* @param chronology the chronology to use, not null
* @return the updated instant, rounded to midnight
*/
+ @Override
protected long checkInstant(long instant, Chronology chronology) {
return chronology.dayOfMonth().roundFloor(instant);
}
@@ -1261,6 +1264,7 @@ public final class DateMidnight
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -1270,6 +1274,7 @@ public final class DateMidnight
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getMillis();
}
@@ -1280,6 +1285,7 @@ public final class DateMidnight
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/DateTime.java b/src/main/java/org/joda/time/DateTime.java
index 7ce7cda5..cd910e03 100644
--- a/src/main/java/org/joda/time/DateTime.java
+++ b/src/main/java/org/joda/time/DateTime.java
@@ -142,6 +142,7 @@ public final class DateTime
* The object produced via the constructor has a zone of {@code DateTimeZone.getDefault()}.
*
* @param str the string to parse, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
@FromString
@@ -154,6 +155,7 @@ public final class DateTime
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
public static DateTime parse(String str, DateTimeFormatter formatter) {
@@ -539,6 +541,7 @@ public final class DateTime
*
* @return <code>this</code>
*/
+ @Override
public DateTime toDateTime() {
return this;
}
@@ -549,6 +552,7 @@ public final class DateTime
*
* @return a DateTime using the same millis
*/
+ @Override
public DateTime toDateTimeISO() {
if (getChronology() == ISOChronology.getInstance()) {
return this;
@@ -562,6 +566,7 @@ public final class DateTime
* @param zone time zone to apply, or default if null
* @return a DateTime using the same millis
*/
+ @Override
public DateTime toDateTime(DateTimeZone zone) {
zone = DateTimeUtils.getZone(zone);
if (getZone() == zone) {
@@ -576,6 +581,7 @@ public final class DateTime
* @param chronology chronology to apply, or ISOChronology if null
* @return a DateTime using the same millis
*/
+ @Override
public DateTime toDateTime(Chronology chronology) {
chronology = DateTimeUtils.getChronology(chronology);
if (getChronology() == chronology) {
@@ -2120,6 +2126,7 @@ public final class DateTime
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -2129,6 +2136,7 @@ public final class DateTime
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getMillis();
}
@@ -2139,6 +2147,7 @@ public final class DateTime
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/DateTimeComparator.java b/src/main/java/org/joda/time/DateTimeComparator.java
index f96846c0..f01f6a22 100644
--- a/src/main/java/org/joda/time/DateTimeComparator.java
+++ b/src/main/java/org/joda/time/DateTimeComparator.java
@@ -238,6 +238,7 @@ public class DateTimeComparator implements Comparator<Object>, Serializable {
* @param object the object to compare to
* @return true if equal
*/
+ @Override
public boolean equals(Object object) {
if (object instanceof DateTimeComparator) {
DateTimeComparator other = (DateTimeComparator) object;
@@ -254,6 +255,7 @@ public class DateTimeComparator implements Comparator<Object>, Serializable {
*
* @return the hashcode
*/
+ @Override
public int hashCode() {
return (iLowerLimit == null ? 0 : iLowerLimit.hashCode()) +
(123 * (iUpperLimit == null ? 0 : iUpperLimit.hashCode()));
@@ -264,6 +266,7 @@ public class DateTimeComparator implements Comparator<Object>, Serializable {
*
* @return a debugging string
*/
+ @Override
public String toString() {
if (iLowerLimit == iUpperLimit) {
return "DateTimeComparator["
diff --git a/src/main/java/org/joda/time/DateTimeField.java b/src/main/java/org/joda/time/DateTimeField.java
index 021f1af6..4be68395 100644
--- a/src/main/java/org/joda/time/DateTimeField.java
+++ b/src/main/java/org/joda/time/DateTimeField.java
@@ -682,6 +682,7 @@ public abstract class DateTimeField {
*
* @return debug string
*/
+ @Override
public abstract String toString();
}
diff --git a/src/main/java/org/joda/time/DateTimeFieldType.java b/src/main/java/org/joda/time/DateTimeFieldType.java
index 1085b35c..d69bd402 100644
--- a/src/main/java/org/joda/time/DateTimeFieldType.java
+++ b/src/main/java/org/joda/time/DateTimeFieldType.java
@@ -427,6 +427,7 @@ public abstract class DateTimeFieldType implements Serializable {
*
* @return debug string
*/
+ @Override
public String toString() {
return getName();
}
@@ -460,11 +461,13 @@ public abstract class DateTimeFieldType implements Serializable {
}
/** @inheritdoc */
+ @Override
public DurationFieldType getDurationType() {
return iUnitType;
}
/** @inheritdoc */
+ @Override
public DurationFieldType getRangeDurationType() {
return iRangeType;
}
@@ -488,6 +491,7 @@ public abstract class DateTimeFieldType implements Serializable {
}
/** @inheritdoc */
+ @Override
public DateTimeField getField(Chronology chronology) {
chronology = DateTimeUtils.getChronology(chronology);
diff --git a/src/main/java/org/joda/time/DateTimeZone.java b/src/main/java/org/joda/time/DateTimeZone.java
index 511b924e..735c3ad7 100644
--- a/src/main/java/org/joda/time/DateTimeZone.java
+++ b/src/main/java/org/joda/time/DateTimeZone.java
@@ -150,12 +150,14 @@ public abstract class DateTimeZone implements Serializable {
/**
* Gets the default time zone.
* <p>
- * The default time zone is derived from the system property {@code user.timezone}.
+ * The default time zone is derived from the system property {@code org.joda.time.DateTimeZone.Timezone}.
* If that is {@code null} or is not a valid identifier, then the value of the
* JDK {@code TimeZone} default is converted. If that fails, {@code UTC} is used.
* <p>
* NOTE: If the {@code java.util.TimeZone} default is updated <i>after</i> calling this
* method, then the change will not be picked up here.
+ * <p>
+ * NOTE: This previously checked the {@code user.timezone} property, see issue #587.
*
* @return the default datetime zone object
*/
@@ -164,7 +166,7 @@ public abstract class DateTimeZone implements Serializable {
if (zone == null) {
try {
try {
- String id = System.getProperty("user.timezone");
+ String id = System.getProperty("org.joda.time.DateTimeZone.Timezone");
if (id != null) { // null check avoids stack overflow
zone = forID(id);
}
@@ -1206,6 +1208,7 @@ public abstract class DateTimeZone implements Serializable {
* @param object the object to compare with
* @return true if equal, based on the ID and all internal rules
*/
+ @Override
public abstract boolean equals(Object object);
/**
@@ -1213,6 +1216,7 @@ public abstract class DateTimeZone implements Serializable {
*
* @return suitable hashcode
*/
+ @Override
public int hashCode() {
return 57 + getID().hashCode();
}
@@ -1221,6 +1225,7 @@ public abstract class DateTimeZone implements Serializable {
* Gets the datetime zone as a string, which is simply its ID.
* @return the id of the zone
*/
+ @Override
public String toString() {
return getID();
}
@@ -1230,6 +1235,7 @@ public abstract class DateTimeZone implements Serializable {
* referring to the id is written out. When the stub is read in, it
* replaces itself with a DateTimeZone object.
* @return a stub object to go in the stream
+ * @throws ObjectStreamException if the stream is invalid
*/
protected Object writeReplace() throws ObjectStreamException {
return new Stub(iID);
@@ -1281,15 +1287,19 @@ public abstract class DateTimeZone implements Serializable {
// initialization. Offset parser doesn't need it anyhow.
Chronology chrono = new BaseChronology() {
private static final long serialVersionUID = -3128740902654445468L;
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return this;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
return this;
}
+ @Override
public String toString() {
return getClass().getName();
}
diff --git a/src/main/java/org/joda/time/Days.java b/src/main/java/org/joda/time/Days.java
index e4dd1fec..44bbfb7b 100644
--- a/src/main/java/org/joda/time/Days.java
+++ b/src/main/java/org/joda/time/Days.java
@@ -231,6 +231,7 @@ public final class Days extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.days();
}
@@ -240,6 +241,7 @@ public final class Days extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.days();
}
@@ -483,6 +485,7 @@ public final class Days extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "P" + String.valueOf(getValue()) + "D";
diff --git a/src/main/java/org/joda/time/Duration.java b/src/main/java/org/joda/time/Duration.java
index cff18418..c3a23a40 100644
--- a/src/main/java/org/joda/time/Duration.java
+++ b/src/main/java/org/joda/time/Duration.java
@@ -54,6 +54,7 @@ public final class Duration
* This parses the format {@code PTa.bS}, as per {@link #toString()}.
*
* @param str the string to parse, not null
+ * @return the parsed duration, not null
* @since 2.0
*/
@FromString
@@ -291,6 +292,7 @@ public final class Duration
*
* @return <code>this</code>
*/
+ @Override
public Duration toDuration() {
return this;
}
diff --git a/src/main/java/org/joda/time/DurationField.java b/src/main/java/org/joda/time/DurationField.java
index 1eace1c9..55506036 100644
--- a/src/main/java/org/joda/time/DurationField.java
+++ b/src/main/java/org/joda/time/DurationField.java
@@ -283,31 +283,31 @@ public abstract class DurationField implements Comparable<DurationField> {
// */
// public abstract int compareTo(DurationField durationField);
- /**
- * Returns a localized unit name of this field, using the given value as an
- * aid. For example, the unit name may differ if it is plural.
- *
- * @param value the duration value to use for selecting a unit name
- * @param locale the locale to use for selecting a name, null for default
- */
- //String getUnitName(long value, Locale locale);
-
- /**
- * Returns a localized unit name of this field, using the given value as an
- * aid. For example, the unit name may differ if it is plural.
- *
- * @param value the duration value to use for selecting a unit name
- */
- //String getUnitName(long value);
-
- /**
- * Get the maximum length string returned by getUnitName.
- *
- * @param locale the locale to use for selecting a unit name, null for
- * default
- * @return the maximum name length
- */
- //int getMaximumUnitNameLength(Locale locale);
+// /**
+// * Returns a localized unit name of this field, using the given value as an
+// * aid. For example, the unit name may differ if it is plural.
+// *
+// * @param value the duration value to use for selecting a unit name
+// * @param locale the locale to use for selecting a name, null for default
+// */
+// //String getUnitName(long value, Locale locale);
+//
+// /**
+// * Returns a localized unit name of this field, using the given value as an
+// * aid. For example, the unit name may differ if it is plural.
+// *
+// * @param value the duration value to use for selecting a unit name
+// */
+// //String getUnitName(long value);
+//
+// /**
+// * Get the maximum length string returned by getUnitName.
+// *
+// * @param locale the locale to use for selecting a unit name, null for
+// * default
+// * @return the maximum name length
+// */
+// //int getMaximumUnitNameLength(Locale locale);
//------------------------------------------------------------------------
/**
@@ -315,6 +315,7 @@ public abstract class DurationField implements Comparable<DurationField> {
*
* @return debug string
*/
+ @Override
public abstract String toString();
}
diff --git a/src/main/java/org/joda/time/DurationFieldType.java b/src/main/java/org/joda/time/DurationFieldType.java
index c94e27ba..5276c467 100644
--- a/src/main/java/org/joda/time/DurationFieldType.java
+++ b/src/main/java/org/joda/time/DurationFieldType.java
@@ -239,6 +239,7 @@ public abstract class DurationFieldType implements Serializable {
*
* @return debug string
*/
+ @Override
public String toString() {
return getName();
}
@@ -278,6 +279,7 @@ public abstract class DurationFieldType implements Serializable {
return (1 << iOrdinal);
}
+ @Override
public DurationField getField(Chronology chronology) {
chronology = DateTimeUtils.getChronology(chronology);
diff --git a/src/main/java/org/joda/time/Hours.java b/src/main/java/org/joda/time/Hours.java
index 471c1dde..5083f04a 100644
--- a/src/main/java/org/joda/time/Hours.java
+++ b/src/main/java/org/joda/time/Hours.java
@@ -233,6 +233,7 @@ public final class Hours extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.hours();
}
@@ -242,6 +243,7 @@ public final class Hours extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.hours();
}
@@ -482,6 +484,7 @@ public final class Hours extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "PT" + String.valueOf(getValue()) + "H";
diff --git a/src/main/java/org/joda/time/IllegalFieldValueException.java b/src/main/java/org/joda/time/IllegalFieldValueException.java
index 6fce02bf..7ea31e4b 100644
--- a/src/main/java/org/joda/time/IllegalFieldValueException.java
+++ b/src/main/java/org/joda/time/IllegalFieldValueException.java
@@ -332,6 +332,7 @@ public class IllegalFieldValueException extends IllegalArgumentException {
return iUpperBound;
}
+ @Override
public String getMessage() {
return iMessage;
}
@@ -339,6 +340,8 @@ public class IllegalFieldValueException extends IllegalArgumentException {
/**
* Provide additional detail by prepending a message to the existing message.
* A colon is separator is automatically inserted between the messages.
+ *
+ * @param message the message to prepend
* @since 1.3
*/
public void prependMessage(String message) {
diff --git a/src/main/java/org/joda/time/Instant.java b/src/main/java/org/joda/time/Instant.java
index d50e4a28..b88e8714 100644
--- a/src/main/java/org/joda/time/Instant.java
+++ b/src/main/java/org/joda/time/Instant.java
@@ -84,6 +84,7 @@ public final class Instant
* Obtains an {@code Instant} set to the milliseconds from 1970-01-01T00:00:00Z.
*
* @param epochMilli the milliseconds from 1970-01-01T00:00:00Z
+ * @return the instant, not null
* @since 2.10
*/
public static Instant ofEpochMilli(long epochMilli) {
@@ -95,6 +96,7 @@ public final class Instant
*
* @param epochSecond the seconds from 1970-01-01T00:00:00Z
* @throws ArithmeticException if the new instant exceeds the capacity of a long
+ * @return the instant, not null
* @since 2.10
*/
public static Instant ofEpochSecond(long epochSecond) {
@@ -108,6 +110,7 @@ public final class Instant
* This uses {@link ISODateTimeFormat#dateTimeParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed instant, not null
* @since 2.0
*/
@FromString
@@ -120,6 +123,7 @@ public final class Instant
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed instant, not null
* @since 2.0
*/
public static Instant parse(String str, DateTimeFormatter formatter) {
@@ -168,6 +172,7 @@ public final class Instant
*
* @return <code>this</code>
*/
+ @Override
public Instant toInstant() {
return this;
}
@@ -316,6 +321,7 @@ public final class Instant
*
* @return a DateTime using the same millis
*/
+ @Override
public DateTime toDateTime() {
return new DateTime(getMillis(), ISOChronology.getInstance());
}
@@ -342,6 +348,7 @@ public final class Instant
* @return a DateTime using the same millis with ISOChronology
* @deprecated Use toDateTime() as it is identical
*/
+ @Override
@Deprecated
public DateTime toDateTimeISO() {
return toDateTime();
@@ -362,6 +369,7 @@ public final class Instant
*
* @return a MutableDateTime using the same millis
*/
+ @Override
public MutableDateTime toMutableDateTime() {
return new MutableDateTime(getMillis(), ISOChronology.getInstance());
}
@@ -388,6 +396,7 @@ public final class Instant
* @return a MutableDateTime using the same millis with ISOChronology
* @deprecated Use toMutableDateTime() as it is identical
*/
+ @Override
@Deprecated
public MutableDateTime toMutableDateTimeISO() {
return toMutableDateTime();
diff --git a/src/main/java/org/joda/time/Interval.java b/src/main/java/org/joda/time/Interval.java
index 74a2f84c..a8d4bd28 100644
--- a/src/main/java/org/joda/time/Interval.java
+++ b/src/main/java/org/joda/time/Interval.java
@@ -69,6 +69,7 @@ public final class Interval
* offset of the default time-zone. See also {@link #parseWithOffset(String)}.
*
* @param str the string to parse, not null
+ * @return the parsed interval, not null
* @since 2.0
*/
public static Interval parse(String str) {
@@ -99,6 +100,7 @@ public final class Interval
* The object produced via the constructor has a zone of {@code DateTimeZone.getDefault()}.
*
* @param str the string to parse, not null
+ * @return the parsed interval, not null
* @since 2.9
*/
public static Interval parseWithOffset(String str) {
@@ -296,6 +298,7 @@ public final class Interval
*
* @return <code>this</code>
*/
+ @Override
public Interval toInterval() {
return this;
}
diff --git a/src/main/java/org/joda/time/LocalDate.java b/src/main/java/org/joda/time/LocalDate.java
index d2acdc61..e4f1a493 100644
--- a/src/main/java/org/joda/time/LocalDate.java
+++ b/src/main/java/org/joda/time/LocalDate.java
@@ -161,6 +161,7 @@ public final class LocalDate
* This uses {@link ISODateTimeFormat#localDateParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed date, not null
* @since 2.0
*/
@FromString
@@ -173,6 +174,7 @@ public final class LocalDate
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed date, not null
* @since 2.0
*/
public static LocalDate parse(String str, DateTimeFormatter formatter) {
@@ -495,6 +497,7 @@ public final class LocalDate
* @param chrono the chronology to use
* @return the field
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case YEAR:
@@ -548,6 +551,7 @@ public final class LocalDate
* @return the value of that field
* @throws IllegalArgumentException if the field type is null or unsupported
*/
+ @Override
public int get(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("The DateTimeFieldType must not be null");
@@ -566,6 +570,7 @@ public final class LocalDate
* @param type a field type, usually obtained from DateTimeFieldType
* @return true if the field type is supported
*/
+ @Override
public boolean isSupported(DateTimeFieldType type) {
if (type == null) {
return false;
@@ -606,6 +611,7 @@ public final class LocalDate
* @return the number of milliseconds since 1970-01-01T00:00:00
* @since 1.5 (previously private)
*/
+ @Override
protected long getLocalMillis() {
return iLocalMillis;
}
@@ -627,6 +633,7 @@ public final class LocalDate
* @param partial an object to check against
* @return true if fields and values are equal
*/
+ @Override
public boolean equals(Object partial) {
// override to perform faster
if (this == partial) {
@@ -646,6 +653,7 @@ public final class LocalDate
*
* @return a suitable hash code
*/
+ @Override
public int hashCode() {
// override for performance
int hash = iHash;
@@ -671,6 +679,7 @@ public final class LocalDate
* or if it has field types that don't match
* @throws NullPointerException if the partial is null
*/
+ @Override
public int compareTo(ReadablePartial partial) {
// override to perform faster
if (this == partial) {
@@ -1827,6 +1836,7 @@ public final class LocalDate
*
* @return ISO8601 time formatted string.
*/
+ @Override
@ToString
public String toString() {
return ISODateTimeFormat.date().print(this);
@@ -1836,6 +1846,7 @@ public final class LocalDate
* Output the date using the specified format pattern.
*
* @param pattern the pattern specification, null means use <code>toString</code>
+ * @return the formatted output
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern) {
@@ -1850,6 +1861,8 @@ public final class LocalDate
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @param locale Locale to use, null means default
+ * @return the formatted output
+ * @throws IllegalArgumentException if the pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
@@ -1932,6 +1945,7 @@ public final class LocalDate
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -1941,6 +1955,7 @@ public final class LocalDate
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getLocalMillis();
}
@@ -1951,6 +1966,7 @@ public final class LocalDate
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/LocalDateTime.java b/src/main/java/org/joda/time/LocalDateTime.java
index bd263260..d1f87f1a 100644
--- a/src/main/java/org/joda/time/LocalDateTime.java
+++ b/src/main/java/org/joda/time/LocalDateTime.java
@@ -150,6 +150,7 @@ public final class LocalDateTime
* This uses {@link ISODateTimeFormat#localDateOptionalTimeParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
@FromString
@@ -162,6 +163,7 @@ public final class LocalDateTime
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
public static LocalDateTime parse(String str, DateTimeFormatter formatter) {
@@ -548,6 +550,7 @@ public final class LocalDateTime
* @param chrono the chronology to use
* @return the field
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case YEAR:
@@ -603,6 +606,7 @@ public final class LocalDateTime
* @return the value of that field
* @throws IllegalArgumentException if the field type is null
*/
+ @Override
public int get(DateTimeFieldType type) {
if (type == null) {
throw new IllegalArgumentException("The DateTimeFieldType must not be null");
@@ -618,6 +622,7 @@ public final class LocalDateTime
* @param type a field type, usually obtained from DateTimeFieldType
* @return true if the field type is supported
*/
+ @Override
public boolean isSupported(DateTimeFieldType type) {
if (type == null) {
return false;
@@ -647,6 +652,7 @@ public final class LocalDateTime
* @return the number of milliseconds since 1970-01-01T00:00:00
* @since 1.5 (previously private)
*/
+ @Override
protected long getLocalMillis() {
return iLocalMillis;
}
@@ -668,6 +674,7 @@ public final class LocalDateTime
* @param partial an object to check against
* @return true if fields and values are equal
*/
+ @Override
public boolean equals(Object partial) {
// override to perform faster
if (this == partial) {
@@ -682,6 +689,21 @@ public final class LocalDateTime
return super.equals(partial);
}
+ @Override
+ public int hashCode() {
+ int total = 157;
+ total = 23 * total + iChronology.year().get(iLocalMillis);
+ total = 23 * total + iChronology.year().getType().hashCode();
+ total = 23 * total + iChronology.monthOfYear().get(iLocalMillis);
+ total = 23 * total + iChronology.monthOfYear().getType().hashCode();
+ total = 23 * total + iChronology.dayOfMonth().get(iLocalMillis);
+ total = 23 * total + iChronology.dayOfMonth().getType().hashCode();
+ total = 23 * total + iChronology.millisOfDay().get(iLocalMillis);
+ total = 23 * total + iChronology.millisOfDay().getType().hashCode();
+ total += getChronology().hashCode();
+ return total;
+ }
+
/**
* Compares this partial with another returning an integer
* indicating the order.
@@ -698,6 +720,7 @@ public final class LocalDateTime
* or if it has field types that don't match
* @throws NullPointerException if the partial is null
*/
+ @Override
public int compareTo(ReadablePartial partial) {
// override to perform faster
if (this == partial) {
@@ -817,6 +840,7 @@ public final class LocalDateTime
* time zone initialization logic, and should demonstrate better concurrent performance
* characteristics.
*
+ * @param timeZone the time zone
* @return a Date initialised with this date-time, never null
* @since 2.3
*/
@@ -2082,6 +2106,7 @@ public final class LocalDateTime
*
* @return ISO8601 time formatted string.
*/
+ @Override
@ToString
public String toString() {
return ISODateTimeFormat.dateTime().print(this);
@@ -2091,6 +2116,7 @@ public final class LocalDateTime
* Output the date using the specified format pattern.
*
* @param pattern the pattern specification, null means use <code>toString</code>
+ * @return the formatted output, not null
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern) {
@@ -2105,6 +2131,8 @@ public final class LocalDateTime
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @param locale Locale to use, null means default
+ * @return the formatted output, not null
+ * @throws IllegalArgumentException if the pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
@@ -2188,6 +2216,7 @@ public final class LocalDateTime
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -2197,6 +2226,7 @@ public final class LocalDateTime
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getLocalMillis();
}
@@ -2207,6 +2237,7 @@ public final class LocalDateTime
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/LocalTime.java b/src/main/java/org/joda/time/LocalTime.java
index ce709824..c80aa454 100644
--- a/src/main/java/org/joda/time/LocalTime.java
+++ b/src/main/java/org/joda/time/LocalTime.java
@@ -157,6 +157,7 @@ public final class LocalTime
* This uses {@link ISODateTimeFormat#localTimeParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed time, not null
* @since 2.0
*/
@FromString
@@ -169,6 +170,7 @@ public final class LocalTime
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed time, not null
* @since 2.0
*/
public static LocalTime parse(String str, DateTimeFormatter formatter) {
@@ -185,6 +187,7 @@ public final class LocalTime
* This method uses the UTC time zone internally.
*
* @param millisOfDay the number of milliseconds into a day to convert
+ * @return the time, not null
*/
public static LocalTime fromMillisOfDay(long millisOfDay) {
return fromMillisOfDay(millisOfDay, null);
@@ -200,6 +203,7 @@ public final class LocalTime
*
* @param millisOfDay the number of milliseconds into a day to convert
* @param chrono the chronology, null means ISO chronology
+ * @return the time, not null
*/
public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono).withUTC();
@@ -544,6 +548,7 @@ public final class LocalTime
* @param chrono the chronology to use
* @return the field
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case HOUR_OF_DAY:
@@ -600,6 +605,7 @@ public final class LocalTime
* @return the value of that field
* @throws IllegalArgumentException if the field type is null
*/
+ @Override
public int get(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("The DateTimeFieldType must not be null");
@@ -618,6 +624,7 @@ public final class LocalTime
* @param type a field type, usually obtained from DateTimeFieldType
* @return true if the field type is supported
*/
+ @Override
public boolean isSupported(DateTimeFieldType type) {
if (type == null) {
return false;
@@ -656,6 +663,7 @@ public final class LocalTime
* @return the number of milliseconds since 1970-01-01T00:00:00
* @since 1.5 (previously private)
*/
+ @Override
protected long getLocalMillis() {
return iLocalMillis;
}
@@ -677,6 +685,7 @@ public final class LocalTime
* @param partial an object to check against
* @return true if fields and values are equal
*/
+ @Override
public boolean equals(Object partial) {
// override to perform faster
if (this == partial) {
@@ -691,6 +700,21 @@ public final class LocalTime
return super.equals(partial);
}
+ @Override
+ public int hashCode() {
+ int total = 157;
+ total = 23 * total + iChronology.hourOfDay().get(iLocalMillis);
+ total = 23 * total + iChronology.hourOfDay().getType().hashCode();
+ total = 23 * total + iChronology.minuteOfHour().get(iLocalMillis);
+ total = 23 * total + iChronology.minuteOfHour().getType().hashCode();
+ total = 23 * total + iChronology.secondOfMinute().get(iLocalMillis);
+ total = 23 * total + iChronology.secondOfMinute().getType().hashCode();
+ total = 23 * total + iChronology.millisOfSecond().get(iLocalMillis);
+ total = 23 * total + iChronology.millisOfSecond().getType().hashCode();
+ total += getChronology().hashCode();
+ return total;
+ }
+
/**
* Compares this partial with another returning an integer
* indicating the order.
@@ -707,6 +731,7 @@ public final class LocalTime
* or if it has field types that don't match
* @throws NullPointerException if the partial is null
*/
+ @Override
public int compareTo(ReadablePartial partial) {
// override to perform faster
if (this == partial) {
@@ -1294,6 +1319,7 @@ public final class LocalTime
*
* @return ISO8601 time formatted string.
*/
+ @Override
@ToString
public String toString() {
return ISODateTimeFormat.time().print(this);
@@ -1303,6 +1329,7 @@ public final class LocalTime
* Output the time using the specified format pattern.
*
* @param pattern the pattern specification, null means use <code>toString</code>
+ * @return the formatted output, not null
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern) {
@@ -1317,6 +1344,8 @@ public final class LocalTime
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @param locale Locale to use, null means default
+ * @return the formatted output, not null
+ * @throws IllegalArgumentException if the pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
@@ -1398,6 +1427,7 @@ public final class LocalTime
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -1407,6 +1437,7 @@ public final class LocalTime
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getLocalMillis();
}
@@ -1417,6 +1448,7 @@ public final class LocalTime
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/Minutes.java b/src/main/java/org/joda/time/Minutes.java
index 302c51db..62726068 100644
--- a/src/main/java/org/joda/time/Minutes.java
+++ b/src/main/java/org/joda/time/Minutes.java
@@ -213,6 +213,7 @@ public final class Minutes extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.minutes();
}
@@ -222,6 +223,7 @@ public final class Minutes extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.minutes();
}
@@ -463,6 +465,7 @@ public final class Minutes extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "PT" + String.valueOf(getValue()) + "M";
diff --git a/src/main/java/org/joda/time/MonthDay.java b/src/main/java/org/joda/time/MonthDay.java
index bc9b6977..5fa7226c 100644
--- a/src/main/java/org/joda/time/MonthDay.java
+++ b/src/main/java/org/joda/time/MonthDay.java
@@ -142,6 +142,7 @@ public final class MonthDay
* This uses {@link ISODateTimeFormat#localDateParser()} or the format {@code --MM-dd}.
*
* @param str the string to parse, not null
+ * @return the parsed month-day, not null
* @since 2.0
*/
@FromString
@@ -154,6 +155,7 @@ public final class MonthDay
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed month-day, not null
* @since 2.0
*/
public static MonthDay parse(String str, DateTimeFormatter formatter) {
@@ -404,6 +406,7 @@ public final class MonthDay
* @param chrono the chronology to use
* @return the field, never null
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case MONTH_OF_YEAR:
@@ -422,6 +425,7 @@ public final class MonthDay
* @return the field at the specified index, never null
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public DateTimeFieldType getFieldType(int index) {
return FIELD_TYPES[index];
}
@@ -433,6 +437,7 @@ public final class MonthDay
*
* @return the array of field types (cloned), largest to smallest, never null
*/
+ @Override
public DateTimeFieldType[] getFieldTypes() {
return (DateTimeFieldType[]) FIELD_TYPES.clone();
}
@@ -778,6 +783,7 @@ public final class MonthDay
*
* @return ISO8601 time formatted string.
*/
+ @Override
@ToString
public String toString() {
List<DateTimeFieldType> fields = new ArrayList<DateTimeFieldType>();
@@ -792,6 +798,7 @@ public final class MonthDay
* @param pattern the pattern specification, null means use <code>toString</code>
* @see org.joda.time.format.DateTimeFormat
*/
+ @Override
public String toString(String pattern) {
if (pattern == null) {
return toString();
@@ -806,6 +813,7 @@ public final class MonthDay
* @param locale Locale to use, null means default
* @see org.joda.time.format.DateTimeFormat
*/
+ @Override
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
if (pattern == null) {
return toString();
@@ -849,6 +857,7 @@ public final class MonthDay
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iBase.getField(iFieldIndex);
}
@@ -858,6 +867,7 @@ public final class MonthDay
*
* @return the partial
*/
+ @Override
protected ReadablePartial getReadablePartial() {
return iBase;
}
@@ -876,6 +886,7 @@ public final class MonthDay
*
* @return the field value
*/
+ @Override
public int get() {
return iBase.getValue(iFieldIndex);
}
diff --git a/src/main/java/org/joda/time/Months.java b/src/main/java/org/joda/time/Months.java
index 034f1880..a7941ab9 100644
--- a/src/main/java/org/joda/time/Months.java
+++ b/src/main/java/org/joda/time/Months.java
@@ -234,6 +234,7 @@ public final class Months extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.months();
}
@@ -243,6 +244,7 @@ public final class Months extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.months();
}
@@ -397,6 +399,7 @@ public final class Months extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "P" + String.valueOf(getValue()) + "M";
diff --git a/src/main/java/org/joda/time/MutableDateTime.java b/src/main/java/org/joda/time/MutableDateTime.java
index d24dd95e..0295bdfb 100644
--- a/src/main/java/org/joda/time/MutableDateTime.java
+++ b/src/main/java/org/joda/time/MutableDateTime.java
@@ -142,6 +142,7 @@ public class MutableDateTime
* This uses {@link ISODateTimeFormat#dateTimeParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
@FromString
@@ -154,6 +155,7 @@ public class MutableDateTime
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed date-time, not null
* @since 2.0
*/
public static MutableDateTime parse(String str, DateTimeFormatter formatter) {
@@ -449,6 +451,7 @@ public class MutableDateTime
* @param instant the milliseconds since 1970-01-01T00:00:00Z to set the
* datetime to
*/
+ @Override
public void setMillis(long instant) {
switch (iRoundingMode) {
case ROUND_NONE:
@@ -558,6 +561,7 @@ public class MutableDateTime
*
* @param chronology the chronology to use, null means ISOChronology in default zone
*/
+ @Override
public void setChronology(Chronology chronology) {
super.setChronology(chronology);
}
@@ -1245,6 +1249,7 @@ public class MutableDateTime
*
* @return a clone of this object.
*/
+ @Override
public Object clone() {
try {
return super.clone();
@@ -1318,6 +1323,7 @@ public class MutableDateTime
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iField;
}
@@ -1327,6 +1333,7 @@ public class MutableDateTime
*
* @return the milliseconds
*/
+ @Override
protected long getMillis() {
return iInstant.getMillis();
}
@@ -1337,6 +1344,7 @@ public class MutableDateTime
* @return the chronology
* @since 1.4
*/
+ @Override
protected Chronology getChronology() {
return iInstant.getChronology();
}
diff --git a/src/main/java/org/joda/time/MutableInterval.java b/src/main/java/org/joda/time/MutableInterval.java
index 38715c02..d68812c3 100644
--- a/src/main/java/org/joda/time/MutableInterval.java
+++ b/src/main/java/org/joda/time/MutableInterval.java
@@ -65,6 +65,7 @@ public class MutableInterval
* 'datetime/period' or 'period/datetime'.
*
* @param str the string to parse, not null
+ * @return the parsed interval, not null
* @since 2.0
*/
public static MutableInterval parse(String str) {
@@ -403,6 +404,7 @@ public class MutableInterval
*
* @return a clone of this object.
*/
+ @Override
public Object clone() {
try {
return super.clone();
diff --git a/src/main/java/org/joda/time/MutablePeriod.java b/src/main/java/org/joda/time/MutablePeriod.java
index 5ae6e940..6ed03ab3 100644
--- a/src/main/java/org/joda/time/MutablePeriod.java
+++ b/src/main/java/org/joda/time/MutablePeriod.java
@@ -67,6 +67,7 @@ public class MutablePeriod
* This uses {@link ISOPeriodFormat#standard()}.
*
* @param str the string to parse, not null
+ * @return the parsed period, not null
* @since 2.0
*/
@FromString
@@ -79,6 +80,7 @@ public class MutablePeriod
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed period, not null
* @since 2.0
*/
public static MutablePeriod parse(String str, PeriodFormatter formatter) {
@@ -441,6 +443,7 @@ public class MutablePeriod
* @param value the new value for the field
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public void setValue(int index, int value) {
super.setValue(index, value);
}
@@ -464,6 +467,7 @@ public class MutablePeriod
* @param period the period to set, null means zero length period
* @throws IllegalArgumentException if an unsupported field's value is non-zero
*/
+ @Override
public void setPeriod(ReadablePeriod period) {
super.setPeriod(period);
}
@@ -481,6 +485,7 @@ public class MutablePeriod
* @param millis amount of milliseconds in this period, which must be zero if unsupported
* @throws IllegalArgumentException if an unsupported field's value is non-zero
*/
+ @Override
public void setPeriod(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
super.setPeriod(years, months, weeks, days, hours, minutes, seconds, millis);
@@ -732,6 +737,7 @@ public class MutablePeriod
* @param period the period to set, null ignored
* @throws IllegalArgumentException if an unsupported field's value is non-zero
*/
+ @Override
public void mergePeriod(ReadablePeriod period) {
super.mergePeriod(period);
}
@@ -1002,6 +1008,7 @@ public class MutablePeriod
*
* @return a clone of this object.
*/
+ @Override
public Object clone() {
try {
return super.clone();
diff --git a/src/main/java/org/joda/time/Partial.java b/src/main/java/org/joda/time/Partial.java
index 7b589f79..68e481a4 100644
--- a/src/main/java/org/joda/time/Partial.java
+++ b/src/main/java/org/joda/time/Partial.java
@@ -278,6 +278,8 @@ public final class Partial
* another partial.
* <p>
* This is most useful when copying from a YearMonthDay or TimeOfDay.
+ *
+ * @param partial the partial to copy
*/
public Partial(ReadablePartial partial) {
super();
@@ -354,6 +356,7 @@ public final class Partial
* @return the field
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
return iTypes[index].getField(chrono);
}
@@ -365,6 +368,7 @@ public final class Partial
* @return the field at the specified index
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public DateTimeFieldType getFieldType(int index) {
return iTypes[index];
}
@@ -377,6 +381,7 @@ public final class Partial
*
* @return the array of field types (cloned), largest to smallest
*/
+ @Override
public DateTimeFieldType[] getFieldTypes() {
return (DateTimeFieldType[]) iTypes.clone();
}
@@ -402,6 +407,7 @@ public final class Partial
*
* @return the current values of each field (cloned), largest to smallest
*/
+ @Override
public int[] getValues() {
return (int[]) iValues.clone();
}
@@ -765,6 +771,7 @@ public final class Partial
*
* @return ISO8601 formatted string
*/
+ @Override
public String toString() {
DateTimeFormatter[] f = iFormatter;
if (f == null) {
@@ -811,6 +818,7 @@ public final class Partial
* Unsupported fields will appear as special unicode characters.
*
* @param pattern the pattern specification, null means use <code>toString</code>
+ * @return the formatted output, not null
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern) {
@@ -826,6 +834,7 @@ public final class Partial
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @param locale Locale to use, null means default
+ * @return the formatted output, not null
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern, Locale locale) {
@@ -871,6 +880,7 @@ public final class Partial
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iPartial.getField(iFieldIndex);
}
@@ -880,6 +890,7 @@ public final class Partial
*
* @return the partial
*/
+ @Override
protected ReadablePartial getReadablePartial() {
return iPartial;
}
@@ -898,6 +909,7 @@ public final class Partial
*
* @return the field value
*/
+ @Override
public int get() {
return iPartial.getValue(iFieldIndex);
}
diff --git a/src/main/java/org/joda/time/Period.java b/src/main/java/org/joda/time/Period.java
index b5618516..f2e8b30b 100644
--- a/src/main/java/org/joda/time/Period.java
+++ b/src/main/java/org/joda/time/Period.java
@@ -74,6 +74,7 @@ public final class Period
* This uses {@link ISOPeriodFormat#standard()}.
*
* @param str the string to parse, not null
+ * @return the parsed period, not null
* @since 2.0
*/
@FromString
@@ -86,6 +87,7 @@ public final class Period
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed period, not null
* @since 2.0
*/
public static Period parse(String str, PeriodFormatter formatter) {
@@ -250,6 +252,7 @@ public final class Period
*
* @param start the start of the period, must not be null
* @param end the end of the period, must not be null
+ * @return the period, not null
* @throws IllegalArgumentException if the partials are null or invalid
* @since 1.1
*/
@@ -267,7 +270,7 @@ public final class Period
throw new IllegalArgumentException("ReadablePartial objects must have the same set of fields");
}
types[i] = start.getFieldType(i).getDurationType();
- if (i > 0 && types[i - 1] == types[i]) {
+ if (i > 0 && types[i - 1].equals(types[i])) {
throw new IllegalArgumentException("ReadablePartial objects must not have overlapping fields");
}
values[i] = end.getValue(i) - start.getValue(i);
@@ -743,6 +746,7 @@ public final class Period
*
* @return <code>this</code>
*/
+ @Override
public Period toPeriod() {
return this;
}
@@ -1649,7 +1653,7 @@ public final class Period
if (type.isSupported(DurationFieldType.YEARS_TYPE)) {
int normalizedYears = FieldUtils.safeToInt(totalMonths / 12);
result = result.withYears(normalizedYears);
- totalMonths = totalMonths - (normalizedYears * 12);
+ totalMonths = totalMonths - (normalizedYears * 12L);
}
if (type.isSupported(DurationFieldType.MONTHS_TYPE)) {
int normalizedMonths = FieldUtils.safeToInt(totalMonths);
diff --git a/src/main/java/org/joda/time/PeriodType.java b/src/main/java/org/joda/time/PeriodType.java
index e06b3793..8528c1d6 100644
--- a/src/main/java/org/joda/time/PeriodType.java
+++ b/src/main/java/org/joda/time/PeriodType.java
@@ -646,7 +646,7 @@ public class PeriodType implements Serializable {
*/
public int indexOf(DurationFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
- if (iTypes[i] == type) {
+ if (iTypes[i].equals(type)) {
return i;
}
}
@@ -658,6 +658,7 @@ public class PeriodType implements Serializable {
*
* @return a string
*/
+ @Override
public String toString() {
return "PeriodType[" + getName() + "]";
}
@@ -831,6 +832,7 @@ public class PeriodType implements Serializable {
* @param obj the object to compare to
* @return true if equal
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -847,6 +849,7 @@ public class PeriodType implements Serializable {
*
* @return a suitable hashcode
*/
+ @Override
public int hashCode() {
int hash = 0;
for (int i = 0; i < iTypes.length; i++) {
diff --git a/src/main/java/org/joda/time/ReadableDateTime.java b/src/main/java/org/joda/time/ReadableDateTime.java
index 46da1a91..725bfb1d 100644
--- a/src/main/java/org/joda/time/ReadableDateTime.java
+++ b/src/main/java/org/joda/time/ReadableDateTime.java
@@ -195,6 +195,7 @@ public interface ReadableDateTime extends ReadableInstant {
* Output the instant using the specified format pattern.
*
* @param pattern pattern specification
+ * @return the formatted output, not null
* @throws IllegalArgumentException if pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
@@ -205,6 +206,7 @@ public interface ReadableDateTime extends ReadableInstant {
*
* @param pattern pattern specification
* @param locale Locale to use, or null for default
+ * @return the formatted output, not null
* @throws IllegalArgumentException if pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
diff --git a/src/main/java/org/joda/time/ReadableInstant.java b/src/main/java/org/joda/time/ReadableInstant.java
index 1b2c97e5..0141ca78 100644
--- a/src/main/java/org/joda/time/ReadableInstant.java
+++ b/src/main/java/org/joda/time/ReadableInstant.java
@@ -145,7 +145,7 @@ public interface ReadableInstant extends Comparable<ReadableInstant> {
* <p>
* To compare two instants for absolute time (ie. UTC milliseconds
* ignoring the chronology), use {@link #isEqual(ReadableInstant)} or
- * {@link #compareTo(Object)}.
+ * {@link #compareTo}.
*
* @param readableInstant a readable instant to check against
* @return true if millisecond and chronology are equal, false if
diff --git a/src/main/java/org/joda/time/Seconds.java b/src/main/java/org/joda/time/Seconds.java
index 47f20bce..ff88a14f 100644
--- a/src/main/java/org/joda/time/Seconds.java
+++ b/src/main/java/org/joda/time/Seconds.java
@@ -213,6 +213,7 @@ public final class Seconds extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.seconds();
}
@@ -222,6 +223,7 @@ public final class Seconds extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.seconds();
}
@@ -463,6 +465,7 @@ public final class Seconds extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "PT" + String.valueOf(getValue()) + "S";
diff --git a/src/main/java/org/joda/time/TimeOfDay.java b/src/main/java/org/joda/time/TimeOfDay.java
index 1fcef029..68af0a0f 100644
--- a/src/main/java/org/joda/time/TimeOfDay.java
+++ b/src/main/java/org/joda/time/TimeOfDay.java
@@ -163,6 +163,7 @@ public final class TimeOfDay
* This method uses the UTC time zone internally.
*
* @param millisOfDay the number of milliseconds into a day to convert
+ * @return the time, not null
*/
public static TimeOfDay fromMillisOfDay(long millisOfDay) {
return fromMillisOfDay(millisOfDay, null);
@@ -178,6 +179,7 @@ public final class TimeOfDay
*
* @param millisOfDay the number of milliseconds into a day to convert
* @param chrono the chronology, null means ISO chronology
+ * @return the time, not null
*/
public static TimeOfDay fromMillisOfDay(long millisOfDay, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
@@ -438,6 +440,7 @@ public final class TimeOfDay
* @param chrono the chronology to use
* @return the field
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case HOUR_OF_DAY:
@@ -460,6 +463,7 @@ public final class TimeOfDay
* @return the field at the specified index
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public DateTimeFieldType getFieldType(int index) {
return FIELD_TYPES[index];
}
@@ -471,6 +475,7 @@ public final class TimeOfDay
*
* @return the array of field types (cloned), largest to smallest
*/
+ @Override
public DateTimeFieldType[] getFieldTypes() {
return (DateTimeFieldType[]) FIELD_TYPES.clone();
}
@@ -1000,6 +1005,7 @@ public final class TimeOfDay
*
* @return ISO8601 formatted string
*/
+ @Override
public String toString() {
return ISODateTimeFormat.tTime().print(this);
}
@@ -1042,6 +1048,7 @@ public final class TimeOfDay
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iTimeOfDay.getField(iFieldIndex);
}
@@ -1051,6 +1058,7 @@ public final class TimeOfDay
*
* @return the partial
*/
+ @Override
protected ReadablePartial getReadablePartial() {
return iTimeOfDay;
}
@@ -1069,6 +1077,7 @@ public final class TimeOfDay
*
* @return the field value
*/
+ @Override
public int get() {
return iTimeOfDay.getValue(iFieldIndex);
}
diff --git a/src/main/java/org/joda/time/Weeks.java b/src/main/java/org/joda/time/Weeks.java
index da9f420a..a29b7360 100644
--- a/src/main/java/org/joda/time/Weeks.java
+++ b/src/main/java/org/joda/time/Weeks.java
@@ -213,6 +213,7 @@ public final class Weeks extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.weeks();
}
@@ -222,6 +223,7 @@ public final class Weeks extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.weeks();
}
@@ -469,6 +471,7 @@ public final class Weeks extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "P" + String.valueOf(getValue()) + "W";
diff --git a/src/main/java/org/joda/time/YearMonth.java b/src/main/java/org/joda/time/YearMonth.java
index 3d4fd4eb..b170f28a 100644
--- a/src/main/java/org/joda/time/YearMonth.java
+++ b/src/main/java/org/joda/time/YearMonth.java
@@ -134,6 +134,7 @@ public final class YearMonth
* This uses {@link ISODateTimeFormat#localDateParser()}.
*
* @param str the string to parse, not null
+ * @return the parsed year-month, not null
* @since 2.0
*/
@FromString
@@ -146,6 +147,7 @@ public final class YearMonth
*
* @param str the string to parse, not null
* @param formatter the formatter to use, not null
+ * @return the parsed year-month, not null
* @since 2.0
*/
public static YearMonth parse(String str, DateTimeFormatter formatter) {
@@ -396,6 +398,7 @@ public final class YearMonth
* @param chrono the chronology to use
* @return the field, never null
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case YEAR:
@@ -414,6 +417,7 @@ public final class YearMonth
* @return the field at the specified index, never null
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public DateTimeFieldType getFieldType(int index) {
return FIELD_TYPES[index];
}
@@ -425,6 +429,7 @@ public final class YearMonth
*
* @return the array of field types (cloned), largest to smallest, never null
*/
+ @Override
public DateTimeFieldType[] getFieldTypes() {
return (DateTimeFieldType[]) FIELD_TYPES.clone();
}
@@ -792,6 +797,7 @@ public final class YearMonth
*
* @return ISO8601 time formatted string.
*/
+ @Override
@ToString
public String toString() {
return ISODateTimeFormat.yearMonth().print(this);
@@ -803,6 +809,7 @@ public final class YearMonth
* @param pattern the pattern specification, null means use <code>toString</code>
* @see org.joda.time.format.DateTimeFormat
*/
+ @Override
public String toString(String pattern) {
if (pattern == null) {
return toString();
@@ -817,6 +824,7 @@ public final class YearMonth
* @param locale Locale to use, null means default
* @see org.joda.time.format.DateTimeFormat
*/
+ @Override
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
if (pattern == null) {
return toString();
@@ -860,6 +868,7 @@ public final class YearMonth
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iBase.getField(iFieldIndex);
}
@@ -869,6 +878,7 @@ public final class YearMonth
*
* @return the partial
*/
+ @Override
protected ReadablePartial getReadablePartial() {
return iBase;
}
@@ -887,6 +897,7 @@ public final class YearMonth
*
* @return the field value
*/
+ @Override
public int get() {
return iBase.getValue(iFieldIndex);
}
diff --git a/src/main/java/org/joda/time/YearMonthDay.java b/src/main/java/org/joda/time/YearMonthDay.java
index cf4ddf43..46eb9aa3 100644
--- a/src/main/java/org/joda/time/YearMonthDay.java
+++ b/src/main/java/org/joda/time/YearMonthDay.java
@@ -327,6 +327,7 @@ public final class YearMonthDay
* @param chrono the chronology to use
* @return the field
*/
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case YEAR:
@@ -347,6 +348,7 @@ public final class YearMonthDay
* @return the field at the specified index
* @throws IndexOutOfBoundsException if the index is invalid
*/
+ @Override
public DateTimeFieldType getFieldType(int index) {
return FIELD_TYPES[index];
}
@@ -358,6 +360,7 @@ public final class YearMonthDay
*
* @return the array of field types (cloned), largest to smallest
*/
+ @Override
public DateTimeFieldType[] getFieldTypes() {
return (DateTimeFieldType[]) FIELD_TYPES.clone();
}
@@ -915,6 +918,7 @@ public final class YearMonthDay
*
* @return ISO8601 formatted string
*/
+ @Override
public String toString() {
return ISODateTimeFormat.yearMonthDay().print(this);
}
@@ -957,6 +961,7 @@ public final class YearMonthDay
*
* @return the field
*/
+ @Override
public DateTimeField getField() {
return iYearMonthDay.getField(iFieldIndex);
}
@@ -966,6 +971,7 @@ public final class YearMonthDay
*
* @return the partial
*/
+ @Override
protected ReadablePartial getReadablePartial() {
return iYearMonthDay;
}
@@ -984,6 +990,7 @@ public final class YearMonthDay
*
* @return the field value
*/
+ @Override
public int get() {
return iYearMonthDay.getValue(iFieldIndex);
}
diff --git a/src/main/java/org/joda/time/Years.java b/src/main/java/org/joda/time/Years.java
index d78289b9..427f4e27 100644
--- a/src/main/java/org/joda/time/Years.java
+++ b/src/main/java/org/joda/time/Years.java
@@ -190,6 +190,7 @@ public final class Years extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.years();
}
@@ -199,6 +200,7 @@ public final class Years extends BaseSingleFieldPeriod {
*
* @return the period type
*/
+ @Override
public PeriodType getPeriodType() {
return PeriodType.years();
}
@@ -353,6 +355,7 @@ public final class Years extends BaseSingleFieldPeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return "P" + String.valueOf(getValue()) + "Y";
diff --git a/src/main/java/org/joda/time/base/AbstractDateTime.java b/src/main/java/org/joda/time/base/AbstractDateTime.java
index ce31b3a6..b3ed5cde 100644
--- a/src/main/java/org/joda/time/base/AbstractDateTime.java
+++ b/src/main/java/org/joda/time/base/AbstractDateTime.java
@@ -63,6 +63,7 @@ public abstract class AbstractDateTime
* @return the value of that field
* @throws IllegalArgumentException if the field type is null
*/
+ @Override
public int get(DateTimeFieldType type) {
if (type == null) {
throw new IllegalArgumentException("The DateTimeFieldType must not be null");
@@ -309,6 +310,7 @@ public abstract class AbstractDateTime
*
* @return ISO8601 time formatted string, not null
*/
+ @Override
@ToString
public String toString() {
return super.toString();
diff --git a/src/main/java/org/joda/time/base/AbstractDuration.java b/src/main/java/org/joda/time/base/AbstractDuration.java
index abb435e7..7ea1e652 100644
--- a/src/main/java/org/joda/time/base/AbstractDuration.java
+++ b/src/main/java/org/joda/time/base/AbstractDuration.java
@@ -165,6 +165,7 @@ public abstract class AbstractDuration implements ReadableDuration {
* @param duration a readable duration to check against
* @return true if the length of the duration is equal
*/
+ @Override
public boolean equals(Object duration) {
if (this == duration) {
return true;
@@ -182,6 +183,7 @@ public abstract class AbstractDuration implements ReadableDuration {
*
* @return a hash code
*/
+ @Override
public int hashCode() {
long len = getMillis();
return (int) (len ^ (len >>> 32));
@@ -199,6 +201,7 @@ public abstract class AbstractDuration implements ReadableDuration {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
long millis = getMillis();
diff --git a/src/main/java/org/joda/time/base/AbstractInstant.java b/src/main/java/org/joda/time/base/AbstractInstant.java
index 6344248f..edd25a85 100644
--- a/src/main/java/org/joda/time/base/AbstractInstant.java
+++ b/src/main/java/org/joda/time/base/AbstractInstant.java
@@ -254,6 +254,7 @@ public abstract class AbstractInstant implements ReadableInstant {
* @return true if millisecond and chronology are equal, false if
* not or the instant is null or of an incorrect type
*/
+ @Override
public boolean equals(Object readableInstant) {
// must be to fulfil ReadableInstant contract
if (this == readableInstant) {
@@ -273,6 +274,7 @@ public abstract class AbstractInstant implements ReadableInstant {
*
* @return a suitable hash code
*/
+ @Override
public int hashCode() {
// must be to fulfil ReadableInstant contract
return
@@ -419,6 +421,7 @@ public abstract class AbstractInstant implements ReadableInstant {
*
* @return ISO8601 time formatted string, not null
*/
+ @Override
@ToString
public String toString() {
return ISODateTimeFormat.dateTime().print(this);
diff --git a/src/main/java/org/joda/time/base/AbstractInterval.java b/src/main/java/org/joda/time/base/AbstractInterval.java
index 8486f36f..69c1297b 100644
--- a/src/main/java/org/joda/time/base/AbstractInterval.java
+++ b/src/main/java/org/joda/time/base/AbstractInterval.java
@@ -460,6 +460,7 @@ public abstract class AbstractInterval implements ReadableInterval {
* @return true if the intervals are equal comparing the start millis,
* end millis and chronology
*/
+ @Override
public boolean equals(Object readableInterval) {
if (this == readableInterval) {
return true;
@@ -479,6 +480,7 @@ public abstract class AbstractInterval implements ReadableInterval {
*
* @return suitable hashcode
*/
+ @Override
public int hashCode() {
long start = getStartMillis();
long end = getEndMillis();
@@ -496,6 +498,7 @@ public abstract class AbstractInterval implements ReadableInterval {
*
* @return re-parsable string (in the default zone)
*/
+ @Override
public String toString() {
DateTimeFormatter printer = ISODateTimeFormat.dateTime();
printer = printer.withChronology(getChronology());
diff --git a/src/main/java/org/joda/time/base/AbstractPartial.java b/src/main/java/org/joda/time/base/AbstractPartial.java
index b6f81627..59073983 100644
--- a/src/main/java/org/joda/time/base/AbstractPartial.java
+++ b/src/main/java/org/joda/time/base/AbstractPartial.java
@@ -251,6 +251,7 @@ public abstract class AbstractPartial
* @param partial an object to check against
* @return true if fields and values are equal
*/
+ @Override
public boolean equals(Object partial) {
if (this == partial) {
return true;
@@ -276,6 +277,7 @@ public abstract class AbstractPartial
*
* @return a suitable hash code
*/
+ @Override
public int hashCode() {
int total = 157;
for (int i = 0, isize = size(); i < isize; i++) {
diff --git a/src/main/java/org/joda/time/base/AbstractPeriod.java b/src/main/java/org/joda/time/base/AbstractPeriod.java
index 6e5ece56..42e973bd 100644
--- a/src/main/java/org/joda/time/base/AbstractPeriod.java
+++ b/src/main/java/org/joda/time/base/AbstractPeriod.java
@@ -179,6 +179,7 @@ public abstract class AbstractPeriod implements ReadablePeriod {
* @return true if all the field values are equal, false if
* not or the period is null or of an incorrect type
*/
+ @Override
public boolean equals(Object period) {
if (this == period) {
return true;
@@ -203,6 +204,7 @@ public abstract class AbstractPeriod implements ReadablePeriod {
*
* @return a hash code
*/
+ @Override
public int hashCode() {
int total = 17;
for (int i = 0, isize = size(); i < isize; i++) {
@@ -223,6 +225,7 @@ public abstract class AbstractPeriod implements ReadablePeriod {
*
* @return the value as an ISO8601 string
*/
+ @Override
@ToString
public String toString() {
return ISOPeriodFormat.standard().print(this);
diff --git a/src/main/java/org/joda/time/base/BasePartial.java b/src/main/java/org/joda/time/base/BasePartial.java
index d711a525..0dafbf1a 100644
--- a/src/main/java/org/joda/time/base/BasePartial.java
+++ b/src/main/java/org/joda/time/base/BasePartial.java
@@ -233,6 +233,7 @@ public abstract class BasePartial
*
* @return the current values of each field (cloned), largest to smallest
*/
+ @Override
public int[] getValues() {
return (int[]) iValues.clone();
}
@@ -286,6 +287,7 @@ public abstract class BasePartial
* Output the date using the specified format pattern.
*
* @param pattern the pattern specification, null means use <code>toString</code>
+ * @return the formatted output, not null
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern) {
@@ -300,6 +302,8 @@ public abstract class BasePartial
*
* @param pattern the pattern specification, null means use <code>toString</code>
* @param locale Locale to use, null means default
+ * @return the formatted output, not null
+ * @throws IllegalArgumentException if the pattern is invalid
* @see org.joda.time.format.DateTimeFormat
*/
public String toString(String pattern, Locale locale) throws IllegalArgumentException {
diff --git a/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java b/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java
index 839d3b8e..87a3658c 100644
--- a/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java
+++ b/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java
@@ -124,6 +124,7 @@ public abstract class BaseSingleFieldPeriod
*
* @param period the period to get the number of hours from, must not be null
* @param millisPerUnit the number of milliseconds in one standard unit of this period
+ * @return the int value
* @throws IllegalArgumentException if the period contains imprecise duration values
*/
protected static int standardPeriodIn(ReadablePeriod period, long millisPerUnit) {
@@ -297,6 +298,7 @@ public abstract class BaseSingleFieldPeriod
* @return true if all the field values are equal, false if
* not or the period is null or of an incorrect type
*/
+ @Override
public boolean equals(Object period) {
if (this == period) {
return true;
@@ -313,6 +315,7 @@ public abstract class BaseSingleFieldPeriod
*
* @return a hash code
*/
+ @Override
public int hashCode() {
int total = 17;
total = 27 * total + getValue();
diff --git a/src/main/java/org/joda/time/chrono/AssembledChronology.java b/src/main/java/org/joda/time/chrono/AssembledChronology.java
index 13c2de17..5f3054ce 100644
--- a/src/main/java/org/joda/time/chrono/AssembledChronology.java
+++ b/src/main/java/org/joda/time/chrono/AssembledChronology.java
@@ -102,6 +102,7 @@ public abstract class AssembledChronology extends BaseChronology {
setFields();
}
+ @Override
public DateTimeZone getZone() {
Chronology base;
if ((base = iBase) != null) {
@@ -110,6 +111,7 @@ public abstract class AssembledChronology extends BaseChronology {
return null;
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
@@ -122,6 +124,7 @@ public abstract class AssembledChronology extends BaseChronology {
return super.getDateTimeMillis(year, monthOfYear, dayOfMonth, millisOfDay);
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -137,6 +140,7 @@ public abstract class AssembledChronology extends BaseChronology {
hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond);
}
+ @Override
public long getDateTimeMillis(long instant,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -152,142 +156,177 @@ public abstract class AssembledChronology extends BaseChronology {
(instant, hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond);
}
+ @Override
public final DurationField millis() {
return iMillis;
}
+ @Override
public final DateTimeField millisOfSecond() {
return iMillisOfSecond;
}
+ @Override
public final DateTimeField millisOfDay() {
return iMillisOfDay;
}
+ @Override
public final DurationField seconds() {
return iSeconds;
}
+ @Override
public final DateTimeField secondOfMinute() {
return iSecondOfMinute;
}
+ @Override
public final DateTimeField secondOfDay() {
return iSecondOfDay;
}
+ @Override
public final DurationField minutes() {
return iMinutes;
}
+ @Override
public final DateTimeField minuteOfHour() {
return iMinuteOfHour;
}
+ @Override
public final DateTimeField minuteOfDay() {
return iMinuteOfDay;
}
+ @Override
public final DurationField hours() {
return iHours;
}
+ @Override
public final DateTimeField hourOfDay() {
return iHourOfDay;
}
+ @Override
public final DateTimeField clockhourOfDay() {
return iClockhourOfDay;
}
+ @Override
public final DurationField halfdays() {
return iHalfdays;
}
+ @Override
public final DateTimeField hourOfHalfday() {
return iHourOfHalfday;
}
+ @Override
public final DateTimeField clockhourOfHalfday() {
return iClockhourOfHalfday;
}
+ @Override
public final DateTimeField halfdayOfDay() {
return iHalfdayOfDay;
}
+ @Override
public final DurationField days() {
return iDays;
}
+ @Override
public final DateTimeField dayOfWeek() {
return iDayOfWeek;
}
+ @Override
public final DateTimeField dayOfMonth() {
return iDayOfMonth;
}
+ @Override
public final DateTimeField dayOfYear() {
return iDayOfYear;
}
+ @Override
public final DurationField weeks() {
return iWeeks;
}
+ @Override
public final DateTimeField weekOfWeekyear() {
return iWeekOfWeekyear;
}
+ @Override
public final DurationField weekyears() {
return iWeekyears;
}
+ @Override
public final DateTimeField weekyear() {
return iWeekyear;
}
+ @Override
public final DateTimeField weekyearOfCentury() {
return iWeekyearOfCentury;
}
+ @Override
public final DurationField months() {
return iMonths;
}
+ @Override
public final DateTimeField monthOfYear() {
return iMonthOfYear;
}
+ @Override
public final DurationField years() {
return iYears;
}
+ @Override
public final DateTimeField year() {
return iYear;
}
+ @Override
public final DateTimeField yearOfEra() {
return iYearOfEra;
}
+ @Override
public final DateTimeField yearOfCentury() {
return iYearOfCentury;
}
+ @Override
public final DurationField centuries() {
return iCenturies;
}
+ @Override
public final DateTimeField centuryOfEra() {
return iCenturyOfEra;
}
+ @Override
public final DurationField eras() {
return iEras;
}
+ @Override
public final DateTimeField era() {
return iEra;
}
@@ -303,6 +342,8 @@ public abstract class AssembledChronology extends BaseChronology {
/**
* Returns the same base chronology as passed into the constructor.
+ *
+ * @return the base chronology
*/
protected final Chronology getBase() {
return iBase;
@@ -310,6 +351,8 @@ public abstract class AssembledChronology extends BaseChronology {
/**
* Returns the same param object as passed into the constructor.
+ *
+ * @return the object parameter
*/
protected final Object getParam() {
return iParam;
@@ -438,6 +481,8 @@ public abstract class AssembledChronology extends BaseChronology {
/**
* Copy the supported fields from a chronology into this container.
+ *
+ * @param chrono the chronology to copy from, not null
*/
public void copyFieldsFrom(Chronology chrono) {
{
diff --git a/src/main/java/org/joda/time/chrono/BaseChronology.java b/src/main/java/org/joda/time/chrono/BaseChronology.java
index 0d025d68..6dcbd749 100644
--- a/src/main/java/org/joda/time/chrono/BaseChronology.java
+++ b/src/main/java/org/joda/time/chrono/BaseChronology.java
@@ -60,6 +60,7 @@ public abstract class BaseChronology
*
* @return DateTimeZone null if unspecified
*/
+ @Override
public abstract DateTimeZone getZone();
/**
@@ -69,6 +70,7 @@ public abstract class BaseChronology
*
* @return a version of this chronology that ignores time zones
*/
+ @Override
public abstract Chronology withUTC();
/**
@@ -78,6 +80,7 @@ public abstract class BaseChronology
* @param zone to use, or default if null
* @see org.joda.time.chrono.ZonedChronology
*/
+ @Override
public abstract Chronology withZone(DateTimeZone zone);
/**
@@ -95,6 +98,7 @@ public abstract class BaseChronology
* @param millisOfDay millisecond to use
* @return millisecond instant from 1970-01-01T00:00:00Z
*/
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
@@ -124,6 +128,7 @@ public abstract class BaseChronology
* @param millisOfSecond millisecond to use
* @return millisecond instant from 1970-01-01T00:00:00Z
*/
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -155,6 +160,7 @@ public abstract class BaseChronology
* @param millisOfSecond millisecond to use
* @return millisecond instant from 1970-01-01T00:00:00Z
*/
+ @Override
public long getDateTimeMillis(long instant,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -177,6 +183,7 @@ public abstract class BaseChronology
* @param values the values to validate, not null unless the partial is empty
* @throws IllegalArgumentException if the instant is invalid
*/
+ @Override
public void validate(ReadablePartial partial, int[] values) {
// check values in standard range, catching really stupid cases like -1
// this means that the second check will not hit trouble
@@ -219,6 +226,7 @@ public abstract class BaseChronology
* @param instant the instant to query
* @return the values of the partial extracted from the instant
*/
+ @Override
public int[] get(ReadablePartial partial, long instant) {
int size = partial.size();
int[] values = new int[size];
@@ -235,6 +243,7 @@ public abstract class BaseChronology
* @param instant the instant to update
* @return the updated instant
*/
+ @Override
public long set(ReadablePartial partial, long instant) {
for (int i = 0, isize = partial.size(); i < isize; i++) {
instant = partial.getFieldType(i).getField(this).set(instant, partial.getValue(i));
@@ -251,6 +260,7 @@ public abstract class BaseChronology
* @param endInstant the start instant of an interval to query
* @return the values of the period extracted from the interval
*/
+ @Override
public int[] get(ReadablePeriod period, long startInstant, long endInstant) {
int size = period.size();
int[] values = new int[size];
@@ -274,6 +284,7 @@ public abstract class BaseChronology
* @param duration the duration to query
* @return the values of the period extracted from the duration
*/
+ @Override
public int[] get(ReadablePeriod period, long duration) {
int size = period.size();
int[] values = new int[size];
@@ -299,6 +310,7 @@ public abstract class BaseChronology
* @param scalar the number of times to add
* @return the updated instant
*/
+ @Override
public long add(ReadablePeriod period, long instant, int scalar) {
if (scalar != 0 && period != null) {
for (int i = 0, isize = period.size(); i < isize; i++) {
@@ -320,6 +332,7 @@ public abstract class BaseChronology
* @param scalar the number of times to add
* @return the updated instant
*/
+ @Override
public long add(long instant, long duration, int scalar) {
if (duration == 0 || scalar == 0) {
return instant;
@@ -335,6 +348,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField millis() {
return UnsupportedDurationField.getInstance(DurationFieldType.millis());
}
@@ -344,6 +358,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField millisOfSecond() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.millisOfSecond(), millis());
}
@@ -353,6 +368,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField millisOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.millisOfDay(), millis());
}
@@ -364,6 +380,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField seconds() {
return UnsupportedDurationField.getInstance(DurationFieldType.seconds());
}
@@ -373,6 +390,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField secondOfMinute() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.secondOfMinute(), seconds());
}
@@ -382,6 +400,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField secondOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.secondOfDay(), seconds());
}
@@ -393,6 +412,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField minutes() {
return UnsupportedDurationField.getInstance(DurationFieldType.minutes());
}
@@ -402,6 +422,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField minuteOfHour() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.minuteOfHour(), minutes());
}
@@ -411,6 +432,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField minuteOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.minuteOfDay(), minutes());
}
@@ -422,6 +444,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField hours() {
return UnsupportedDurationField.getInstance(DurationFieldType.hours());
}
@@ -431,6 +454,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField hourOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.hourOfDay(), hours());
}
@@ -440,6 +464,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField clockhourOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.clockhourOfDay(), hours());
}
@@ -451,6 +476,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField halfdays() {
return UnsupportedDurationField.getInstance(DurationFieldType.halfdays());
}
@@ -460,6 +486,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField hourOfHalfday() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.hourOfHalfday(), hours());
}
@@ -469,6 +496,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField clockhourOfHalfday() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.clockhourOfHalfday(), hours());
}
@@ -478,6 +506,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField halfdayOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.halfdayOfDay(), halfdays());
}
@@ -489,6 +518,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField days() {
return UnsupportedDurationField.getInstance(DurationFieldType.days());
}
@@ -502,6 +532,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField dayOfWeek() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.dayOfWeek(), days());
}
@@ -511,6 +542,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField dayOfMonth() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.dayOfMonth(), days());
}
@@ -520,6 +552,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField dayOfYear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.dayOfYear(), days());
}
@@ -531,6 +564,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField weeks() {
return UnsupportedDurationField.getInstance(DurationFieldType.weeks());
}
@@ -540,6 +574,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField weekOfWeekyear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekOfWeekyear(), weeks());
}
@@ -551,6 +586,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField weekyears() {
return UnsupportedDurationField.getInstance(DurationFieldType.weekyears());
}
@@ -560,6 +596,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField weekyear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekyear(), weekyears());
}
@@ -569,6 +606,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField weekyearOfCentury() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekyearOfCentury(), weekyears());
}
@@ -580,6 +618,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField months() {
return UnsupportedDurationField.getInstance(DurationFieldType.months());
}
@@ -589,6 +628,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField monthOfYear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.monthOfYear(), months());
}
@@ -600,6 +640,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField years() {
return UnsupportedDurationField.getInstance(DurationFieldType.years());
}
@@ -609,6 +650,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField year() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.year(), years());
}
@@ -618,6 +660,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField yearOfEra() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.yearOfEra(), years());
}
@@ -627,6 +670,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField yearOfCentury() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.yearOfCentury(), years());
}
@@ -638,6 +682,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField centuries() {
return UnsupportedDurationField.getInstance(DurationFieldType.centuries());
}
@@ -647,6 +692,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField centuryOfEra() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.centuryOfEra(), centuries());
}
@@ -658,6 +704,7 @@ public abstract class BaseChronology
*
* @return DurationField or UnsupportedDurationField if unsupported
*/
+ @Override
public DurationField eras() {
return UnsupportedDurationField.getInstance(DurationFieldType.eras());
}
@@ -667,6 +714,7 @@ public abstract class BaseChronology
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
+ @Override
public DateTimeField era() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.era(), eras());
}
@@ -677,6 +725,7 @@ public abstract class BaseChronology
*
* @return a debugging string
*/
+ @Override
public abstract String toString();
}
diff --git a/src/main/java/org/joda/time/chrono/BasicChronology.java b/src/main/java/org/joda/time/chrono/BasicChronology.java
index 34096b13..b1ae7345 100644
--- a/src/main/java/org/joda/time/chrono/BasicChronology.java
+++ b/src/main/java/org/joda/time/chrono/BasicChronology.java
@@ -139,6 +139,7 @@ abstract class BasicChronology extends AssembledChronology {
iMinDaysInFirstWeek = minDaysInFirstWeek;
}
+ @Override
public DateTimeZone getZone() {
Chronology base;
if ((base = getBase()) != null) {
@@ -176,9 +177,9 @@ abstract class BasicChronology extends AssembledChronology {
FieldUtils.verifyValueBounds(DateTimeFieldType.minuteOfHour(), minuteOfHour, 0, 59);
FieldUtils.verifyValueBounds(DateTimeFieldType.secondOfMinute(), secondOfMinute, 0, 59);
FieldUtils.verifyValueBounds(DateTimeFieldType.millisOfSecond(), millisOfSecond, 0, 999);
- long millisOfDay = hourOfDay * DateTimeConstants.MILLIS_PER_HOUR
- + minuteOfHour * DateTimeConstants.MILLIS_PER_MINUTE
- + secondOfMinute * DateTimeConstants.MILLIS_PER_SECOND
+ long millisOfDay = (long) hourOfDay * DateTimeConstants.MILLIS_PER_HOUR
+ + (long) minuteOfHour * DateTimeConstants.MILLIS_PER_MINUTE
+ + (long) secondOfMinute * DateTimeConstants.MILLIS_PER_SECOND
+ millisOfSecond;
return getDateTimeMillis0(year, monthOfYear, dayOfMonth, (int) millisOfDay);
}
@@ -213,6 +214,7 @@ abstract class BasicChronology extends AssembledChronology {
* @return true if equal
* @since 1.6
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -231,6 +233,7 @@ abstract class BasicChronology extends AssembledChronology {
* @return the hash code
* @since 1.6
*/
+ @Override
public int hashCode() {
return getClass().getName().hashCode() * 11 + getZone().hashCode() + getMinimumDaysInFirstWeek();
}
@@ -242,6 +245,7 @@ abstract class BasicChronology extends AssembledChronology {
*
* @return a debugging string
*/
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder(60);
String name = getClass().getName();
@@ -263,6 +267,7 @@ abstract class BasicChronology extends AssembledChronology {
return sb.toString();
}
+ @Override
protected void assemble(Fields fields) {
// First copy fields that are the same for all Gregorian and Julian
// chronologies.
@@ -805,14 +810,17 @@ abstract class BasicChronology extends AssembledChronology {
super(DateTimeFieldType.halfdayOfDay(), cHalfdaysField, cDaysField);
}
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).halfdayValueToText(fieldValue);
}
+ @Override
public long set(long millis, String text, Locale locale) {
return set(millis, GJLocaleSymbols.forLocale(locale).halfdayTextToValue(text));
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getHalfdayMaxTextLength();
}
diff --git a/src/main/java/org/joda/time/chrono/BasicDayOfMonthDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicDayOfMonthDateTimeField.java
index 415aaab6..ba9d73bc 100644
--- a/src/main/java/org/joda/time/chrono/BasicDayOfMonthDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicDayOfMonthDateTimeField.java
@@ -44,26 +44,32 @@ final class BasicDayOfMonthDateTimeField extends PreciseDurationDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public int get(long instant) {
return iChronology.getDayOfMonth(instant);
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.months();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return iChronology.getDaysInMonthMax();
}
+ @Override
public int getMaximumValue(long instant) {
return iChronology.getDaysInMonthMax(instant);
}
+ @Override
public int getMaximumValue(ReadablePartial partial) {
if (partial.isSupported(DateTimeFieldType.monthOfYear())) {
int month = partial.get(DateTimeFieldType.monthOfYear());
@@ -76,6 +82,7 @@ final class BasicDayOfMonthDateTimeField extends PreciseDurationDateTimeField {
return getMaximumValue();
}
+ @Override
public int getMaximumValue(ReadablePartial partial, int[] values) {
int size = partial.size();
for (int i = 0; i < size; i++) {
@@ -93,6 +100,7 @@ final class BasicDayOfMonthDateTimeField extends PreciseDurationDateTimeField {
return getMaximumValue();
}
+ @Override
protected int getMaximumValueForSet(long instant, int value) {
return iChronology.getDaysInMonthMaxForSet(instant, value);
}
diff --git a/src/main/java/org/joda/time/chrono/BasicDayOfYearDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicDayOfYearDateTimeField.java
index 814b7408..fb4b7500 100644
--- a/src/main/java/org/joda/time/chrono/BasicDayOfYearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicDayOfYearDateTimeField.java
@@ -49,27 +49,33 @@ final class BasicDayOfYearDateTimeField extends PreciseDurationDateTimeField {
* @param instant the time instant in millis to query.
* @return the day of the year extracted from the input.
*/
+ @Override
public int get(long instant) {
return iChronology.getDayOfYear(instant);
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.years();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return iChronology.getDaysInYearMax();
}
+ @Override
public int getMaximumValue(long instant) {
int year = iChronology.getYear(instant);
return iChronology.getDaysInYear(year);
}
+ @Override
public int getMaximumValue(ReadablePartial partial) {
if (partial.isSupported(DateTimeFieldType.year())) {
int year = partial.get(DateTimeFieldType.year());
@@ -78,6 +84,7 @@ final class BasicDayOfYearDateTimeField extends PreciseDurationDateTimeField {
return iChronology.getDaysInYearMax();
}
+ @Override
public int getMaximumValue(ReadablePartial partial, int[] values) {
int size = partial.size();
for (int i = 0; i < size; i++) {
@@ -89,6 +96,7 @@ final class BasicDayOfYearDateTimeField extends PreciseDurationDateTimeField {
return iChronology.getDaysInYearMax();
}
+ @Override
protected int getMaximumValueForSet(long instant, int value) {
int maxLessOne = iChronology.getDaysInYearMax() - 1;
return (value > maxLessOne || value < 1) ? getMaximumValue(instant) : maxLessOne;
diff --git a/src/main/java/org/joda/time/chrono/BasicFixedMonthChronology.java b/src/main/java/org/joda/time/chrono/BasicFixedMonthChronology.java
index 7929ca14..3416f99a 100644
--- a/src/main/java/org/joda/time/chrono/BasicFixedMonthChronology.java
+++ b/src/main/java/org/joda/time/chrono/BasicFixedMonthChronology.java
@@ -60,6 +60,7 @@ abstract class BasicFixedMonthChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long setYear(long instant, int year) {
// optimsed implementation of set, due to fixed months
int thisYear = getYear(instant);
@@ -80,6 +81,7 @@ abstract class BasicFixedMonthChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getYearDifference(long minuendInstant, long subtrahendInstant) {
// optimsed implementation of getDifference, due to fixed months
int minuendYear = getYear(minuendInstant);
@@ -97,63 +99,75 @@ abstract class BasicFixedMonthChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getTotalMillisByYearMonth(int year, int month) {
return ((month - 1) * MILLIS_PER_MONTH);
}
//-----------------------------------------------------------------------
+ @Override
int getDayOfMonth(long millis) {
// optimised for fixed months
return (getDayOfYear(millis) - 1) % MONTH_LENGTH + 1;
}
//-----------------------------------------------------------------------
+ @Override
boolean isLeapYear(int year) {
return (year & 3) == 3;
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInYearMonth(int year, int month) {
return (month != 13) ? MONTH_LENGTH : (isLeapYear(year) ? 6 : 5);
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMax() {
return MONTH_LENGTH;
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMax(int month) {
return (month != 13 ? MONTH_LENGTH : 6);
}
//-----------------------------------------------------------------------
+ @Override
int getMonthOfYear(long millis) {
return (getDayOfYear(millis) - 1) / MONTH_LENGTH + 1;
}
//-----------------------------------------------------------------------
+ @Override
int getMonthOfYear(long millis, int year) {
long monthZeroBased = (millis - getYearMillis(year)) / MILLIS_PER_MONTH;
return ((int) monthZeroBased) + 1;
}
//-----------------------------------------------------------------------
+ @Override
int getMaxMonth() {
return 13;
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerYear() {
return MILLIS_PER_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerYearDividedByTwo() {
return MILLIS_PER_YEAR / 2;
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerMonth() {
return MILLIS_PER_MONTH;
}
diff --git a/src/main/java/org/joda/time/chrono/BasicGJChronology.java b/src/main/java/org/joda/time/chrono/BasicGJChronology.java
index e3636c62..4e17b67a 100644
--- a/src/main/java/org/joda/time/chrono/BasicGJChronology.java
+++ b/src/main/java/org/joda/time/chrono/BasicGJChronology.java
@@ -81,6 +81,7 @@ abstract class BasicGJChronology extends BasicChronology {
return dayOfMonth().get(instant) == 29 && monthOfYear().isLeap(instant);
}
+ @Override
int getMonthOfYear(long millis, int year) {
// Perform a binary search to get the month. To make it go even faster,
// compare using ints instead of longs. The number of milliseconds per
@@ -121,6 +122,7 @@ abstract class BasicGJChronology extends BasicChronology {
* @param month the month
* @return the number of days
*/
+ @Override
int getDaysInYearMonth(int year, int month) {
if (isLeapYear(year)) {
return MAX_DAYS_PER_MONTH_ARRAY[month - 1];
@@ -130,16 +132,19 @@ abstract class BasicGJChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMax(int month) {
return MAX_DAYS_PER_MONTH_ARRAY[month - 1];
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMaxForSet(long instant, int value) {
return ((value > 28 || value < 1) ? getDaysInMonthMax(instant) : 28);
}
//-----------------------------------------------------------------------
+ @Override
long getTotalMillisByYearMonth(int year, int month) {
if (isLeapYear(year)) {
return MAX_TOTAL_MILLIS_BY_MONTH_ARRAY[month - 1];
@@ -149,6 +154,7 @@ abstract class BasicGJChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getYearDifference(long minuendInstant, long subtrahendInstant) {
int minuendYear = getYear(minuendInstant);
int subtrahendYear = getYear(subtrahendInstant);
@@ -176,6 +182,7 @@ abstract class BasicGJChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long setYear(long instant, int year) {
int thisYear = getYear(instant);
int dayOfYear = getDayOfYear(instant, thisYear);
diff --git a/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java
index 76de3410..8d4c8d53 100644
--- a/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java
@@ -56,6 +56,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public boolean isLenient() {
return false;
}
@@ -69,6 +70,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
* @param instant the time instant in millis to query.
* @return the month extracted from the input.
*/
+ @Override
public int get(long instant) {
return iChronology.getMonthOfYear(instant);
}
@@ -89,6 +91,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
* @param months the months to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, int months) {
if (months == 0) {
return instant; // the easy case
@@ -158,6 +161,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public long add(long instant, long months) {
int i_months = (int)months;
if (i_months == months) {
@@ -211,6 +215,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public int[] add(ReadablePartial partial, int fieldIndex, int[] values, int valueToAdd) {
// overridden as superclass algorithm can't handle
// 2004-02-29 + 48 months -> 2008-02-29 type dates
@@ -245,11 +250,13 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
* @param months the months to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int months) {
return set(instant, FieldUtils.getWrappedValue(get(instant), months, MIN, iMax));
}
//-----------------------------------------------------------------------
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant < subtrahendInstant) {
return -getDifference(subtrahendInstant, minuendInstant);
@@ -305,6 +312,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if month is invalid
*/
+ @Override
public long set(long instant, int month) {
FieldUtils.verifyValueBounds(this, month, MIN, iMax);
//
@@ -322,11 +330,13 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public DurationField getRangeDurationField() {
return iChronology.years();
}
//-----------------------------------------------------------------------
+ @Override
public boolean isLeap(long instant) {
int thisYear = iChronology.getYear(instant);
if (iChronology.isLeapYear(thisYear)) {
@@ -336,26 +346,31 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public int getLeapAmount(long instant) {
return isLeap(instant) ? 1 : 0;
}
//-----------------------------------------------------------------------
+ @Override
public DurationField getLeapDurationField() {
return iChronology.days();
}
//-----------------------------------------------------------------------
+ @Override
public int getMinimumValue() {
return MIN;
}
//-----------------------------------------------------------------------
+ @Override
public int getMaximumValue() {
return iMax;
}
//-----------------------------------------------------------------------
+ @Override
public long roundFloor(long instant) {
int year = iChronology.getYear(instant);
int month = iChronology.getMonthOfYear(instant, year);
@@ -363,6 +378,7 @@ class BasicMonthOfYearDateTimeField extends ImpreciseDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public long remainder(long instant) {
return instant - roundFloor(instant);
}
diff --git a/src/main/java/org/joda/time/chrono/BasicSingleEraDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicSingleEraDateTimeField.java
index d0d51643..30bd862b 100644
--- a/src/main/java/org/joda/time/chrono/BasicSingleEraDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicSingleEraDateTimeField.java
@@ -52,23 +52,23 @@ final class BasicSingleEraDateTimeField extends BaseDateTimeField {
iEraText = text;
}
- /** @inheritDoc */
+ @Override
public boolean isLenient() {
return false;
}
- /** @inheritDoc */
+ @Override
public int get(long instant) {
return ERA_VALUE;
}
- /** @inheritDoc */
+ @Override
public long set(long instant, int era) {
FieldUtils.verifyValueBounds(this, era, ERA_VALUE, ERA_VALUE);
return instant;
}
- /** @inheritDoc */
+ @Override
public long set(long instant, String text, Locale locale) {
if (iEraText.equals(text) == false && "1".equals(text) == false) {
throw new IllegalFieldValueException(DateTimeFieldType.era(), text);
@@ -76,57 +76,57 @@ final class BasicSingleEraDateTimeField extends BaseDateTimeField {
return instant;
}
- /** @inheritDoc */
+ @Override
public long roundFloor(long instant) {
return Long.MIN_VALUE;
}
- /** @inheritDoc */
+ @Override
public long roundCeiling(long instant) {
return Long.MAX_VALUE;
}
- /** @inheritDoc */
+ @Override
public long roundHalfFloor(long instant) {
return Long.MIN_VALUE;
}
- /** @inheritDoc */
+ @Override
public long roundHalfCeiling(long instant) {
return Long.MIN_VALUE;
}
- /** @inheritDoc */
+ @Override
public long roundHalfEven(long instant) {
return Long.MIN_VALUE;
}
- /** @inheritDoc */
+ @Override
public DurationField getDurationField() {
return UnsupportedDurationField.getInstance(DurationFieldType.eras());
}
- /** @inheritDoc */
+ @Override
public DurationField getRangeDurationField() {
return null;
}
- /** @inheritDoc */
+ @Override
public int getMinimumValue() {
return ERA_VALUE;
}
- /** @inheritDoc */
+ @Override
public int getMaximumValue() {
return ERA_VALUE;
}
- /** @inheritDoc */
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return iEraText;
}
- /** @inheritDoc */
+ @Override
public int getMaximumTextLength(Locale locale) {
return iEraText.length();
}
diff --git a/src/main/java/org/joda/time/chrono/BasicWeekOfWeekyearDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicWeekOfWeekyearDateTimeField.java
index 9fd946d8..027d1134 100644
--- a/src/main/java/org/joda/time/chrono/BasicWeekOfWeekyearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicWeekOfWeekyearDateTimeField.java
@@ -51,10 +51,12 @@ final class BasicWeekOfWeekyearDateTimeField extends PreciseDurationDateTimeFiel
* @param instant the time instant in millis to query.
* @return the week of the year extracted from the input.
*/
+ @Override
public int get(long instant) {
return iChronology.getWeekOfWeekyear(instant);
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.weekyears();
}
@@ -62,33 +64,40 @@ final class BasicWeekOfWeekyearDateTimeField extends PreciseDurationDateTimeFiel
// 1970-01-01 is day of week 4, Thursday. The rounding methods need to
// apply a corrective alignment since weeks begin on day of week 1, Monday.
+ @Override
public long roundFloor(long instant) {
return super.roundFloor(instant + 3 * DateTimeConstants.MILLIS_PER_DAY)
- 3 * DateTimeConstants.MILLIS_PER_DAY;
}
+ @Override
public long roundCeiling(long instant) {
return super.roundCeiling(instant + 3 * DateTimeConstants.MILLIS_PER_DAY)
- 3 * DateTimeConstants.MILLIS_PER_DAY;
}
+ @Override
public long remainder(long instant) {
return super.remainder(instant + 3 * DateTimeConstants.MILLIS_PER_DAY);
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 53;
}
+ @Override
public int getMaximumValue(long instant) {
int weekyear = iChronology.getWeekyear(instant);
return iChronology.getWeeksInYear(weekyear);
}
+ @Override
public int getMaximumValue(ReadablePartial partial) {
if (partial.isSupported(DateTimeFieldType.weekyear())) {
int weekyear = partial.get(DateTimeFieldType.weekyear());
@@ -97,6 +106,7 @@ final class BasicWeekOfWeekyearDateTimeField extends PreciseDurationDateTimeFiel
return 53;
}
+ @Override
public int getMaximumValue(ReadablePartial partial, int[] values) {
int size = partial.size();
for (int i = 0; i < size; i++) {
@@ -108,6 +118,7 @@ final class BasicWeekOfWeekyearDateTimeField extends PreciseDurationDateTimeFiel
return 53;
}
+ @Override
protected int getMaximumValueForSet(long instant, int value) {
return value > 52 ? getMaximumValue(instant) : 52;
}
diff --git a/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java
index fc2f299b..bfa00a03 100644
--- a/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java
@@ -46,6 +46,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
iChronology = chronology;
}
+ @Override
public boolean isLenient() {
return false;
}
@@ -57,6 +58,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
* @param instant the time instant in millis to query.
* @return the year extracted from the input.
*/
+ @Override
public int get(long instant) {
return iChronology.getWeekyear(instant);
}
@@ -69,6 +71,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
* @param years the years to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, int years) {
if (years == 0) {
return instant;
@@ -76,6 +79,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
return set(instant, get(instant) + years);
}
+ @Override
public long add(long instant, long value) {
return add(instant, FieldUtils.safeToInt(value));
}
@@ -89,10 +93,12 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
* @param years the years to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int years) {
return add(instant, years);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant < subtrahendInstant) {
return -getDifference(subtrahendInstant, minuendInstant);
@@ -125,6 +131,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
* @return the updated DateTime.
* @throws IllegalArgumentException if year is invalid.
*/
+ @Override
public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, Math.abs(year),
iChronology.getMinYear(), iChronology.getMaxYear());
@@ -205,30 +212,37 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
return workInstant;
}
+ @Override
public DurationField getRangeDurationField() {
return null;
}
+ @Override
public boolean isLeap(long instant) {
return iChronology.getWeeksInYear(iChronology.getWeekyear(instant)) > 52;
}
+ @Override
public int getLeapAmount(long instant) {
return iChronology.getWeeksInYear(iChronology.getWeekyear(instant)) - 52;
}
+ @Override
public DurationField getLeapDurationField() {
return iChronology.weeks();
}
+ @Override
public int getMinimumValue() {
return iChronology.getMinYear();
}
+ @Override
public int getMaximumValue() {
return iChronology.getMaxYear();
}
+ @Override
public long roundFloor(long instant) {
// Note: This works fine, but it ideally shouldn't invoke other
// fields from within a field.
@@ -240,6 +254,7 @@ final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField {
return instant;
}
+ @Override
public long remainder(long instant) {
return instant - roundFloor(instant);
}
diff --git a/src/main/java/org/joda/time/chrono/BasicYearDateTimeField.java b/src/main/java/org/joda/time/chrono/BasicYearDateTimeField.java
index b7965f0d..17c6911d 100644
--- a/src/main/java/org/joda/time/chrono/BasicYearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/BasicYearDateTimeField.java
@@ -47,14 +47,17 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
iChronology = chronology;
}
+ @Override
public boolean isLenient() {
return false;
}
+ @Override
public int get(long instant) {
return iChronology.getYear(instant);
}
+ @Override
public long add(long instant, int years) {
if (years == 0) {
return instant;
@@ -64,10 +67,12 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
return set(instant, newYear);
}
+ @Override
public long add(long instant, long years) {
return add(instant, FieldUtils.safeToInt(years));
}
+ @Override
public long addWrapField(long instant, int years) {
if (years == 0) {
return instant;
@@ -79,6 +84,7 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
return set(instant, wrappedYear);
}
+ @Override
public long set(long instant, int year) {
FieldUtils.verifyValueBounds
(this, year, iChronology.getMinYear(), iChronology.getMaxYear());
@@ -92,6 +98,7 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
return iChronology.setYear(instant, year);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant < subtrahendInstant) {
return -iChronology.getYearDifference(subtrahendInstant, minuendInstant);
@@ -99,14 +106,17 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
return iChronology.getYearDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public DurationField getRangeDurationField() {
return null;
}
+ @Override
public boolean isLeap(long instant) {
return iChronology.isLeapYear(get(instant));
}
+ @Override
public int getLeapAmount(long instant) {
if (iChronology.isLeapYear(get(instant))) {
return 1;
@@ -115,22 +125,27 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
}
}
+ @Override
public DurationField getLeapDurationField() {
return iChronology.days();
}
+ @Override
public int getMinimumValue() {
return iChronology.getMinYear();
}
+ @Override
public int getMaximumValue() {
return iChronology.getMaxYear();
}
+ @Override
public long roundFloor(long instant) {
return iChronology.getYearMillis(get(instant));
}
+ @Override
public long roundCeiling(long instant) {
int year = get(instant);
long yearStartMillis = iChronology.getYearMillis(year);
@@ -141,6 +156,7 @@ class BasicYearDateTimeField extends ImpreciseDateTimeField {
return instant;
}
+ @Override
public long remainder(long instant) {
return instant - roundFloor(instant);
}
diff --git a/src/main/java/org/joda/time/chrono/BuddhistChronology.java b/src/main/java/org/joda/time/chrono/BuddhistChronology.java
index 99a7d3e4..b448e90d 100644
--- a/src/main/java/org/joda/time/chrono/BuddhistChronology.java
+++ b/src/main/java/org/joda/time/chrono/BuddhistChronology.java
@@ -80,6 +80,8 @@ public final class BuddhistChronology extends AssembledChronology {
* GregorianJulian calendar rules with a cutover date.
* <p>
* The time zone of the returned instance is UTC.
+ *
+ * @return the chronology, not null
*/
public static BuddhistChronology getInstanceUTC() {
return INSTANCE_UTC;
@@ -89,6 +91,8 @@ public final class BuddhistChronology extends AssembledChronology {
* Standard instance of a Buddhist Chronology, that matches
* Sun's BuddhistCalendar class. This means that it follows the
* GregorianJulian calendar rules with a cutover date.
+ *
+ * @return the chronology, not null
*/
public static BuddhistChronology getInstance() {
return getInstance(DateTimeZone.getDefault());
@@ -100,6 +104,7 @@ public final class BuddhistChronology extends AssembledChronology {
* GregorianJulian calendar rules with a cutover date.
*
* @param zone the time zone to use, null is default
+ * @return the chronology, not null
*/
public static BuddhistChronology getInstance(DateTimeZone zone) {
if (zone == null) {
@@ -147,6 +152,7 @@ public final class BuddhistChronology extends AssembledChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -157,6 +163,7 @@ public final class BuddhistChronology extends AssembledChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -175,6 +182,7 @@ public final class BuddhistChronology extends AssembledChronology {
* @return true if equal
* @since 1.6
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -192,6 +200,7 @@ public final class BuddhistChronology extends AssembledChronology {
* @return the hash code
* @since 1.6
*/
+ @Override
public int hashCode() {
return "Buddhist".hashCode() * 11 + getZone().hashCode();
}
@@ -203,6 +212,7 @@ public final class BuddhistChronology extends AssembledChronology {
*
* @return a debugging string
*/
+ @Override
public String toString() {
String str = "BuddhistChronology";
DateTimeZone zone = getZone();
@@ -212,6 +222,7 @@ public final class BuddhistChronology extends AssembledChronology {
return str;
}
+ @Override
protected void assemble(Fields fields) {
if (getParam() == null) {
// force init as used below
diff --git a/src/main/java/org/joda/time/chrono/CopticChronology.java b/src/main/java/org/joda/time/chrono/CopticChronology.java
index 1763c4cc..d9734ff1 100644
--- a/src/main/java/org/joda/time/chrono/CopticChronology.java
+++ b/src/main/java/org/joda/time/chrono/CopticChronology.java
@@ -185,6 +185,7 @@ public final class CopticChronology extends BasicFixedMonthChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -195,6 +196,7 @@ public final class CopticChronology extends BasicFixedMonthChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -212,6 +214,7 @@ public final class CopticChronology extends BasicFixedMonthChronology {
}
//-----------------------------------------------------------------------
+ @Override
long calculateFirstDayOfYearMillis(int year) {
// Java epoch is 1970-01-01 Gregorian which is 1686-04-23 Coptic.
// Calculate relative to the nearest leap year and account for the
@@ -240,21 +243,25 @@ public final class CopticChronology extends BasicFixedMonthChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getMinYear() {
return MIN_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
int getMaxYear() {
return MAX_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
long getApproxMillisAtEpochDividedByTwo() {
return (1686L * MILLIS_PER_YEAR + 112L * DateTimeConstants.MILLIS_PER_DAY) / 2;
}
//-----------------------------------------------------------------------
+ @Override
protected void assemble(Fields fields) {
if (getBase() == null) {
super.assemble(fields);
diff --git a/src/main/java/org/joda/time/chrono/EthiopicChronology.java b/src/main/java/org/joda/time/chrono/EthiopicChronology.java
index 5089f9c7..2ca09d68 100644
--- a/src/main/java/org/joda/time/chrono/EthiopicChronology.java
+++ b/src/main/java/org/joda/time/chrono/EthiopicChronology.java
@@ -184,6 +184,7 @@ public final class EthiopicChronology extends BasicFixedMonthChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -194,6 +195,7 @@ public final class EthiopicChronology extends BasicFixedMonthChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -211,6 +213,7 @@ public final class EthiopicChronology extends BasicFixedMonthChronology {
}
//-----------------------------------------------------------------------
+ @Override
long calculateFirstDayOfYearMillis(int year) {
// Java epoch is 1970-01-01 Gregorian which is 1962-04-23 Ethiopic.
// Calculate relative to the nearest leap year and account for the
@@ -239,21 +242,25 @@ public final class EthiopicChronology extends BasicFixedMonthChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getMinYear() {
return MIN_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
int getMaxYear() {
return MAX_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
long getApproxMillisAtEpochDividedByTwo() {
return (1962L * MILLIS_PER_YEAR + 112L * DateTimeConstants.MILLIS_PER_DAY) / 2;
}
//-----------------------------------------------------------------------
+ @Override
protected void assemble(Fields fields) {
if (getBase() == null) {
super.assemble(fields);
diff --git a/src/main/java/org/joda/time/chrono/GJChronology.java b/src/main/java/org/joda/time/chrono/GJChronology.java
index 0b6069f5..4846f3e2 100644
--- a/src/main/java/org/joda/time/chrono/GJChronology.java
+++ b/src/main/java/org/joda/time/chrono/GJChronology.java
@@ -117,6 +117,8 @@ public final class GJChronology extends AssembledChronology {
* and the minimum days in the first week of the year is 4.
*
* <p>The time zone of the returned instance is UTC.
+ *
+ * @return the chronology, not null
*/
public static GJChronology getInstanceUTC() {
return getInstance(DateTimeZone.UTC, DEFAULT_CUTOVER, 4);
@@ -133,6 +135,8 @@ public final class GJChronology extends AssembledChronology {
* and the minimum days in the first week of the year is 4.
*
* <p>The returned chronology is in the default time zone.
+ *
+ * @return the chronology, not null
*/
public static GJChronology getInstance() {
return getInstance(DateTimeZone.getDefault(), DEFAULT_CUTOVER, 4);
@@ -149,6 +153,7 @@ public final class GJChronology extends AssembledChronology {
* and the minimum days in the first week of the year is 4.
*
* @param zone the time zone to use, null is default
+ * @return the chronology, not null
*/
public static GJChronology getInstance(DateTimeZone zone) {
return getInstance(zone, DEFAULT_CUTOVER, 4);
@@ -164,6 +169,7 @@ public final class GJChronology extends AssembledChronology {
*
* @param zone the time zone to use, null is default
* @param gregorianCutover the cutover to use, null means default
+ * @return the chronology, not null
*/
public static GJChronology getInstance(
DateTimeZone zone,
@@ -179,6 +185,7 @@ public final class GJChronology extends AssembledChronology {
* @param zone the time zone to use, null is default
* @param gregorianCutover the cutover to use, null means default
* @param minDaysInFirstWeek minimum number of days in first week of the year; default is 4
+ * @return the chronology, not null
*/
public static GJChronology getInstance(
DateTimeZone zone,
@@ -228,6 +235,7 @@ public final class GJChronology extends AssembledChronology {
* @param zone the time zone to use, null is default
* @param gregorianCutover the cutover to use
* @param minDaysInFirstWeek minimum number of days in first week of the year; default is 4
+ * @return the chronology, not null
*/
public static GJChronology getInstance(
DateTimeZone zone,
@@ -279,6 +287,7 @@ public final class GJChronology extends AssembledChronology {
return getInstance(getZone(), iCutoverInstant, getMinimumDaysInFirstWeek());
}
+ @Override
public DateTimeZone getZone() {
Chronology base;
if ((base = getBase()) != null) {
@@ -294,6 +303,7 @@ public final class GJChronology extends AssembledChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return withZone(DateTimeZone.UTC);
}
@@ -304,6 +314,7 @@ public final class GJChronology extends AssembledChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -314,6 +325,7 @@ public final class GJChronology extends AssembledChronology {
return getInstance(zone, iCutoverInstant, getMinimumDaysInFirstWeek());
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
@@ -338,6 +350,7 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -405,6 +418,7 @@ public final class GJChronology extends AssembledChronology {
* @return true if equal
* @since 1.6
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -424,6 +438,7 @@ public final class GJChronology extends AssembledChronology {
* @return the hash code
* @since 1.6
*/
+ @Override
public int hashCode() {
return "GJ".hashCode() * 11 + getZone().hashCode() +
getMinimumDaysInFirstWeek() + iCutoverInstant.hashCode();
@@ -436,6 +451,7 @@ public final class GJChronology extends AssembledChronology {
*
* @return a debugging string
*/
+ @Override
public String toString() {
StringBuffer sb = new StringBuffer(60);
sb.append("GJChronology");
@@ -462,6 +478,7 @@ public final class GJChronology extends AssembledChronology {
return sb.toString();
}
+ @Override
protected void assemble(Fields fields) {
Object[] params = (Object[])getParam();
@@ -619,7 +636,7 @@ public final class GJChronology extends AssembledChronology {
* @param julianField field from the chronology used before the cutover instant
* @param gregorianField field from the chronology used at and after the cutover
* @param cutoverMillis the millis of the cutover
- * @param convertByWeekyear
+ * @param convertByWeekyear whether to convert using week-year
*/
CutoverField(DateTimeField julianField, DateTimeField gregorianField,
long cutoverMillis, boolean convertByWeekyear) {
@@ -631,7 +648,7 @@ public final class GJChronology extends AssembledChronology {
* @param gregorianField field from the chronology used at and after the cutover
* @param rangeField the range field
* @param cutoverMillis the millis of the cutover
- * @param convertByWeekyear
+ * @param convertByWeekyear whether to convert using week-year
*/
CutoverField(DateTimeField julianField, DateTimeField gregorianField,
DurationField rangeField, long cutoverMillis, boolean convertByWeekyear) {
@@ -652,10 +669,12 @@ public final class GJChronology extends AssembledChronology {
iRangeDurationField = rangeField;
}
+ @Override
public boolean isLenient() {
return false;
}
+ @Override
public int get(long instant) {
if (instant >= iCutover) {
return iGregorianField.get(instant);
@@ -664,6 +683,7 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public String getAsText(long instant, Locale locale) {
if (instant >= iCutover) {
return iGregorianField.getAsText(instant, locale);
@@ -672,10 +692,12 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return iGregorianField.getAsText(fieldValue, locale);
}
+ @Override
public String getAsShortText(long instant, Locale locale) {
if (instant >= iCutover) {
return iGregorianField.getAsShortText(instant, locale);
@@ -684,18 +706,22 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return iGregorianField.getAsShortText(fieldValue, locale);
}
+ @Override
public long add(long instant, int value) {
return iGregorianField.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return iGregorianField.add(instant, value);
}
+ @Override
public int[] add(ReadablePartial partial, int fieldIndex, int[] values, int valueToAdd) {
// overridden as superclass algorithm can't handle
// 2004-02-29 + 48 months -> 2008-02-29 type dates
@@ -714,14 +740,17 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return iGregorianField.getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return iGregorianField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long set(long instant, int value) {
if (instant >= iCutover) {
instant = iGregorianField.set(instant, value);
@@ -753,6 +782,7 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public long set(long instant, String text, Locale locale) {
if (instant >= iCutover) {
instant = iGregorianField.set(instant, text, locale);
@@ -776,14 +806,17 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public DurationField getDurationField() {
return iDurationField;
}
+ @Override
public DurationField getRangeDurationField() {
return iRangeDurationField;
}
+ @Override
public boolean isLeap(long instant) {
if (instant >= iCutover) {
return iGregorianField.isLeap(instant);
@@ -792,6 +825,7 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public int getLeapAmount(long instant) {
if (instant >= iCutover) {
return iGregorianField.getLeapAmount(instant);
@@ -800,25 +834,30 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public DurationField getLeapDurationField() {
return iGregorianField.getLeapDurationField();
}
+ @Override
public int getMinimumValue() {
// For all precise fields, the Julian and Gregorian limits are
// identical. Choose Julian to tighten up the year limits.
return iJulianField.getMinimumValue();
}
+ @Override
public int getMinimumValue(ReadablePartial partial) {
return iJulianField.getMinimumValue(partial);
}
+ @Override
public int getMinimumValue(ReadablePartial partial, int[] values) {
return iJulianField.getMinimumValue(partial, values);
}
+ @Override
public int getMinimumValue(long instant) {
if (instant < iCutover) {
return iJulianField.getMinimumValue(instant);
@@ -836,12 +875,14 @@ public final class GJChronology extends AssembledChronology {
return min;
}
+ @Override
public int getMaximumValue() {
// For all precise fields, the Julian and Gregorian limits are
// identical.
return iGregorianField.getMaximumValue();
}
+ @Override
public int getMaximumValue(long instant) {
if (instant >= iCutover) {
return iGregorianField.getMaximumValue(instant);
@@ -859,11 +900,13 @@ public final class GJChronology extends AssembledChronology {
return max;
}
+ @Override
public int getMaximumValue(ReadablePartial partial) {
long instant = GJChronology.getInstanceUTC().set(partial, 0L);
return getMaximumValue(instant);
}
+ @Override
public int getMaximumValue(ReadablePartial partial, int[] values) {
Chronology chrono = GJChronology.getInstanceUTC();
long instant = 0L;
@@ -876,6 +919,7 @@ public final class GJChronology extends AssembledChronology {
return getMaximumValue(instant);
}
+ @Override
public long roundFloor(long instant) {
if (instant >= iCutover) {
instant = iGregorianField.roundFloor(instant);
@@ -891,6 +935,7 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public long roundCeiling(long instant) {
if (instant >= iCutover) {
instant = iGregorianField.roundCeiling(instant);
@@ -906,11 +951,13 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return Math.max(iJulianField.getMaximumTextLength(locale),
iGregorianField.getMaximumTextLength(locale));
}
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return Math.max(iJulianField.getMaximumShortTextLength(locale),
iGregorianField.getMaximumShortTextLength(locale));
@@ -990,6 +1037,7 @@ public final class GJChronology extends AssembledChronology {
iDurationField = durationField;
}
+ @Override
public long add(long instant, int value) {
if (instant >= iCutover) {
instant = iGregorianField.add(instant, value);
@@ -1023,6 +1071,7 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public long add(long instant, long value) {
if (instant >= iCutover) {
instant = iGregorianField.add(instant, value);
@@ -1056,6 +1105,7 @@ public final class GJChronology extends AssembledChronology {
return instant;
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
if (minuendInstant >= iCutover) {
if (subtrahendInstant >= iCutover) {
@@ -1076,6 +1126,7 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant >= iCutover) {
if (subtrahendInstant >= iCutover) {
@@ -1106,6 +1157,7 @@ public final class GJChronology extends AssembledChronology {
// at the beginning or end of the year, then the minimum and maximum
// values are not 1 and 12. I don't expect this case to ever occur.
+ @Override
public int getMinimumValue(long instant) {
if (instant >= iCutover) {
return iGregorianField.getMinimumValue(instant);
@@ -1114,6 +1166,7 @@ public final class GJChronology extends AssembledChronology {
}
}
+ @Override
public int getMaximumValue(long instant) {
if (instant >= iCutover) {
return iGregorianField.getMaximumValue(instant);
@@ -1137,18 +1190,22 @@ public final class GJChronology extends AssembledChronology {
iField = dateTimeField;
}
+ @Override
public long add(long instant, int value) {
return iField.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return iField.add(instant, value);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return iField.getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
diff --git a/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java b/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java
index 2eb4f527..f1a69a7b 100644
--- a/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java
@@ -53,6 +53,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @param instant the time instant in millis to query
* @return the day of the week extracted from the input
*/
+ @Override
public int get(long instant) {
return iChronology.getDayOfWeek(instant);
}
@@ -64,6 +65,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @param locale the locale to use
* @return the day of the week, such as 'Monday'
*/
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue);
}
@@ -75,6 +77,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @param locale the locale to use
* @return the day of the week, such as 'Mon'
*/
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue);
}
@@ -87,10 +90,12 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @return the value extracted from the text
* @throws IllegalArgumentException if the text is invalid
*/
+ @Override
protected int convertText(String text, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekTextToValue(text);
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.weeks();
}
@@ -100,6 +105,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
*
* @return the field's minimum value
*/
+ @Override
public int getMinimumValue() {
return DateTimeConstants.MONDAY;
}
@@ -109,6 +115,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
*
* @return the field's maximum value
*/
+ @Override
public int getMaximumValue() {
return DateTimeConstants.SUNDAY;
}
@@ -119,6 +126,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @param locale the locale to use
* @return the maximum textual length
*/
+ @Override
public int getMaximumTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getDayOfWeekMaxTextLength();
}
@@ -129,6 +137,7 @@ final class GJDayOfWeekDateTimeField extends PreciseDurationDateTimeField {
* @param locale the locale to use
* @return the maximum abbreviated textual length
*/
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getDayOfWeekMaxShortTextLength();
}
diff --git a/src/main/java/org/joda/time/chrono/GJEraDateTimeField.java b/src/main/java/org/joda/time/chrono/GJEraDateTimeField.java
index 5c4484b8..1956bb0b 100644
--- a/src/main/java/org/joda/time/chrono/GJEraDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/GJEraDateTimeField.java
@@ -48,6 +48,7 @@ final class GJEraDateTimeField extends BaseDateTimeField {
iChronology = chronology;
}
+ @Override
public boolean isLenient() {
return false;
}
@@ -57,6 +58,7 @@ final class GJEraDateTimeField extends BaseDateTimeField {
*
* @param instant the time instant in millis to query.
*/
+ @Override
public int get(long instant) {
if (iChronology.getYear(instant) <= 0) {
return DateTimeConstants.BCE;
@@ -65,6 +67,7 @@ final class GJEraDateTimeField extends BaseDateTimeField {
}
}
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).eraValueToText(fieldValue);
}
@@ -77,6 +80,7 @@ final class GJEraDateTimeField extends BaseDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if era is invalid.
*/
+ @Override
public long set(long instant, int era) {
FieldUtils.verifyValueBounds(this, era, DateTimeConstants.BCE, DateTimeConstants.CE);
@@ -89,10 +93,12 @@ final class GJEraDateTimeField extends BaseDateTimeField {
}
}
+ @Override
public long set(long instant, String text, Locale locale) {
return set(instant, GJLocaleSymbols.forLocale(locale).eraTextToValue(text));
}
+ @Override
public long roundFloor(long instant) {
if (get(instant) == DateTimeConstants.CE) {
return iChronology.setYear(0, 1);
@@ -101,6 +107,7 @@ final class GJEraDateTimeField extends BaseDateTimeField {
}
}
+ @Override
public long roundCeiling(long instant) {
if (get(instant) == DateTimeConstants.BCE) {
return iChronology.setYear(0, 1);
@@ -109,37 +116,45 @@ final class GJEraDateTimeField extends BaseDateTimeField {
}
}
+ @Override
public long roundHalfFloor(long instant) {
// In reality, the era is infinite, so there is no halfway point.
return roundFloor(instant);
}
+ @Override
public long roundHalfCeiling(long instant) {
// In reality, the era is infinite, so there is no halfway point.
return roundFloor(instant);
}
+ @Override
public long roundHalfEven(long instant) {
// In reality, the era is infinite, so there is no halfway point.
return roundFloor(instant);
}
+ @Override
public DurationField getDurationField() {
return UnsupportedDurationField.getInstance(DurationFieldType.eras());
}
+ @Override
public DurationField getRangeDurationField() {
return null;
}
+ @Override
public int getMinimumValue() {
return DateTimeConstants.BCE;
}
+ @Override
public int getMaximumValue() {
return DateTimeConstants.CE;
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getEraMaxTextLength();
}
diff --git a/src/main/java/org/joda/time/chrono/GJMonthOfYearDateTimeField.java b/src/main/java/org/joda/time/chrono/GJMonthOfYearDateTimeField.java
index 1d3d6cf4..e3c5bc63 100644
--- a/src/main/java/org/joda/time/chrono/GJMonthOfYearDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/GJMonthOfYearDateTimeField.java
@@ -39,26 +39,31 @@ final class GJMonthOfYearDateTimeField extends BasicMonthOfYearDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).monthOfYearValueToText(fieldValue);
}
//-----------------------------------------------------------------------
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).monthOfYearValueToShortText(fieldValue);
}
//-----------------------------------------------------------------------
+ @Override
protected int convertText(String text, Locale locale) {
return GJLocaleSymbols.forLocale(locale).monthOfYearTextToValue(text);
}
//-----------------------------------------------------------------------
+ @Override
public int getMaximumTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getMonthMaxTextLength();
}
//-----------------------------------------------------------------------
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return GJLocaleSymbols.forLocale(locale).getMonthMaxShortTextLength();
}
diff --git a/src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java b/src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java
index 6ddde9a5..a4101657 100644
--- a/src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java
@@ -48,6 +48,7 @@ final class GJYearOfEraDateTimeField extends DecoratedDateTimeField {
return iChronology.eras();
}
+ @Override
public int get(long instant) {
int year = getWrappedField().get(instant);
if (year <= 0) {
@@ -56,26 +57,32 @@ final class GJYearOfEraDateTimeField extends DecoratedDateTimeField {
return year;
}
+ @Override
public long add(long instant, int years) {
return getWrappedField().add(instant, years);
}
+ @Override
public long add(long instant, long years) {
return getWrappedField().add(instant, years);
}
+ @Override
public long addWrapField(long instant, int years) {
return getWrappedField().addWrapField(instant, years);
}
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int years) {
return getWrappedField().addWrapField(instant, fieldIndex, values, years);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
@@ -88,6 +95,7 @@ final class GJYearOfEraDateTimeField extends DecoratedDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if year is invalid.
*/
+ @Override
public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, year, 1, getMaximumValue());
if (iChronology.getYear(instant) <= 0) {
@@ -96,22 +104,27 @@ final class GJYearOfEraDateTimeField extends DecoratedDateTimeField {
return super.set(instant, year);
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return getWrappedField().getMaximumValue();
}
+ @Override
public long roundFloor(long instant) {
return getWrappedField().roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return getWrappedField().roundCeiling(instant);
}
+ @Override
public long remainder(long instant) {
return getWrappedField().remainder(instant);
}
diff --git a/src/main/java/org/joda/time/chrono/GregorianChronology.java b/src/main/java/org/joda/time/chrono/GregorianChronology.java
index 66c90472..324126ca 100644
--- a/src/main/java/org/joda/time/chrono/GregorianChronology.java
+++ b/src/main/java/org/joda/time/chrono/GregorianChronology.java
@@ -172,6 +172,7 @@ public final class GregorianChronology extends BasicGJChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -182,6 +183,7 @@ public final class GregorianChronology extends BasicGJChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -192,16 +194,19 @@ public final class GregorianChronology extends BasicGJChronology {
return getInstance(zone);
}
+ @Override
protected void assemble(Fields fields) {
if (getBase() == null) {
super.assemble(fields);
}
}
+ @Override
boolean isLeapYear(int year) {
return ((year & 3) == 0) && ((year % 100) != 0 || (year % 400) == 0);
}
+ @Override
long calculateFirstDayOfYearMillis(int year) {
// Initial value is just temporary.
int leapYears = year / 100;
@@ -222,26 +227,32 @@ public final class GregorianChronology extends BasicGJChronology {
return (year * 365L + (leapYears - DAYS_0000_TO_1970)) * DateTimeConstants.MILLIS_PER_DAY;
}
+ @Override
int getMinYear() {
return MIN_YEAR;
}
+ @Override
int getMaxYear() {
return MAX_YEAR;
}
+ @Override
long getAverageMillisPerYear() {
return MILLIS_PER_YEAR;
}
+ @Override
long getAverageMillisPerYearDividedByTwo() {
return MILLIS_PER_YEAR / 2;
}
+ @Override
long getAverageMillisPerMonth() {
return MILLIS_PER_MONTH;
}
+ @Override
long getApproxMillisAtEpochDividedByTwo() {
return (1970L * MILLIS_PER_YEAR) / 2;
}
diff --git a/src/main/java/org/joda/time/chrono/ISOChronology.java b/src/main/java/org/joda/time/chrono/ISOChronology.java
index af70fc4a..cd44a9e2 100644
--- a/src/main/java/org/joda/time/chrono/ISOChronology.java
+++ b/src/main/java/org/joda/time/chrono/ISOChronology.java
@@ -117,6 +117,7 @@ public final class ISOChronology extends AssembledChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -127,6 +128,7 @@ public final class ISOChronology extends AssembledChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -144,6 +146,7 @@ public final class ISOChronology extends AssembledChronology {
*
* @return a debugging string
*/
+ @Override
public String toString() {
String str = "ISOChronology";
DateTimeZone zone = getZone();
@@ -153,6 +156,7 @@ public final class ISOChronology extends AssembledChronology {
return str;
}
+ @Override
protected void assemble(Fields fields) {
if (getBase().getZone() == DateTimeZone.UTC) {
// Use zero based century and year of century.
@@ -175,6 +179,7 @@ public final class ISOChronology extends AssembledChronology {
* @return true if equal
* @since 1.6
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -192,6 +197,7 @@ public final class ISOChronology extends AssembledChronology {
* @return the hash code
* @since 1.6
*/
+ @Override
public int hashCode() {
return "ISO".hashCode() * 11 + getZone().hashCode();
}
diff --git a/src/main/java/org/joda/time/chrono/ISOYearOfEraDateTimeField.java b/src/main/java/org/joda/time/chrono/ISOYearOfEraDateTimeField.java
index 7d0b6bc2..39bf3832 100644
--- a/src/main/java/org/joda/time/chrono/ISOYearOfEraDateTimeField.java
+++ b/src/main/java/org/joda/time/chrono/ISOYearOfEraDateTimeField.java
@@ -53,35 +53,43 @@ class ISOYearOfEraDateTimeField extends DecoratedDateTimeField {
return GregorianChronology.getInstanceUTC().eras();
}
+ @Override
public int get(long instant) {
int year = getWrappedField().get(instant);
return year < 0 ? -year : year;
}
+ @Override
public long add(long instant, int years) {
return getWrappedField().add(instant, years);
}
+ @Override
public long add(long instant, long years) {
return getWrappedField().add(instant, years);
}
+ @Override
public long addWrapField(long instant, int years) {
return getWrappedField().addWrapField(instant, years);
}
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int years) {
return getWrappedField().addWrapField(instant, fieldIndex, values, years);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, year, 0, getMaximumValue());
if (getWrappedField().get(instant) < 0) {
@@ -90,22 +98,27 @@ class ISOYearOfEraDateTimeField extends DecoratedDateTimeField {
return super.set(instant, year);
}
+ @Override
public int getMinimumValue() {
return 0;
}
+ @Override
public int getMaximumValue() {
return getWrappedField().getMaximumValue();
}
+ @Override
public long roundFloor(long instant) {
return getWrappedField().roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return getWrappedField().roundCeiling(instant);
}
+ @Override
public long remainder(long instant) {
return getWrappedField().remainder(instant);
}
diff --git a/src/main/java/org/joda/time/chrono/IslamicChronology.java b/src/main/java/org/joda/time/chrono/IslamicChronology.java
index d6a2afd0..0f2c42ed 100644
--- a/src/main/java/org/joda/time/chrono/IslamicChronology.java
+++ b/src/main/java/org/joda/time/chrono/IslamicChronology.java
@@ -260,6 +260,7 @@ public final class IslamicChronology extends BasicChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -270,6 +271,7 @@ public final class IslamicChronology extends BasicChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -288,6 +290,7 @@ public final class IslamicChronology extends BasicChronology {
* @return true if equal
* @since 2.3
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -306,11 +309,13 @@ public final class IslamicChronology extends BasicChronology {
* @return the hash code
* @since 1.6
*/
+ @Override
public int hashCode() {
return super.hashCode() * 13 + getLeapYearPatternType().hashCode();
}
//-----------------------------------------------------------------------
+ @Override
int getYear(long instant) {
long millisIslamic = instant - MILLIS_YEAR_1;
long cycles = millisIslamic / MILLIS_PER_CYCLE;
@@ -325,6 +330,7 @@ public final class IslamicChronology extends BasicChronology {
return year;
}
+ @Override
long setYear(long instant, int year) {
// optimsed implementation of set, due to fixed months
int thisYear = getYear(instant);
@@ -343,6 +349,7 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getYearDifference(long minuendInstant, long subtrahendInstant) {
// optimsed implementation of getDifference, due to fixed months
int minuendYear = getYear(minuendInstant);
@@ -360,6 +367,7 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getTotalMillisByYearMonth(int year, int month) {
if (--month % 2 == 1) {
month /= 2;
@@ -371,6 +379,7 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getDayOfMonth(long millis) {
// optimised for simple months
int doy = getDayOfYear(millis) - 1;
@@ -381,21 +390,25 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
boolean isLeapYear(int year) {
return iLeapYears.isLeapYear(year);
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInYearMax() {
return 355;
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInYear(int year) {
return isLeapYear(year) ? 355 : 354;
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInYearMonth(int year, int month) {
if (month == 12 && isLeapYear(year)) {
return LONG_MONTH_LENGTH;
@@ -404,11 +417,13 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMax() {
return LONG_MONTH_LENGTH;
}
//-----------------------------------------------------------------------
+ @Override
int getDaysInMonthMax(int month) {
if (month == 12) {
return LONG_MONTH_LENGTH;
@@ -417,6 +432,7 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getMonthOfYear(long millis, int year) {
int doyZeroBased = (int) ((millis - getYearMillis(year)) / DateTimeConstants.MILLIS_PER_DAY);
if (doyZeroBased == 354) {
@@ -431,21 +447,25 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerYear() {
return MILLIS_PER_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerYearDividedByTwo() {
return MILLIS_PER_YEAR / 2;
}
//-----------------------------------------------------------------------
+ @Override
long getAverageMillisPerMonth() {
return MILLIS_PER_MONTH;
}
//-----------------------------------------------------------------------
+ @Override
long calculateFirstDayOfYearMillis(int year) {
if (year > MAX_YEAR) {
throw new ArithmeticException("Year is too large: " + year + " > " + MAX_YEAR);
@@ -471,22 +491,26 @@ public final class IslamicChronology extends BasicChronology {
}
//-----------------------------------------------------------------------
+ @Override
int getMinYear() {
return 1; //MIN_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
int getMaxYear() {
return MAX_YEAR;
}
//-----------------------------------------------------------------------
+ @Override
long getApproxMillisAtEpochDividedByTwo() {
// Epoch 1970-01-01 ISO = 1389-10-22 Islamic
return (-MILLIS_YEAR_1) / 2;
}
//-----------------------------------------------------------------------
+ @Override
protected void assemble(Fields fields) {
if (getBase() == null) {
super.assemble(fields);
diff --git a/src/main/java/org/joda/time/chrono/JulianChronology.java b/src/main/java/org/joda/time/chrono/JulianChronology.java
index fa261bd4..7d93e0e3 100644
--- a/src/main/java/org/joda/time/chrono/JulianChronology.java
+++ b/src/main/java/org/joda/time/chrono/JulianChronology.java
@@ -186,6 +186,7 @@ public final class JulianChronology extends BasicGJChronology {
*
* @return the chronology in UTC
*/
+ @Override
public Chronology withUTC() {
return INSTANCE_UTC;
}
@@ -196,6 +197,7 @@ public final class JulianChronology extends BasicGJChronology {
* @param zone the zone to get the chronology in, null is default
* @return the chronology
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -206,16 +208,19 @@ public final class JulianChronology extends BasicGJChronology {
return getInstance(zone);
}
+ @Override
long getDateMidnightMillis(int year, int monthOfYear, int dayOfMonth)
throws IllegalArgumentException
{
return super.getDateMidnightMillis(adjustYearForSet(year), monthOfYear, dayOfMonth);
}
+ @Override
boolean isLeapYear(int year) {
return (year & 3) == 0;
}
+ @Override
long calculateFirstDayOfYearMillis(int year) {
// Java epoch is 1970-01-01 Gregorian which is 1969-12-19 Julian.
// Calculate relative to the nearest leap year and account for the
@@ -242,30 +247,37 @@ public final class JulianChronology extends BasicGJChronology {
return millis - (366L + 352) * DateTimeConstants.MILLIS_PER_DAY;
}
+ @Override
int getMinYear() {
return MIN_YEAR;
}
+ @Override
int getMaxYear() {
return MAX_YEAR;
}
+ @Override
long getAverageMillisPerYear() {
return MILLIS_PER_YEAR;
}
+ @Override
long getAverageMillisPerYearDividedByTwo() {
return MILLIS_PER_YEAR / 2;
}
+ @Override
long getAverageMillisPerMonth() {
return MILLIS_PER_MONTH;
}
+ @Override
long getApproxMillisAtEpochDividedByTwo() {
return (1969L * MILLIS_PER_YEAR + 352L * DateTimeConstants.MILLIS_PER_DAY) / 2;
}
+ @Override
protected void assemble(Fields fields) {
if (getBase() == null) {
super.assemble(fields);
diff --git a/src/main/java/org/joda/time/chrono/LenientChronology.java b/src/main/java/org/joda/time/chrono/LenientChronology.java
index f072d586..8153b48b 100644
--- a/src/main/java/org/joda/time/chrono/LenientChronology.java
+++ b/src/main/java/org/joda/time/chrono/LenientChronology.java
@@ -39,6 +39,7 @@ public final class LenientChronology extends AssembledChronology {
* Create a LenientChronology for any chronology.
*
* @param base the chronology to wrap
+ * @return the chronology, not null
* @throws IllegalArgumentException if chronology is null
*/
public static LenientChronology getInstance(Chronology base) {
@@ -59,6 +60,7 @@ public final class LenientChronology extends AssembledChronology {
super(base, null);
}
+ @Override
public Chronology withUTC() {
if (iWithUTC == null) {
if (getZone() == DateTimeZone.UTC) {
@@ -70,6 +72,7 @@ public final class LenientChronology extends AssembledChronology {
return iWithUTC;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -83,6 +86,7 @@ public final class LenientChronology extends AssembledChronology {
return LenientChronology.getInstance(getBase().withZone(zone));
}
+ @Override
protected void assemble(Fields fields) {
fields.year = convertField(fields.year);
fields.yearOfEra = convertField(fields.yearOfEra);
@@ -123,6 +127,7 @@ public final class LenientChronology extends AssembledChronology {
* @return true if equal
* @since 1.4
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -140,6 +145,7 @@ public final class LenientChronology extends AssembledChronology {
* @return the hashcode
* @since 1.4
*/
+ @Override
public int hashCode() {
return 236548278 + getBase().hashCode() * 7;
}
@@ -149,6 +155,7 @@ public final class LenientChronology extends AssembledChronology {
*
* @return the debugging string
*/
+ @Override
public String toString() {
return "LenientChronology[" + getBase().toString() + ']';
}
diff --git a/src/main/java/org/joda/time/chrono/LimitChronology.java b/src/main/java/org/joda/time/chrono/LimitChronology.java
index 1e0aa93b..e25184e4 100644
--- a/src/main/java/org/joda/time/chrono/LimitChronology.java
+++ b/src/main/java/org/joda/time/chrono/LimitChronology.java
@@ -59,6 +59,7 @@ public final class LimitChronology extends AssembledChronology {
* @param base base chronology to wrap
* @param lowerLimit inclusive lower limit, or null if none
* @param upperLimit exclusive upper limit, or null if none
+ * @return the chronology, not null
* @throws IllegalArgumentException if chronology is null or limits are invalid
*/
public static LimitChronology getInstance(Chronology base,
@@ -123,6 +124,7 @@ public final class LimitChronology extends AssembledChronology {
* returned. Otherwise, a new instance is returned, with the limits
* adjusted to the new time zone.
*/
+ @Override
public Chronology withUTC() {
return withZone(DateTimeZone.UTC);
}
@@ -132,6 +134,7 @@ public final class LimitChronology extends AssembledChronology {
* this is returned. Otherwise, a new instance is returned, with the limits
* adjusted to the new time zone.
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -168,6 +171,7 @@ public final class LimitChronology extends AssembledChronology {
return chrono;
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
@@ -177,6 +181,7 @@ public final class LimitChronology extends AssembledChronology {
return instant;
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -189,6 +194,7 @@ public final class LimitChronology extends AssembledChronology {
return instant;
}
+ @Override
public long getDateTimeMillis(long instant,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -201,6 +207,7 @@ public final class LimitChronology extends AssembledChronology {
return instant;
}
+ @Override
protected void assemble(Fields fields) {
// Keep a local cache of converted fields so as not to create redundant
// objects.
@@ -297,6 +304,7 @@ public final class LimitChronology extends AssembledChronology {
* @return true if equal
* @since 1.4
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -317,6 +325,7 @@ public final class LimitChronology extends AssembledChronology {
* @return the hashcode
* @since 1.4
*/
+ @Override
public int hashCode() {
int hash = 317351877;
hash += (getLowerLimit() != null ? getLowerLimit().hashCode() : 0);
@@ -330,6 +339,7 @@ public final class LimitChronology extends AssembledChronology {
*
* @return the debugging string
*/
+ @Override
public String toString() {
return "LimitChronology[" + getBase().toString() + ", " +
(getLowerLimit() == null ? "NoLimit" : getLowerLimit().toString()) + ", " +
@@ -351,6 +361,7 @@ public final class LimitChronology extends AssembledChronology {
iIsLow = isLow;
}
+ @Override
public String getMessage() {
StringBuffer buf = new StringBuffer(85);
buf.append("The");
@@ -378,6 +389,7 @@ public final class LimitChronology extends AssembledChronology {
return buf.toString();
}
+ @Override
public String toString() {
return "IllegalArgumentException: " + getMessage();
}
@@ -390,26 +402,31 @@ public final class LimitChronology extends AssembledChronology {
super(field, field.getType());
}
+ @Override
public int getValue(long duration, long instant) {
checkLimits(instant, null);
return getWrappedField().getValue(duration, instant);
}
+ @Override
public long getValueAsLong(long duration, long instant) {
checkLimits(instant, null);
return getWrappedField().getValueAsLong(duration, instant);
}
+ @Override
public long getMillis(int value, long instant) {
checkLimits(instant, null);
return getWrappedField().getMillis(value, instant);
}
+ @Override
public long getMillis(long value, long instant) {
checkLimits(instant, null);
return getWrappedField().getMillis(value, instant);
}
+ @Override
public long add(long instant, int amount) {
checkLimits(instant, null);
long result = getWrappedField().add(instant, amount);
@@ -417,6 +434,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long add(long instant, long amount) {
checkLimits(instant, null);
long result = getWrappedField().add(instant, amount);
@@ -424,12 +442,14 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
checkLimits(minuendInstant, "minuend");
checkLimits(subtrahendInstant, "subtrahend");
return getWrappedField().getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
checkLimits(minuendInstant, "minuend");
checkLimits(subtrahendInstant, "subtrahend");
@@ -456,21 +476,25 @@ public final class LimitChronology extends AssembledChronology {
iLeapDurationField = leapDurationField;
}
+ @Override
public int get(long instant) {
checkLimits(instant, null);
return getWrappedField().get(instant);
}
+ @Override
public String getAsText(long instant, Locale locale) {
checkLimits(instant, null);
return getWrappedField().getAsText(instant, locale);
}
+ @Override
public String getAsShortText(long instant, Locale locale) {
checkLimits(instant, null);
return getWrappedField().getAsShortText(instant, locale);
}
+ @Override
public long add(long instant, int amount) {
checkLimits(instant, null);
long result = getWrappedField().add(instant, amount);
@@ -478,6 +502,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long add(long instant, long amount) {
checkLimits(instant, null);
long result = getWrappedField().add(instant, amount);
@@ -485,6 +510,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long addWrapField(long instant, int amount) {
checkLimits(instant, null);
long result = getWrappedField().addWrapField(instant, amount);
@@ -492,18 +518,21 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
checkLimits(minuendInstant, "minuend");
checkLimits(subtrahendInstant, "subtrahend");
return getWrappedField().getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
checkLimits(minuendInstant, "minuend");
checkLimits(subtrahendInstant, "subtrahend");
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long set(long instant, int value) {
checkLimits(instant, null);
long result = getWrappedField().set(instant, value);
@@ -511,6 +540,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long set(long instant, String text, Locale locale) {
checkLimits(instant, null);
long result = getWrappedField().set(instant, text, locale);
@@ -518,28 +548,34 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public final DurationField getDurationField() {
return iDurationField;
}
+ @Override
public final DurationField getRangeDurationField() {
return iRangeDurationField;
}
+ @Override
public boolean isLeap(long instant) {
checkLimits(instant, null);
return getWrappedField().isLeap(instant);
}
+ @Override
public int getLeapAmount(long instant) {
checkLimits(instant, null);
return getWrappedField().getLeapAmount(instant);
}
+ @Override
public final DurationField getLeapDurationField() {
return iLeapDurationField;
}
+ @Override
public long roundFloor(long instant) {
checkLimits(instant, null);
long result = getWrappedField().roundFloor(instant);
@@ -547,6 +583,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long roundCeiling(long instant) {
checkLimits(instant, null);
long result = getWrappedField().roundCeiling(instant);
@@ -554,6 +591,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long roundHalfFloor(long instant) {
checkLimits(instant, null);
long result = getWrappedField().roundHalfFloor(instant);
@@ -561,6 +599,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long roundHalfCeiling(long instant) {
checkLimits(instant, null);
long result = getWrappedField().roundHalfCeiling(instant);
@@ -568,6 +607,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long roundHalfEven(long instant) {
checkLimits(instant, null);
long result = getWrappedField().roundHalfEven(instant);
@@ -575,6 +615,7 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public long remainder(long instant) {
checkLimits(instant, null);
long result = getWrappedField().remainder(instant);
@@ -582,20 +623,24 @@ public final class LimitChronology extends AssembledChronology {
return result;
}
+ @Override
public int getMinimumValue(long instant) {
checkLimits(instant, null);
return getWrappedField().getMinimumValue(instant);
}
+ @Override
public int getMaximumValue(long instant) {
checkLimits(instant, null);
return getWrappedField().getMaximumValue(instant);
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return getWrappedField().getMaximumTextLength(locale);
}
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return getWrappedField().getMaximumShortTextLength(locale);
}
diff --git a/src/main/java/org/joda/time/chrono/StrictChronology.java b/src/main/java/org/joda/time/chrono/StrictChronology.java
index 898445d9..f1c0b9b5 100644
--- a/src/main/java/org/joda/time/chrono/StrictChronology.java
+++ b/src/main/java/org/joda/time/chrono/StrictChronology.java
@@ -39,6 +39,7 @@ public final class StrictChronology extends AssembledChronology {
* Create a StrictChronology for any chronology.
*
* @param base the chronology to wrap
+ * @return the chronology, not null
* @throws IllegalArgumentException if chronology is null
*/
public static StrictChronology getInstance(Chronology base) {
@@ -59,6 +60,7 @@ public final class StrictChronology extends AssembledChronology {
super(base, null);
}
+ @Override
public Chronology withUTC() {
if (iWithUTC == null) {
if (getZone() == DateTimeZone.UTC) {
@@ -70,6 +72,7 @@ public final class StrictChronology extends AssembledChronology {
return iWithUTC;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -83,6 +86,7 @@ public final class StrictChronology extends AssembledChronology {
return StrictChronology.getInstance(getBase().withZone(zone));
}
+ @Override
protected void assemble(Fields fields) {
fields.year = convertField(fields.year);
fields.yearOfEra = convertField(fields.yearOfEra);
@@ -123,6 +127,7 @@ public final class StrictChronology extends AssembledChronology {
* @return true if equal
* @since 1.4
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -140,6 +145,7 @@ public final class StrictChronology extends AssembledChronology {
* @return the hashcode
* @since 1.4
*/
+ @Override
public int hashCode() {
return 352831696 + getBase().hashCode() * 7;
}
@@ -149,6 +155,7 @@ public final class StrictChronology extends AssembledChronology {
*
* @return the debugging string
*/
+ @Override
public String toString() {
return "StrictChronology[" + getBase().toString() + ']';
}
diff --git a/src/main/java/org/joda/time/chrono/ZonedChronology.java b/src/main/java/org/joda/time/chrono/ZonedChronology.java
index 23fde526..8180ecb6 100644
--- a/src/main/java/org/joda/time/chrono/ZonedChronology.java
+++ b/src/main/java/org/joda/time/chrono/ZonedChronology.java
@@ -53,6 +53,7 @@ public final class ZonedChronology extends AssembledChronology {
*
* @param base base chronology to wrap
* @param zone the time zone
+ * @return the chronology, not null
* @throws IllegalArgumentException if chronology or time zone is null
*/
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
@@ -85,14 +86,17 @@ public final class ZonedChronology extends AssembledChronology {
super(base, zone);
}
+ @Override
public DateTimeZone getZone() {
return (DateTimeZone)getParam();
}
+ @Override
public Chronology withUTC() {
return getBase();
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
@@ -106,6 +110,7 @@ public final class ZonedChronology extends AssembledChronology {
return new ZonedChronology(getBase(), zone);
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
@@ -114,6 +119,7 @@ public final class ZonedChronology extends AssembledChronology {
(year, monthOfYear, dayOfMonth, millisOfDay));
}
+ @Override
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -124,6 +130,7 @@ public final class ZonedChronology extends AssembledChronology {
hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond));
}
+ @Override
public long getDateTimeMillis(long instant,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
@@ -159,6 +166,7 @@ public final class ZonedChronology extends AssembledChronology {
return utcInstant;
}
+ @Override
protected void assemble(Fields fields) {
// Keep a local cache of converted fields so as not to create redundant
// objects.
@@ -245,6 +253,7 @@ public final class ZonedChronology extends AssembledChronology {
* @return true if equal
* @since 1.4
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -264,6 +273,7 @@ public final class ZonedChronology extends AssembledChronology {
* @return the hashcode
* @since 1.4
*/
+ @Override
public int hashCode() {
return 326565 + getZone().hashCode() * 11 + getBase().hashCode() * 7;
}
@@ -273,6 +283,7 @@ public final class ZonedChronology extends AssembledChronology {
*
* @return the debugging string
*/
+ @Override
public String toString() {
return "ZonedChronology[" + getBase() + ", " + getZone().getID() + ']';
}
@@ -302,42 +313,51 @@ public final class ZonedChronology extends AssembledChronology {
iZone = zone;
}
+ @Override
public boolean isPrecise() {
return iTimeField ? iField.isPrecise() : iField.isPrecise() && this.iZone.isFixed();
}
+ @Override
public long getUnitMillis() {
return iField.getUnitMillis();
}
+ @Override
public int getValue(long duration, long instant) {
return iField.getValue(duration, addOffset(instant));
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return iField.getValueAsLong(duration, addOffset(instant));
}
+ @Override
public long getMillis(int value, long instant) {
return iField.getMillis(value, addOffset(instant));
}
+ @Override
public long getMillis(long value, long instant) {
return iField.getMillis(value, addOffset(instant));
}
+ @Override
public long add(long instant, int value) {
int offset = getOffsetToAdd(instant);
instant = iField.add(instant + offset, value);
return instant - (iTimeField ? offset : getOffsetFromLocalToSubtract(instant));
}
+ @Override
public long add(long instant, long value) {
int offset = getOffsetToAdd(instant);
instant = iField.add(instant + offset, value);
return instant - (iTimeField ? offset : getOffsetFromLocalToSubtract(instant));
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
int offset = getOffsetToAdd(subtrahendInstant);
return iField.getDifference
@@ -345,6 +365,7 @@ public final class ZonedChronology extends AssembledChronology {
subtrahendInstant + offset);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
int offset = getOffsetToAdd(subtrahendInstant);
return iField.getDifferenceAsLong
@@ -428,33 +449,40 @@ public final class ZonedChronology extends AssembledChronology {
iLeapDurationField = leapDurationField;
}
+ @Override
public boolean isLenient() {
return iField.isLenient();
}
+ @Override
public int get(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.get(localInstant);
}
+ @Override
public String getAsText(long instant, Locale locale) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.getAsText(localInstant, locale);
}
+ @Override
public String getAsShortText(long instant, Locale locale) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.getAsShortText(localInstant, locale);
}
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return iField.getAsText(fieldValue, locale);
}
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return iField.getAsShortText(fieldValue, locale);
}
+ @Override
public long add(long instant, int value) {
if (iTimeField) {
int offset = getOffsetToAdd(instant);
@@ -467,6 +495,7 @@ public final class ZonedChronology extends AssembledChronology {
}
}
+ @Override
public long add(long instant, long value) {
if (iTimeField) {
int offset = getOffsetToAdd(instant);
@@ -479,6 +508,7 @@ public final class ZonedChronology extends AssembledChronology {
}
}
+ @Override
public long addWrapField(long instant, int value) {
if (iTimeField) {
int offset = getOffsetToAdd(instant);
@@ -491,6 +521,7 @@ public final class ZonedChronology extends AssembledChronology {
}
}
+ @Override
public long set(long instant, int value) {
long localInstant = iZone.convertUTCToLocal(instant);
localInstant = iField.set(localInstant, value);
@@ -504,6 +535,7 @@ public final class ZonedChronology extends AssembledChronology {
return result;
}
+ @Override
public long set(long instant, String text, Locale locale) {
// cannot verify that new value stuck because set may be lenient
long localInstant = iZone.convertUTCToLocal(instant);
@@ -511,6 +543,7 @@ public final class ZonedChronology extends AssembledChronology {
return iZone.convertLocalToUTC(localInstant, false, instant);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
int offset = getOffsetToAdd(subtrahendInstant);
return iField.getDifference
@@ -518,6 +551,7 @@ public final class ZonedChronology extends AssembledChronology {
subtrahendInstant + offset);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
int offset = getOffsetToAdd(subtrahendInstant);
return iField.getDifferenceAsLong
@@ -525,28 +559,34 @@ public final class ZonedChronology extends AssembledChronology {
subtrahendInstant + offset);
}
+ @Override
public final DurationField getDurationField() {
return iDurationField;
}
+ @Override
public final DurationField getRangeDurationField() {
return iRangeDurationField;
}
+ @Override
public boolean isLeap(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.isLeap(localInstant);
}
+ @Override
public int getLeapAmount(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.getLeapAmount(localInstant);
}
+ @Override
public final DurationField getLeapDurationField() {
return iLeapDurationField;
}
+ @Override
public long roundFloor(long instant) {
if (iTimeField) {
int offset = getOffsetToAdd(instant);
@@ -559,6 +599,7 @@ public final class ZonedChronology extends AssembledChronology {
}
}
+ @Override
public long roundCeiling(long instant) {
if (iTimeField) {
int offset = getOffsetToAdd(instant);
@@ -571,49 +612,60 @@ public final class ZonedChronology extends AssembledChronology {
}
}
+ @Override
public long remainder(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.remainder(localInstant);
}
+ @Override
public int getMinimumValue() {
return iField.getMinimumValue();
}
+ @Override
public int getMinimumValue(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.getMinimumValue(localInstant);
}
+ @Override
public int getMinimumValue(ReadablePartial instant) {
return iField.getMinimumValue(instant);
}
+ @Override
public int getMinimumValue(ReadablePartial instant, int[] values) {
return iField.getMinimumValue(instant, values);
}
+ @Override
public int getMaximumValue() {
return iField.getMaximumValue();
}
+ @Override
public int getMaximumValue(long instant) {
long localInstant = iZone.convertUTCToLocal(instant);
return iField.getMaximumValue(localInstant);
}
+ @Override
public int getMaximumValue(ReadablePartial instant) {
return iField.getMaximumValue(instant);
}
+ @Override
public int getMaximumValue(ReadablePartial instant, int[] values) {
return iField.getMaximumValue(instant, values);
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return iField.getMaximumTextLength(locale);
}
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return iField.getMaximumShortTextLength(locale);
}
diff --git a/src/main/java/org/joda/time/convert/AbstractConverter.java b/src/main/java/org/joda/time/convert/AbstractConverter.java
index 2bcd94d7..f58aa09e 100644
--- a/src/main/java/org/joda/time/convert/AbstractConverter.java
+++ b/src/main/java/org/joda/time/convert/AbstractConverter.java
@@ -154,6 +154,7 @@ public abstract class AbstractConverter implements Converter {
*
* @return a debugging string
*/
+ @Override
public String toString() {
return "Converter[" + (getSupportedType() == null ? "null" : getSupportedType().getName()) + "]";
}
diff --git a/src/main/java/org/joda/time/convert/CalendarConverter.java b/src/main/java/org/joda/time/convert/CalendarConverter.java
index a61e8231..75dcb19e 100644
--- a/src/main/java/org/joda/time/convert/CalendarConverter.java
+++ b/src/main/java/org/joda/time/convert/CalendarConverter.java
@@ -64,6 +64,7 @@ final class CalendarConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public Chronology getChronology(Object object, Chronology chrono) {
if (chrono != null) {
return chrono;
@@ -90,6 +91,7 @@ final class CalendarConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
@@ -117,6 +119,7 @@ final class CalendarConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public long getInstantMillis(Object object, Chronology chrono) {
Calendar calendar = (Calendar) object;
return calendar.getTime().getTime();
diff --git a/src/main/java/org/joda/time/convert/ConverterManager.java b/src/main/java/org/joda/time/convert/ConverterManager.java
index 5b90532a..2195a372 100644
--- a/src/main/java/org/joda/time/convert/ConverterManager.java
+++ b/src/main/java/org/joda/time/convert/ConverterManager.java
@@ -189,6 +189,7 @@ public final class ConverterManager {
*
* @param converter the converter to add, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public InstantConverter addInstantConverter(InstantConverter converter)
throws SecurityException {
@@ -208,6 +209,7 @@ public final class ConverterManager {
*
* @param converter the converter to remove, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public InstantConverter removeInstantConverter(InstantConverter converter)
throws SecurityException {
@@ -276,6 +278,7 @@ public final class ConverterManager {
*
* @param converter the converter to add, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public PartialConverter addPartialConverter(PartialConverter converter)
throws SecurityException {
@@ -295,6 +298,7 @@ public final class ConverterManager {
*
* @param converter the converter to remove, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public PartialConverter removePartialConverter(PartialConverter converter)
throws SecurityException {
@@ -363,6 +367,7 @@ public final class ConverterManager {
*
* @param converter the converter to add, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public DurationConverter addDurationConverter(DurationConverter converter)
throws SecurityException {
@@ -382,6 +387,7 @@ public final class ConverterManager {
*
* @param converter the converter to remove, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public DurationConverter removeDurationConverter(DurationConverter converter)
throws SecurityException {
@@ -450,6 +456,7 @@ public final class ConverterManager {
*
* @param converter the converter to add, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public PeriodConverter addPeriodConverter(PeriodConverter converter)
throws SecurityException {
@@ -469,6 +476,7 @@ public final class ConverterManager {
*
* @param converter the converter to remove, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public PeriodConverter removePeriodConverter(PeriodConverter converter)
throws SecurityException {
@@ -537,6 +545,7 @@ public final class ConverterManager {
*
* @param converter the converter to add, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public IntervalConverter addIntervalConverter(IntervalConverter converter)
throws SecurityException {
@@ -556,6 +565,7 @@ public final class ConverterManager {
*
* @param converter the converter to remove, null ignored
* @return replaced converter, or null
+ * @throws SecurityException if the security manager rejects the change
*/
public IntervalConverter removeIntervalConverter(IntervalConverter converter)
throws SecurityException {
@@ -585,6 +595,7 @@ public final class ConverterManager {
/**
* Gets a debug representation of the object.
*/
+ @Override
public String toString() {
return "ConverterManager[" +
iInstantConverters.size() + " instant," +
diff --git a/src/main/java/org/joda/time/convert/DateConverter.java b/src/main/java/org/joda/time/convert/DateConverter.java
index 8caaa2ab..11441487 100644
--- a/src/main/java/org/joda/time/convert/DateConverter.java
+++ b/src/main/java/org/joda/time/convert/DateConverter.java
@@ -51,6 +51,7 @@ final class DateConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public long getInstantMillis(Object object, Chronology chrono) {
Date date = (Date) object;
return date.getTime();
diff --git a/src/main/java/org/joda/time/convert/LongConverter.java b/src/main/java/org/joda/time/convert/LongConverter.java
index 6d3f5612..2e8d8cd0 100644
--- a/src/main/java/org/joda/time/convert/LongConverter.java
+++ b/src/main/java/org/joda/time/convert/LongConverter.java
@@ -50,6 +50,7 @@ class LongConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public long getInstantMillis(Object object, Chronology chrono) {
return ((Long) object).longValue();
}
diff --git a/src/main/java/org/joda/time/convert/ReadableInstantConverter.java b/src/main/java/org/joda/time/convert/ReadableInstantConverter.java
index 7819e18e..b907ee7c 100644
--- a/src/main/java/org/joda/time/convert/ReadableInstantConverter.java
+++ b/src/main/java/org/joda/time/convert/ReadableInstantConverter.java
@@ -54,6 +54,7 @@ class ReadableInstantConverter extends AbstractConverter
* @param zone the specified zone to use, null means default zone
* @return the chronology, never null
*/
+ @Override
public Chronology getChronology(Object object, DateTimeZone zone) {
Chronology chrono = ((ReadableInstant) object).getChronology();
if (chrono == null) {
@@ -79,6 +80,7 @@ class ReadableInstantConverter extends AbstractConverter
* @param chrono the chronology to use, null means use that from object
* @return the chronology, never null
*/
+ @Override
public Chronology getChronology(Object object, Chronology chrono) {
if (chrono == null) {
chrono = ((ReadableInstant) object).getChronology();
@@ -96,6 +98,7 @@ class ReadableInstantConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public long getInstantMillis(Object object, Chronology chrono) {
return ((ReadableInstant) object).getMillis();
}
diff --git a/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java b/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java
index 0c9ccc37..97c2bf4d 100644
--- a/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java
+++ b/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java
@@ -82,6 +82,7 @@ class ReadableIntervalConverter extends AbstractConverter
* @return true if the input is a ReadableInterval
* @throws ClassCastException if the object is invalid
*/
+ @Override
public boolean isReadableInterval(Object object, Chronology chrono) {
return true;
}
diff --git a/src/main/java/org/joda/time/convert/ReadablePartialConverter.java b/src/main/java/org/joda/time/convert/ReadablePartialConverter.java
index 44aa4bf0..2eaa0df0 100644
--- a/src/main/java/org/joda/time/convert/ReadablePartialConverter.java
+++ b/src/main/java/org/joda/time/convert/ReadablePartialConverter.java
@@ -49,6 +49,7 @@ class ReadablePartialConverter extends AbstractConverter
* @param zone the specified zone to use, null means default zone
* @return the chronology, never null
*/
+ @Override
public Chronology getChronology(Object object, DateTimeZone zone) {
return getChronology(object, (Chronology) null).withZone(zone);
}
@@ -63,6 +64,7 @@ class ReadablePartialConverter extends AbstractConverter
* @param chrono the chronology to use, null means use that from object
* @return the chronology, never null
*/
+ @Override
public Chronology getChronology(Object object, Chronology chrono) {
if (chrono == null) {
chrono = ((ReadablePartial) object).getChronology();
@@ -83,6 +85,7 @@ class ReadablePartialConverter extends AbstractConverter
* @return the array of field values that match the fieldSource, must be non-null valid
* @throws ClassCastException if the object is invalid
*/
+ @Override
public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono) {
ReadablePartial input = (ReadablePartial) object;
int size = fieldSource.size();
diff --git a/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java b/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java
index 07886bc0..8dbf4c3b 100644
--- a/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java
+++ b/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java
@@ -66,6 +66,7 @@ class ReadablePeriodConverter extends AbstractConverter
* @throws NullPointerException if the object is null
* @throws ClassCastException if the object is an invalid type
*/
+ @Override
public PeriodType getPeriodType(Object object) {
ReadablePeriod period = (ReadablePeriod) object;
return period.getPeriodType();
diff --git a/src/main/java/org/joda/time/convert/StringConverter.java b/src/main/java/org/joda/time/convert/StringConverter.java
index a0d505d4..936d3cad 100644
--- a/src/main/java/org/joda/time/convert/StringConverter.java
+++ b/src/main/java/org/joda/time/convert/StringConverter.java
@@ -59,6 +59,7 @@ class StringConverter extends AbstractConverter
* @return the millisecond value
* @throws IllegalArgumentException if the value if invalid
*/
+ @Override
public long getInstantMillis(Object object, Chronology chrono) {
String str = (String) object;
DateTimeFormatter p = ISODateTimeFormat.dateTimeParser();
@@ -80,6 +81,7 @@ class StringConverter extends AbstractConverter
* @throws IllegalArgumentException if the value if invalid
* @since 1.3
*/
+ @Override
public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser) {
if (parser.getZone() != null) {
chrono = chrono.withZone(parser.getZone());
@@ -155,7 +157,6 @@ class StringConverter extends AbstractConverter
* @param period period to get modified
* @param object the String to convert, must not be null
* @param chrono the chronology to use
- * @return the millisecond duration
* @throws ClassCastException if the object is invalid
*/
public void setInto(ReadWritablePeriod period, Object object, Chronology chrono) {
diff --git a/src/main/java/org/joda/time/field/AbstractPartialFieldProperty.java b/src/main/java/org/joda/time/field/AbstractPartialFieldProperty.java
index 7fef6eff..fa72ef61 100644
--- a/src/main/java/org/joda/time/field/AbstractPartialFieldProperty.java
+++ b/src/main/java/org/joda/time/field/AbstractPartialFieldProperty.java
@@ -318,6 +318,7 @@ public abstract class AbstractPartialFieldProperty {
* @param object the object to compare to
* @return true if equal
*/
+ @Override
public boolean equals(Object object) {
if (this == object) {
return true;
@@ -339,6 +340,7 @@ public abstract class AbstractPartialFieldProperty {
* @return the hashcode
* @since 1.3
*/
+ @Override
public int hashCode() {
int hash = 19;
hash = 13 * hash + get();
@@ -353,6 +355,7 @@ public abstract class AbstractPartialFieldProperty {
*
* @return debugging string
*/
+ @Override
public String toString() {
return "Property[" + getName() + "]";
}
diff --git a/src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java b/src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java
index 01969e06..611e5f20 100644
--- a/src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java
+++ b/src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java
@@ -277,6 +277,8 @@ public abstract class AbstractReadableInstantFieldProperty implements Serializab
/**
* If this field were to leap, then it would be in units described by the
* returned duration. If this field doesn't ever leap, null is returned.
+ *
+ * @return the duration field
*/
public DurationField getLeapDurationField() {
return getField().getLeapDurationField();
@@ -438,6 +440,7 @@ public abstract class AbstractReadableInstantFieldProperty implements Serializab
* @param object the object to compare to
* @return true if equal
*/
+ @Override
public boolean equals(Object object) {
if (this == object) {
return true;
@@ -457,6 +460,7 @@ public abstract class AbstractReadableInstantFieldProperty implements Serializab
*
* @return the hashcode
*/
+ @Override
public int hashCode() {
return get() * 17 + getFieldType().hashCode() + getChronology().hashCode();
}
@@ -467,6 +471,7 @@ public abstract class AbstractReadableInstantFieldProperty implements Serializab
*
* @return debugging string
*/
+ @Override
public String toString() {
return "Property[" + getName() + "]";
}
diff --git a/src/main/java/org/joda/time/field/BaseDateTimeField.java b/src/main/java/org/joda/time/field/BaseDateTimeField.java
index da19ad14..eb351145 100644
--- a/src/main/java/org/joda/time/field/BaseDateTimeField.java
+++ b/src/main/java/org/joda/time/field/BaseDateTimeField.java
@@ -45,6 +45,8 @@ public abstract class BaseDateTimeField extends DateTimeField {
/**
* Constructor.
+ *
+ * @param type the field type
*/
protected BaseDateTimeField(DateTimeFieldType type) {
super();
@@ -54,10 +56,12 @@ public abstract class BaseDateTimeField extends DateTimeField {
iType = type;
}
+ @Override
public final DateTimeFieldType getType() {
return iType;
}
+ @Override
public final String getName() {
return iType.getName();
}
@@ -65,6 +69,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
/**
* @return true always
*/
+ @Override
public final boolean isSupported() {
return true;
}
@@ -77,6 +82,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the value of the field, in the units of the field
*/
+ @Override
public abstract int get(long instant);
//-----------------------------------------------------------------------
@@ -90,6 +96,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null means default
* @return the text value of the field
*/
+ @Override
public String getAsText(long instant, Locale locale) {
return getAsText(get(instant), locale);
}
@@ -102,6 +109,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the text value of the field
*/
+ @Override
public final String getAsText(long instant) {
return getAsText(instant, null);
}
@@ -117,6 +125,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
return getAsText(fieldValue, locale);
}
@@ -132,6 +141,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public final String getAsText(ReadablePartial partial, Locale locale) {
return getAsText(partial, partial.get(getType()), locale);
}
@@ -149,6 +159,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return Integer.toString(fieldValue);
}
@@ -164,6 +175,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null means default
* @return the text value of the field
*/
+ @Override
public String getAsShortText(long instant, Locale locale) {
return getAsShortText(get(instant), locale);
}
@@ -176,6 +188,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the text value of the field
*/
+ @Override
public final String getAsShortText(long instant) {
return getAsShortText(instant, null);
}
@@ -191,6 +204,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) {
return getAsShortText(fieldValue, locale);
}
@@ -206,6 +220,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public final String getAsShortText(ReadablePartial partial, Locale locale) {
return getAsShortText(partial, partial.get(getType()), locale);
}
@@ -223,6 +238,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol, null for default
* @return the text value of the field
*/
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return getAsText(fieldValue, locale);
}
@@ -249,6 +265,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param value the value to add, in the units of the field
* @return the updated milliseconds
*/
+ @Override
public long add(long instant, int value) {
return getDurationField().add(instant, value);
}
@@ -263,6 +280,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @throws IllegalArgumentException if value is too large
* @see #add(long,int)
*/
+ @Override
public long add(long instant, long value) {
return getDurationField().add(instant, value);
}
@@ -294,6 +312,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the passed in values
* @throws IllegalArgumentException if the value is invalid or the maximum instant is reached
*/
+ @Override
public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return values;
@@ -375,6 +394,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the passed in values
* @throws IllegalArgumentException if the value is invalid or the maximum instant is reached
*/
+ @Override
public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return values;
@@ -457,6 +477,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param value the value to add, in the units of the field
* @return the updated milliseconds
*/
+ @Override
public long addWrapField(long instant, int value) {
int current = get(instant);
int wrapped = FieldUtils.getWrappedValue
@@ -491,6 +512,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the passed in values
* @throws IllegalArgumentException if the value is invalid
*/
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
int current = values[fieldIndex];
int wrapped = FieldUtils.getWrappedValue
@@ -518,6 +540,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* subtract off the minuend
* @return the difference in the units of this field
*/
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifference(minuendInstant, subtrahendInstant);
}
@@ -541,6 +564,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* subtract off the minuend
* @return the difference in the units of this field
*/
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
@@ -561,6 +585,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the updated milliseconds
* @throws IllegalArgumentException if the value is invalid
*/
+ @Override
public abstract long set(long instant, int value);
/**
@@ -581,6 +606,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the updated values
* @throws IllegalArgumentException if the value is invalid
*/
+ @Override
public int[] set(ReadablePartial partial, int fieldIndex, int[] values, int newValue) {
FieldUtils.verifyValueBounds(this, newValue, getMinimumValue(partial, values), getMaximumValue(partial, values));
values[fieldIndex] = newValue;
@@ -614,6 +640,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the updated milliseconds
* @throws IllegalArgumentException if the text value is invalid
*/
+ @Override
public long set(long instant, String text, Locale locale) {
int value = convertText(text, locale);
return set(instant, value);
@@ -631,6 +658,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the updated milliseconds
* @throws IllegalArgumentException if the text value is invalid
*/
+ @Override
public final long set(long instant, String text) {
return set(instant, text, null);
}
@@ -650,6 +678,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the passed in values
* @throws IllegalArgumentException if the text value is invalid
*/
+ @Override
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
int value = convertText(text, locale);
return set(instant, fieldIndex, values, value);
@@ -680,6 +709,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the duration of this field, or UnsupportedDurationField if field
* has no duration
*/
+ @Override
public abstract DurationField getDurationField();
/**
@@ -688,6 +718,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
*
* @return the range duration of this field, or null if field has no range
*/
+ @Override
public abstract DurationField getRangeDurationField();
/**
@@ -700,6 +731,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
*
* @return true if the field is 'leap'
*/
+ @Override
public boolean isLeap(long instant) {
return false;
}
@@ -712,6 +744,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* <p>
* This implementation returns zero.
*/
+ @Override
public int getLeapAmount(long instant) {
return 0;
}
@@ -722,6 +755,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* <p>
* This implementation returns null.
*/
+ @Override
public DurationField getLeapDurationField() {
return null;
}
@@ -732,6 +766,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the minimum valid value for this field, in the units of the
* field
*/
+ @Override
public abstract int getMinimumValue();
/**
@@ -742,6 +777,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the minimum value for this field, in the units of the field
*/
+ @Override
public int getMinimumValue(long instant) {
return getMinimumValue();
}
@@ -754,6 +790,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the partial instant to query
* @return the minimum value for this field, in the units of the field
*/
+ @Override
public int getMinimumValue(ReadablePartial instant) {
return getMinimumValue();
}
@@ -768,6 +805,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param values the values to use
* @return the minimum value for this field, in the units of the field
*/
+ @Override
public int getMinimumValue(ReadablePartial instant, int[] values) {
return getMinimumValue(instant);
}
@@ -778,6 +816,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @return the maximum valid value for this field, in the units of the
* field
*/
+ @Override
public abstract int getMaximumValue();
/**
@@ -788,6 +827,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the maximum value for this field, in the units of the field
*/
+ @Override
public int getMaximumValue(long instant) {
return getMaximumValue();
}
@@ -800,6 +840,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the partial instant to query
* @return the maximum value for this field, in the units of the field
*/
+ @Override
public int getMaximumValue(ReadablePartial instant) {
return getMaximumValue();
}
@@ -814,6 +855,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param values the values to use
* @return the maximum value for this field, in the units of the field
*/
+ @Override
public int getMaximumValue(ReadablePartial instant, int[] values) {
return getMaximumValue(instant);
}
@@ -825,6 +867,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol
* @return the maximum text length
*/
+ @Override
public int getMaximumTextLength(Locale locale) {
int max = getMaximumValue();
if (max >= 0) {
@@ -846,6 +889,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param locale the locale to use for selecting a text symbol
* @return the maximum short text length
*/
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return getMaximumTextLength(locale);
}
@@ -864,6 +908,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to round
* @return rounded milliseconds
*/
+ @Override
public abstract long roundFloor(long instant);
/**
@@ -882,6 +927,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to round
* @return rounded milliseconds
*/
+ @Override
public long roundCeiling(long instant) {
long newInstant = roundFloor(instant);
if (newInstant != instant) {
@@ -899,6 +945,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to round
* @return rounded milliseconds
*/
+ @Override
public long roundHalfFloor(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
@@ -923,6 +970,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to round
* @return rounded milliseconds
*/
+ @Override
public long roundHalfCeiling(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
@@ -951,6 +999,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to round
* @return rounded milliseconds
*/
+ @Override
public long roundHalfEven(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
@@ -990,6 +1039,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
* remainder
* @return remainder duration, in milliseconds
*/
+ @Override
public long remainder(long instant) {
return instant - roundFloor(instant);
}
@@ -999,6 +1049,7 @@ public abstract class BaseDateTimeField extends DateTimeField {
*
* @return debug string
*/
+ @Override
public String toString() {
return "DateTimeField[" + getName() + ']';
}
diff --git a/src/main/java/org/joda/time/field/BaseDurationField.java b/src/main/java/org/joda/time/field/BaseDurationField.java
index 98d6c424..b43a0624 100644
--- a/src/main/java/org/joda/time/field/BaseDurationField.java
+++ b/src/main/java/org/joda/time/field/BaseDurationField.java
@@ -51,10 +51,12 @@ public abstract class BaseDurationField extends DurationField implements Seriali
iType = type;
}
+ @Override
public final DurationFieldType getType() {
return iType;
}
+ @Override
public final String getName() {
return iType.getName();
}
@@ -62,6 +64,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
/**
* @return true always
*/
+ @Override
public final boolean isSupported() {
return true;
}
@@ -75,6 +78,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
* @return the value of the field, in the units of the field, which may be
* negative
*/
+ @Override
public int getValue(long duration) {
return FieldUtils.safeToInt(getValueAsLong(duration));
}
@@ -87,6 +91,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
* @return the value of the field, in the units of the field, which may be
* negative
*/
+ @Override
public long getValueAsLong(long duration) {
return duration / getUnitMillis();
}
@@ -107,6 +112,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
* @return the value of the field, in the units of the field, which may be
* negative
*/
+ @Override
public int getValue(long duration, long instant) {
return FieldUtils.safeToInt(getValueAsLong(duration, instant));
}
@@ -119,6 +125,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
* @return the milliseconds that the field represents, which may be
* negative
*/
+ @Override
public long getMillis(int value) {
return value * getUnitMillis(); // safe
}
@@ -131,12 +138,14 @@ public abstract class BaseDurationField extends DurationField implements Seriali
* @return the milliseconds that the field represents, which may be
* negative
*/
+ @Override
public long getMillis(long value) {
return FieldUtils.safeMultiply(value, getUnitMillis());
}
// Calculation API
//------------------------------------------------------------------------
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return FieldUtils.safeToInt(getDifferenceAsLong(minuendInstant, subtrahendInstant));
}
@@ -161,6 +170,7 @@ public abstract class BaseDurationField extends DurationField implements Seriali
*
* @return debug string
*/
+ @Override
public String toString() {
return "DurationField[" + getName() + ']';
}
diff --git a/src/main/java/org/joda/time/field/DecoratedDateTimeField.java b/src/main/java/org/joda/time/field/DecoratedDateTimeField.java
index dc16782f..a7291408 100644
--- a/src/main/java/org/joda/time/field/DecoratedDateTimeField.java
+++ b/src/main/java/org/joda/time/field/DecoratedDateTimeField.java
@@ -71,34 +71,42 @@ public abstract class DecoratedDateTimeField extends BaseDateTimeField {
return iField;
}
+ @Override
public boolean isLenient() {
return iField.isLenient();
}
+ @Override
public int get(long instant) {
return iField.get(instant);
}
+ @Override
public long set(long instant, int value) {
return iField.set(instant, value);
}
+ @Override
public DurationField getDurationField() {
return iField.getDurationField();
}
+ @Override
public DurationField getRangeDurationField() {
return iField.getRangeDurationField();
}
+ @Override
public int getMinimumValue() {
return iField.getMinimumValue();
}
+ @Override
public int getMaximumValue() {
return iField.getMaximumValue();
}
+ @Override
public long roundFloor(long instant) {
return iField.roundFloor(instant);
}
diff --git a/src/main/java/org/joda/time/field/DecoratedDurationField.java b/src/main/java/org/joda/time/field/DecoratedDurationField.java
index 1b7eb426..8f549f56 100644
--- a/src/main/java/org/joda/time/field/DecoratedDurationField.java
+++ b/src/main/java/org/joda/time/field/DecoratedDurationField.java
@@ -69,34 +69,42 @@ public class DecoratedDurationField extends BaseDurationField {
return iField;
}
+ @Override
public boolean isPrecise() {
return iField.isPrecise();
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return iField.getValueAsLong(duration, instant);
}
+ @Override
public long getMillis(int value, long instant) {
return iField.getMillis(value, instant);
}
+ @Override
public long getMillis(long value, long instant) {
return iField.getMillis(value, instant);
}
+ @Override
public long add(long instant, int value) {
return iField.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return iField.add(instant, value);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long getUnitMillis() {
return iField.getUnitMillis();
}
diff --git a/src/main/java/org/joda/time/field/DelegatedDateTimeField.java b/src/main/java/org/joda/time/field/DelegatedDateTimeField.java
index a5b70607..d07278fd 100644
--- a/src/main/java/org/joda/time/field/DelegatedDateTimeField.java
+++ b/src/main/java/org/joda/time/field/DelegatedDateTimeField.java
@@ -90,122 +90,152 @@ public class DelegatedDateTimeField extends DateTimeField implements Serializabl
return iField;
}
+ @Override
public DateTimeFieldType getType() {
return iType;
}
+ @Override
public String getName() {
return iType.getName();
}
+ @Override
public boolean isSupported() {
return iField.isSupported();
}
+ @Override
public boolean isLenient() {
return iField.isLenient();
}
+ @Override
public int get(long instant) {
return iField.get(instant);
}
+ @Override
public String getAsText(long instant, Locale locale) {
return iField.getAsText(instant, locale);
}
+ @Override
public String getAsText(long instant) {
return iField.getAsText(instant);
}
+ @Override
public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
return iField.getAsText(partial, fieldValue, locale);
}
+ @Override
public String getAsText(ReadablePartial partial, Locale locale) {
return iField.getAsText(partial, locale);
}
+ @Override
public String getAsText(int fieldValue, Locale locale) {
return iField.getAsText(fieldValue, locale);
}
+ @Override
public String getAsShortText(long instant, Locale locale) {
return iField.getAsShortText(instant, locale);
}
+ @Override
public String getAsShortText(long instant) {
return iField.getAsShortText(instant);
}
+ @Override
public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) {
return iField.getAsShortText(partial, fieldValue, locale);
}
+ @Override
public String getAsShortText(ReadablePartial partial, Locale locale) {
return iField.getAsShortText(partial, locale);
}
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
return iField.getAsShortText(fieldValue, locale);
}
+ @Override
public long add(long instant, int value) {
return iField.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return iField.add(instant, value);
}
+ @Override
public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
return iField.add(instant, fieldIndex, values, valueToAdd);
}
+ @Override
public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
return iField.addWrapPartial(instant, fieldIndex, values, valueToAdd);
}
+ @Override
public long addWrapField(long instant, int value) {
return iField.addWrapField(instant, value);
}
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
return iField.addWrapField(instant, fieldIndex, values, valueToAdd);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return iField.getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long set(long instant, int value) {
return iField.set(instant, value);
}
+ @Override
public long set(long instant, String text, Locale locale) {
return iField.set(instant, text, locale);
}
+ @Override
public long set(long instant, String text) {
return iField.set(instant, text);
}
+ @Override
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, int newValue) {
return iField.set(instant, fieldIndex, values, newValue);
}
+ @Override
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
return iField.set(instant, fieldIndex, values, text, locale);
}
+ @Override
public DurationField getDurationField() {
return iField.getDurationField();
}
+ @Override
public DurationField getRangeDurationField() {
if (iRangeDurationField != null) {
return iRangeDurationField;
@@ -213,82 +243,102 @@ public class DelegatedDateTimeField extends DateTimeField implements Serializabl
return iField.getRangeDurationField();
}
+ @Override
public boolean isLeap(long instant) {
return iField.isLeap(instant);
}
+ @Override
public int getLeapAmount(long instant) {
return iField.getLeapAmount(instant);
}
+ @Override
public DurationField getLeapDurationField() {
return iField.getLeapDurationField();
}
+ @Override
public int getMinimumValue() {
return iField.getMinimumValue();
}
+ @Override
public int getMinimumValue(long instant) {
return iField.getMinimumValue(instant);
}
+ @Override
public int getMinimumValue(ReadablePartial instant) {
return iField.getMinimumValue(instant);
}
+ @Override
public int getMinimumValue(ReadablePartial instant, int[] values) {
return iField.getMinimumValue(instant, values);
}
+ @Override
public int getMaximumValue() {
return iField.getMaximumValue();
}
+ @Override
public int getMaximumValue(long instant) {
return iField.getMaximumValue(instant);
}
+ @Override
public int getMaximumValue(ReadablePartial instant) {
return iField.getMaximumValue(instant);
}
+ @Override
public int getMaximumValue(ReadablePartial instant, int[] values) {
return iField.getMaximumValue(instant, values);
}
+ @Override
public int getMaximumTextLength(Locale locale) {
return iField.getMaximumTextLength(locale);
}
+ @Override
public int getMaximumShortTextLength(Locale locale) {
return iField.getMaximumShortTextLength(locale);
}
+ @Override
public long roundFloor(long instant) {
return iField.roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return iField.roundCeiling(instant);
}
+ @Override
public long roundHalfFloor(long instant) {
return iField.roundHalfFloor(instant);
}
+ @Override
public long roundHalfCeiling(long instant) {
return iField.roundHalfCeiling(instant);
}
+ @Override
public long roundHalfEven(long instant) {
return iField.roundHalfEven(instant);
}
+ @Override
public long remainder(long instant) {
return iField.remainder(instant);
}
+ @Override
public String toString() {
return ("DateTimeField[" + getName() + ']');
}
diff --git a/src/main/java/org/joda/time/field/DelegatedDurationField.java b/src/main/java/org/joda/time/field/DelegatedDurationField.java
index d0b8c544..49d0b791 100644
--- a/src/main/java/org/joda/time/field/DelegatedDurationField.java
+++ b/src/main/java/org/joda/time/field/DelegatedDurationField.java
@@ -75,10 +75,12 @@ public class DelegatedDurationField extends DurationField implements Serializabl
return iField;
}
+ @Override
public DurationFieldType getType() {
return iType;
}
+ @Override
public String getName() {
return iType.getName();
}
@@ -86,62 +88,77 @@ public class DelegatedDurationField extends DurationField implements Serializabl
/**
* Returns true if this field is supported.
*/
+ @Override
public boolean isSupported() {
return iField.isSupported();
}
+ @Override
public boolean isPrecise() {
return iField.isPrecise();
}
+ @Override
public int getValue(long duration) {
return iField.getValue(duration);
}
+ @Override
public long getValueAsLong(long duration) {
return iField.getValueAsLong(duration);
}
+ @Override
public int getValue(long duration, long instant) {
return iField.getValue(duration, instant);
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return iField.getValueAsLong(duration, instant);
}
+ @Override
public long getMillis(int value) {
return iField.getMillis(value);
}
+ @Override
public long getMillis(long value) {
return iField.getMillis(value);
}
+ @Override
public long getMillis(int value, long instant) {
return iField.getMillis(value, instant);
}
+ @Override
public long getMillis(long value, long instant) {
return iField.getMillis(value, instant);
}
+ @Override
public long add(long instant, int value) {
return iField.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return iField.add(instant, value);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return iField.getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long getUnitMillis() {
return iField.getUnitMillis();
}
@@ -150,6 +167,7 @@ public class DelegatedDurationField extends DurationField implements Serializabl
return iField.compareTo(durationField);
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof DelegatedDurationField) {
return iField.equals(((DelegatedDurationField) obj).iField);
@@ -157,10 +175,12 @@ public class DelegatedDurationField extends DurationField implements Serializabl
return false;
}
+ @Override
public int hashCode() {
return iField.hashCode() ^ iType.hashCode();
}
+ @Override
public String toString() {
return (iType == null) ? iField.toString() :
("DurationField[" + iType + ']');
diff --git a/src/main/java/org/joda/time/field/DividedDateTimeField.java b/src/main/java/org/joda/time/field/DividedDateTimeField.java
index 9a30dc90..19fe13af 100644
--- a/src/main/java/org/joda/time/field/DividedDateTimeField.java
+++ b/src/main/java/org/joda/time/field/DividedDateTimeField.java
@@ -137,6 +137,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
* @param instant the time instant in millis to query.
* @return the amount of scaled units extracted from the input.
*/
+ @Override
public int get(long instant) {
int value = getWrappedField().get(instant);
if (value >= 0) {
@@ -154,6 +155,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of scaled units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, int amount) {
return getWrappedField().add(instant, amount * iDivisor);
}
@@ -166,6 +168,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of scaled units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, long amount) {
return getWrappedField().add(instant, amount * iDivisor);
}
@@ -178,14 +181,17 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of scaled units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifference(minuendInstant, subtrahendInstant) / iDivisor;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant) / iDivisor;
}
@@ -198,6 +204,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if value is too large or too small.
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
int remainder = getRemainder(getWrappedField().get(instant));
@@ -207,6 +214,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
/**
* Returns a scaled version of the wrapped field's unit duration field.
*/
+ @Override
public DurationField getDurationField() {
return iDurationField;
}
@@ -216,6 +224,7 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value
*/
+ @Override
public int getMinimumValue() {
return iMin;
}
@@ -225,15 +234,18 @@ public class DividedDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue() {
return iMax;
}
+ @Override
public long roundFloor(long instant) {
DateTimeField field = getWrappedField();
return field.roundFloor(field.set(instant, get(instant) * iDivisor));
}
+ @Override
public long remainder(long instant) {
return set(instant, get(getWrappedField().remainder(instant)));
}
diff --git a/src/main/java/org/joda/time/field/FieldUtils.java b/src/main/java/org/joda/time/field/FieldUtils.java
index aea3288f..994170b8 100644
--- a/src/main/java/org/joda/time/field/FieldUtils.java
+++ b/src/main/java/org/joda/time/field/FieldUtils.java
@@ -246,6 +246,7 @@ public class FieldUtils {
/**
* Verify that input values are within specified bounds.
*
+ * @param field the field to check
* @param value the value to check
* @param lowerBound the lower bound allowed for value
* @param upperBound the upper bound allowed for value
@@ -263,6 +264,7 @@ public class FieldUtils {
/**
* Verify that input values are within specified bounds.
*
+ * @param fieldType the field type to check
* @param value the value to check
* @param lowerBound the lower bound allowed for value
* @param upperBound the upper bound allowed for value
@@ -281,6 +283,7 @@ public class FieldUtils {
/**
* Verify that input values are within specified bounds.
*
+ * @param fieldName the field name to check
* @param value the value to check
* @param lowerBound the lower bound allowed for value
* @param upperBound the upper bound allowed for value
diff --git a/src/main/java/org/joda/time/field/ImpreciseDateTimeField.java b/src/main/java/org/joda/time/field/ImpreciseDateTimeField.java
index b75395de..d8be1a84 100644
--- a/src/main/java/org/joda/time/field/ImpreciseDateTimeField.java
+++ b/src/main/java/org/joda/time/field/ImpreciseDateTimeField.java
@@ -58,12 +58,16 @@ public abstract class ImpreciseDateTimeField extends BaseDateTimeField {
iDurationField = new LinkedDurationField(type.getDurationType());
}
+ @Override
public abstract int get(long instant);
+ @Override
public abstract long set(long instant, int value);
+ @Override
public abstract long add(long instant, int value);
+ @Override
public abstract long add(long instant, long value);
/**
@@ -88,6 +92,7 @@ public abstract class ImpreciseDateTimeField extends BaseDateTimeField {
* subtract off the minuend
* @return the difference in the units of this field
*/
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return FieldUtils.safeToInt(getDifferenceAsLong(minuendInstant, subtrahendInstant));
}
@@ -115,6 +120,7 @@ public abstract class ImpreciseDateTimeField extends BaseDateTimeField {
* subtract off the minuend
* @return the difference in the units of this field
*/
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant < subtrahendInstant) {
return -getDifferenceAsLong(subtrahendInstant, minuendInstant);
@@ -134,12 +140,15 @@ public abstract class ImpreciseDateTimeField extends BaseDateTimeField {
return difference;
}
+ @Override
public final DurationField getDurationField() {
return iDurationField;
}
+ @Override
public abstract DurationField getRangeDurationField();
+ @Override
public abstract long roundFloor(long instant);
protected final long getDurationUnitMillis() {
@@ -153,45 +162,55 @@ public abstract class ImpreciseDateTimeField extends BaseDateTimeField {
super(type);
}
+ @Override
public boolean isPrecise() {
return false;
}
+ @Override
public long getUnitMillis() {
return iUnitMillis;
}
+ @Override
public int getValue(long duration, long instant) {
return ImpreciseDateTimeField.this
.getDifference(instant + duration, instant);
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return ImpreciseDateTimeField.this
.getDifferenceAsLong(instant + duration, instant);
}
+ @Override
public long getMillis(int value, long instant) {
return ImpreciseDateTimeField.this.add(instant, value) - instant;
}
+ @Override
public long getMillis(long value, long instant) {
return ImpreciseDateTimeField.this.add(instant, value) - instant;
}
+ @Override
public long add(long instant, int value) {
return ImpreciseDateTimeField.this.add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return ImpreciseDateTimeField.this.add(instant, value);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return ImpreciseDateTimeField.this
.getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return ImpreciseDateTimeField.this
.getDifferenceAsLong(minuendInstant, subtrahendInstant);
diff --git a/src/main/java/org/joda/time/field/LenientDateTimeField.java b/src/main/java/org/joda/time/field/LenientDateTimeField.java
index 6cf4c718..659d7937 100644
--- a/src/main/java/org/joda/time/field/LenientDateTimeField.java
+++ b/src/main/java/org/joda/time/field/LenientDateTimeField.java
@@ -37,8 +37,11 @@ public class LenientDateTimeField extends DelegatedDateTimeField {
/**
* Returns a lenient version of the given field. If it is already lenient,
- * then it is returned as-is. Otherwise, a new LenientDateTimeField is
- * returned.
+ * then it is returned as-is. Otherwise, a new LenientDateTimeField is returned.
+ *
+ * @param field the field, null returns null
+ * @param base the chronology, not null
+ * @return the field. may be null
*/
public static DateTimeField getInstance(DateTimeField field, Chronology base) {
if (field == null) {
@@ -58,6 +61,7 @@ public class LenientDateTimeField extends DelegatedDateTimeField {
iBase = base;
}
+ @Override
public final boolean isLenient() {
return true;
}
@@ -66,6 +70,7 @@ public class LenientDateTimeField extends DelegatedDateTimeField {
* Set values which may be out of bounds by adding the difference between
* the new value and the current value.
*/
+ @Override
public long set(long instant, int value) {
// lenient needs to handle time zone chronologies
// so we do the calculation using local milliseconds
diff --git a/src/main/java/org/joda/time/field/MillisDurationField.java b/src/main/java/org/joda/time/field/MillisDurationField.java
index f77fb4b9..72860bf3 100644
--- a/src/main/java/org/joda/time/field/MillisDurationField.java
+++ b/src/main/java/org/joda/time/field/MillisDurationField.java
@@ -45,10 +45,12 @@ public final class MillisDurationField extends DurationField implements Serializ
}
//------------------------------------------------------------------------
+ @Override
public DurationFieldType getType() {
return DurationFieldType.millis();
}
+ @Override
public String getName() {
return "millis";
}
@@ -58,6 +60,7 @@ public final class MillisDurationField extends DurationField implements Serializ
*
* @return true always
*/
+ @Override
public boolean isSupported() {
return true;
}
@@ -67,6 +70,7 @@ public final class MillisDurationField extends DurationField implements Serializ
*
* @return true always
*/
+ @Override
public final boolean isPrecise() {
return true;
}
@@ -76,55 +80,68 @@ public final class MillisDurationField extends DurationField implements Serializ
*
* @return one always
*/
+ @Override
public final long getUnitMillis() {
return 1;
}
//------------------------------------------------------------------------
+ @Override
public int getValue(long duration) {
return FieldUtils.safeToInt(duration);
}
+ @Override
public long getValueAsLong(long duration) {
return duration;
}
+ @Override
public int getValue(long duration, long instant) {
return FieldUtils.safeToInt(duration);
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return duration;
}
+ @Override
public long getMillis(int value) {
return value;
}
+ @Override
public long getMillis(long value) {
return value;
}
+ @Override
public long getMillis(int value, long instant) {
return value;
}
+ @Override
public long getMillis(long value, long instant) {
return value;
}
+ @Override
public long add(long instant, int value) {
return FieldUtils.safeAdd(instant, value);
}
+ @Override
public long add(long instant, long value) {
return FieldUtils.safeAdd(instant, value);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return FieldUtils.safeToInt(FieldUtils.safeSubtract(minuendInstant, subtrahendInstant));
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return FieldUtils.safeSubtract(minuendInstant, subtrahendInstant);
}
@@ -144,6 +161,7 @@ public final class MillisDurationField extends DurationField implements Serializ
}
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof MillisDurationField) {
return getUnitMillis() == ((MillisDurationField) obj).getUnitMillis();
@@ -151,6 +169,7 @@ public final class MillisDurationField extends DurationField implements Serializ
return false;
}
+ @Override
public int hashCode() {
return (int) getUnitMillis();
}
@@ -160,6 +179,7 @@ public final class MillisDurationField extends DurationField implements Serializ
*
* @return debug string
*/
+ @Override
public String toString() {
return "DurationField[millis]";
}
diff --git a/src/main/java/org/joda/time/field/OffsetDateTimeField.java b/src/main/java/org/joda/time/field/OffsetDateTimeField.java
index b317eb29..9711645c 100644
--- a/src/main/java/org/joda/time/field/OffsetDateTimeField.java
+++ b/src/main/java/org/joda/time/field/OffsetDateTimeField.java
@@ -97,6 +97,7 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
* @param instant the time instant in millis to query.
* @return the amount of units extracted from the input.
*/
+ @Override
public int get(long instant) {
return super.get(instant) + iOffset;
}
@@ -109,6 +110,7 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, int amount) {
instant = super.add(instant, amount);
FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax);
@@ -123,6 +125,7 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long add(long instant, long amount) {
instant = super.add(instant, amount);
FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax);
@@ -137,6 +140,7 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
* @param amount the amount of units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
}
@@ -149,19 +153,23 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if value is too large or too small.
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
return super.set(instant, value - iOffset);
}
+ @Override
public boolean isLeap(long instant) {
return getWrappedField().isLeap(instant);
}
+ @Override
public int getLeapAmount(long instant) {
return getWrappedField().getLeapAmount(instant);
}
+ @Override
public DurationField getLeapDurationField() {
return getWrappedField().getLeapDurationField();
}
@@ -171,6 +179,7 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value
*/
+ @Override
public int getMinimumValue() {
return iMin;
}
@@ -180,30 +189,37 @@ public class OffsetDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue() {
return iMax;
}
+ @Override
public long roundFloor(long instant) {
return getWrappedField().roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return getWrappedField().roundCeiling(instant);
}
+ @Override
public long roundHalfFloor(long instant) {
return getWrappedField().roundHalfFloor(instant);
}
+ @Override
public long roundHalfCeiling(long instant) {
return getWrappedField().roundHalfCeiling(instant);
}
+ @Override
public long roundHalfEven(long instant) {
return getWrappedField().roundHalfEven(instant);
}
+ @Override
public long remainder(long instant) {
return getWrappedField().remainder(instant);
}
diff --git a/src/main/java/org/joda/time/field/PreciseDateTimeField.java b/src/main/java/org/joda/time/field/PreciseDateTimeField.java
index 3db90c3f..7f2a14d2 100644
--- a/src/main/java/org/joda/time/field/PreciseDateTimeField.java
+++ b/src/main/java/org/joda/time/field/PreciseDateTimeField.java
@@ -76,6 +76,7 @@ public class PreciseDateTimeField extends PreciseDurationDateTimeField {
* @param instant the milliseconds from 1970-01-01T00:00:00Z to query
* @return the amount of fractional units extracted from the input.
*/
+ @Override
public int get(long instant) {
if (instant >= 0) {
return (int) ((instant / getUnitMillis()) % iRange);
@@ -92,6 +93,7 @@ public class PreciseDateTimeField extends PreciseDurationDateTimeField {
* @param amount the amount of units to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int amount) {
int thisValue = get(instant);
int wrappedValue = FieldUtils.getWrappedValue
@@ -108,6 +110,7 @@ public class PreciseDateTimeField extends PreciseDurationDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if value is too large or too small.
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, getMinimumValue(), getMaximumValue());
return instant + (value - get(instant)) * iUnitMillis;
@@ -119,6 +122,7 @@ public class PreciseDateTimeField extends PreciseDurationDateTimeField {
*
* @return the range duration of this field, or null if field has no range
*/
+ @Override
public DurationField getRangeDurationField() {
return iRangeField;
}
@@ -128,6 +132,7 @@ public class PreciseDateTimeField extends PreciseDurationDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue() {
return iRange - 1;
}
diff --git a/src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java b/src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java
index ee638596..31b4d351 100644
--- a/src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java
+++ b/src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java
@@ -63,6 +63,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
/**
* Returns false by default.
*/
+ @Override
public boolean isLenient() {
return false;
}
@@ -75,6 +76,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if value is too large or too small.
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, getMinimumValue(),
getMaximumValueForSet(instant, value));
@@ -89,6 +91,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
* return super.roundFloor(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
* </pre>
*/
+ @Override
public long roundFloor(long instant) {
if (instant >= 0) {
return instant - instant % iUnitMillis;
@@ -106,6 +109,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
* return super.roundCeiling(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
* </pre>
*/
+ @Override
public long roundCeiling(long instant) {
if (instant > 0) {
instant -= 1;
@@ -123,6 +127,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
* return super.remainder(instant + ALIGNMENT_MILLIS);
* </pre>
*/
+ @Override
public long remainder(long instant) {
if (instant >= 0) {
return instant % iUnitMillis;
@@ -138,6 +143,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
* @return the duration of this field, or UnsupportedDurationField if field
* has no duration
*/
+ @Override
public DurationField getDurationField() {
return iUnitField;
}
@@ -147,6 +153,7 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
*
* @return the minimum value
*/
+ @Override
public int getMinimumValue() {
return 0;
}
@@ -157,8 +164,11 @@ public abstract class PreciseDurationDateTimeField extends BaseDateTimeField {
/**
* Called by the set method to get the maximum allowed value. By default,
- * returns getMaximumValue(instant). Override to provide a faster
- * implementation.
+ * returns getMaximumValue(instant). Override to provide a faster implementation.
+ *
+ * @param instant the instant to query at
+ * @param value the value
+ * @return the maximum value
*/
protected int getMaximumValueForSet(long instant, int value) {
return getMaximumValue(instant);
diff --git a/src/main/java/org/joda/time/field/PreciseDurationField.java b/src/main/java/org/joda/time/field/PreciseDurationField.java
index dcd91fec..969ff325 100644
--- a/src/main/java/org/joda/time/field/PreciseDurationField.java
+++ b/src/main/java/org/joda/time/field/PreciseDurationField.java
@@ -50,6 +50,7 @@ public class PreciseDurationField extends BaseDurationField {
*
* @return true always
*/
+ @Override
public final boolean isPrecise() {
return true;
}
@@ -59,6 +60,7 @@ public class PreciseDurationField extends BaseDurationField {
*
* @return the unit size of this field, in milliseconds
*/
+ @Override
public final long getUnitMillis() {
return iUnitMillis;
}
@@ -72,6 +74,7 @@ public class PreciseDurationField extends BaseDurationField {
* @return the value of the field, in the units of the field, which may be
* negative
*/
+ @Override
public long getValueAsLong(long duration, long instant) {
return duration / iUnitMillis; // safe
}
@@ -84,6 +87,7 @@ public class PreciseDurationField extends BaseDurationField {
* @return the milliseconds that the field represents, which may be
* negative
*/
+ @Override
public long getMillis(int value, long instant) {
return value * iUnitMillis; // safe
}
@@ -96,20 +100,24 @@ public class PreciseDurationField extends BaseDurationField {
* @return the milliseconds that the field represents, which may be
* negative
*/
+ @Override
public long getMillis(long value, long instant) {
return FieldUtils.safeMultiply(value, iUnitMillis);
}
+ @Override
public long add(long instant, int value) {
long addition = value * iUnitMillis; // safe
return FieldUtils.safeAdd(instant, addition);
}
+ @Override
public long add(long instant, long value) {
long addition = FieldUtils.safeMultiply(value, iUnitMillis);
return FieldUtils.safeAdd(instant, addition);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
long difference = FieldUtils.safeSubtract(minuendInstant, subtrahendInstant);
return difference / iUnitMillis;
@@ -123,6 +131,7 @@ public class PreciseDurationField extends BaseDurationField {
* @param obj the object to compare to
* @return if equal
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -138,6 +147,7 @@ public class PreciseDurationField extends BaseDurationField {
*
* @return a suitable hashcode
*/
+ @Override
public int hashCode() {
long millis = iUnitMillis;
int hash = (int) (millis ^ (millis >>> 32));
diff --git a/src/main/java/org/joda/time/field/RemainderDateTimeField.java b/src/main/java/org/joda/time/field/RemainderDateTimeField.java
index 30a835af..d77bb61b 100644
--- a/src/main/java/org/joda/time/field/RemainderDateTimeField.java
+++ b/src/main/java/org/joda/time/field/RemainderDateTimeField.java
@@ -132,6 +132,7 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
* @param instant the time instant in millis to query.
* @return the remainder extracted from the input.
*/
+ @Override
public int get(long instant) {
int value = getWrappedField().get(instant);
if (value >= 0) {
@@ -150,6 +151,7 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
* @param amount the amount to add (can be negative).
* @return the updated time instant.
*/
+ @Override
public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, 0, iDivisor - 1));
}
@@ -162,6 +164,7 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
* @return the updated time instant.
* @throws IllegalArgumentException if value is too large or too small.
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, 0, iDivisor - 1);
int divided = getDivided(getWrappedField().get(instant));
@@ -176,6 +179,7 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
/**
* Returns a scaled version of the wrapped field's unit duration field.
*/
+ @Override
public DurationField getRangeDurationField() {
return iRangeField;
}
@@ -185,6 +189,7 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value of zero.
*/
+ @Override
public int getMinimumValue() {
return 0;
}
@@ -195,30 +200,37 @@ public class RemainderDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue() {
return iDivisor - 1;
}
+ @Override
public long roundFloor(long instant) {
return getWrappedField().roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return getWrappedField().roundCeiling(instant);
}
+ @Override
public long roundHalfFloor(long instant) {
return getWrappedField().roundHalfFloor(instant);
}
+ @Override
public long roundHalfCeiling(long instant) {
return getWrappedField().roundHalfCeiling(instant);
}
+ @Override
public long roundHalfEven(long instant) {
return getWrappedField().roundHalfEven(instant);
}
+ @Override
public long remainder(long instant) {
return getWrappedField().remainder(instant);
}
diff --git a/src/main/java/org/joda/time/field/ScaledDurationField.java b/src/main/java/org/joda/time/field/ScaledDurationField.java
index b82fd6d2..1fb09a2d 100644
--- a/src/main/java/org/joda/time/field/ScaledDurationField.java
+++ b/src/main/java/org/joda/time/field/ScaledDurationField.java
@@ -51,60 +51,73 @@ public class ScaledDurationField extends DecoratedDurationField {
iScalar = scalar;
}
+ @Override
public int getValue(long duration) {
return getWrappedField().getValue(duration) / iScalar;
}
+ @Override
public long getValueAsLong(long duration) {
return getWrappedField().getValueAsLong(duration) / iScalar;
}
+ @Override
public int getValue(long duration, long instant) {
return getWrappedField().getValue(duration, instant) / iScalar;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return getWrappedField().getValueAsLong(duration, instant) / iScalar;
}
+ @Override
public long getMillis(int value) {
long scaled = ((long) value) * ((long) iScalar);
return getWrappedField().getMillis(scaled);
}
+ @Override
public long getMillis(long value) {
long scaled = FieldUtils.safeMultiply(value, iScalar);
return getWrappedField().getMillis(scaled);
}
+ @Override
public long getMillis(int value, long instant) {
long scaled = ((long) value) * ((long) iScalar);
return getWrappedField().getMillis(scaled, instant);
}
+ @Override
public long getMillis(long value, long instant) {
long scaled = FieldUtils.safeMultiply(value, iScalar);
return getWrappedField().getMillis(scaled, instant);
}
+ @Override
public long add(long instant, int value) {
long scaled = ((long) value) * ((long) iScalar);
return getWrappedField().add(instant, scaled);
}
+ @Override
public long add(long instant, long value) {
long scaled = FieldUtils.safeMultiply(value, iScalar);
return getWrappedField().add(instant, scaled);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifference(minuendInstant, subtrahendInstant) / iScalar;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant) / iScalar;
}
+ @Override
public long getUnitMillis() {
return getWrappedField().getUnitMillis() * iScalar;
}
@@ -126,6 +139,7 @@ public class ScaledDurationField extends DecoratedDurationField {
* @param obj the object to compare to
* @return if equal
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -143,6 +157,7 @@ public class ScaledDurationField extends DecoratedDurationField {
*
* @return a suitable hashcode
*/
+ @Override
public int hashCode() {
long scalar = iScalar;
int hash = (int) (scalar ^ (scalar >>> 32));
diff --git a/src/main/java/org/joda/time/field/SkipDateTimeField.java b/src/main/java/org/joda/time/field/SkipDateTimeField.java
index 1a2bd22d..58684053 100644
--- a/src/main/java/org/joda/time/field/SkipDateTimeField.java
+++ b/src/main/java/org/joda/time/field/SkipDateTimeField.java
@@ -76,6 +76,7 @@ public final class SkipDateTimeField extends DelegatedDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public int get(long millis) {
int value = super.get(millis);
if (value <= iSkip) {
@@ -84,6 +85,7 @@ public final class SkipDateTimeField extends DelegatedDateTimeField {
return value;
}
+ @Override
public long set(long millis, int value) {
FieldUtils.verifyValueBounds(this, value, iMinValue, getMaximumValue());
if (value <= iSkip) {
@@ -96,6 +98,7 @@ public final class SkipDateTimeField extends DelegatedDateTimeField {
return super.set(millis, value);
}
+ @Override
public int getMinimumValue() {
return iMinValue;
}
diff --git a/src/main/java/org/joda/time/field/SkipUndoDateTimeField.java b/src/main/java/org/joda/time/field/SkipUndoDateTimeField.java
index 213497da..bc9c9c21 100644
--- a/src/main/java/org/joda/time/field/SkipUndoDateTimeField.java
+++ b/src/main/java/org/joda/time/field/SkipUndoDateTimeField.java
@@ -75,6 +75,7 @@ public final class SkipUndoDateTimeField extends DelegatedDateTimeField {
}
//-----------------------------------------------------------------------
+ @Override
public int get(long millis) {
int value = super.get(millis);
if (value < iSkip) {
@@ -83,6 +84,7 @@ public final class SkipUndoDateTimeField extends DelegatedDateTimeField {
return value;
}
+ @Override
public long set(long millis, int value) {
FieldUtils.verifyValueBounds(this, value, iMinValue, getMaximumValue());
if (value <= iSkip) {
@@ -91,6 +93,7 @@ public final class SkipUndoDateTimeField extends DelegatedDateTimeField {
return super.set(millis, value);
}
+ @Override
public int getMinimumValue() {
return iMinValue;
}
diff --git a/src/main/java/org/joda/time/field/StrictDateTimeField.java b/src/main/java/org/joda/time/field/StrictDateTimeField.java
index e969f8c5..e1a00250 100644
--- a/src/main/java/org/joda/time/field/StrictDateTimeField.java
+++ b/src/main/java/org/joda/time/field/StrictDateTimeField.java
@@ -34,8 +34,10 @@ public class StrictDateTimeField extends DelegatedDateTimeField {
/**
* Returns a strict version of the given field. If it is already strict,
- * then it is returned as-is. Otherwise, a new StrictDateTimeField is
- * returned.
+ * then it is returned as-is. Otherwise, a new StrictDateTimeField is returned.
+ *
+ * @param field the field, null returns null
+ * @return the field. may be null
*/
public static DateTimeField getInstance(DateTimeField field) {
if (field == null) {
@@ -54,6 +56,7 @@ public class StrictDateTimeField extends DelegatedDateTimeField {
super(field);
}
+ @Override
public final boolean isLenient() {
return false;
}
@@ -63,6 +66,7 @@ public class StrictDateTimeField extends DelegatedDateTimeField {
*
* @throws IllegalArgumentException if the value is invalid
*/
+ @Override
public long set(long instant, int value) {
FieldUtils.verifyValueBounds
(this, value, getMinimumValue(instant), getMaximumValue(instant));
diff --git a/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java b/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java
index 897baf78..c8023e63 100644
--- a/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java
+++ b/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java
@@ -18,6 +18,7 @@ package org.joda.time.field;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Locale;
+
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DurationField;
@@ -45,6 +46,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
* The returned instance is cached.
*
* @param type the type to obtain
+ * @param durationField the duration field
* @return the instance
* @throws IllegalArgumentException if durationField is null
*/
@@ -91,10 +93,12 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
// Design note: Simple accessors return a suitable value, but methods
// intended to perform calculations throw an UnsupportedOperationException.
+ @Override
public DateTimeFieldType getType() {
return iType;
}
+ @Override
public String getName() {
return iType.getName();
}
@@ -104,6 +108,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return false always
*/
+ @Override
public boolean isSupported() {
return false;
}
@@ -113,6 +118,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return false always
*/
+ @Override
public boolean isLenient() {
return false;
}
@@ -120,8 +126,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int get(long instant) {
throw unsupported();
}
@@ -129,8 +136,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsText(long instant, Locale locale) {
throw unsupported();
}
@@ -138,8 +146,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsText(long instant) {
throw unsupported();
}
@@ -147,8 +156,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
throw unsupported();
}
@@ -156,8 +166,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsText(ReadablePartial partial, Locale locale) {
throw unsupported();
}
@@ -165,8 +176,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsText(int fieldValue, Locale locale) {
throw unsupported();
}
@@ -174,8 +186,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsShortText(long instant, Locale locale) {
throw unsupported();
}
@@ -183,8 +196,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsShortText(long instant) {
throw unsupported();
}
@@ -192,8 +206,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) {
throw unsupported();
}
@@ -201,8 +216,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsShortText(ReadablePartial partial, Locale locale) {
throw unsupported();
}
@@ -210,8 +226,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public String getAsShortText(int fieldValue, Locale locale) {
throw unsupported();
}
@@ -221,6 +238,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
+ @Override
public long add(long instant, int value) {
return getDurationField().add(instant, value);
}
@@ -230,6 +248,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
+ @Override
public long add(long instant, long value) {
return getDurationField().add(instant, value);
}
@@ -237,8 +256,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
throw unsupported();
}
@@ -246,8 +266,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
throw unsupported();
}
@@ -255,8 +276,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long addWrapField(long instant, int value) {
throw unsupported();
}
@@ -264,8 +286,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
throw unsupported();
}
@@ -275,6 +298,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifference(minuendInstant, subtrahendInstant);
}
@@ -284,6 +308,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
@@ -291,8 +316,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long set(long instant, int value) {
throw unsupported();
}
@@ -300,8 +326,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, int newValue) {
throw unsupported();
}
@@ -309,8 +336,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long set(long instant, String text, Locale locale) {
throw unsupported();
}
@@ -318,8 +346,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long set(long instant, String text) {
throw unsupported();
}
@@ -327,8 +356,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
throw unsupported();
}
@@ -339,6 +369,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return a possibly supported DurationField
*/
+ @Override
public DurationField getDurationField() {
return iDurationField;
}
@@ -348,6 +379,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return null always
*/
+ @Override
public DurationField getRangeDurationField() {
return null;
}
@@ -355,8 +387,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public boolean isLeap(long instant) {
throw unsupported();
}
@@ -364,8 +397,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getLeapAmount(long instant) {
throw unsupported();
}
@@ -375,6 +409,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return null always
*/
+ @Override
public DurationField getLeapDurationField() {
return null;
}
@@ -382,8 +417,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMinimumValue() {
throw unsupported();
}
@@ -391,8 +427,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMinimumValue(long instant) {
throw unsupported();
}
@@ -400,8 +437,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMinimumValue(ReadablePartial instant) {
throw unsupported();
}
@@ -409,8 +447,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMinimumValue(ReadablePartial instant, int[] values) {
throw unsupported();
}
@@ -418,8 +457,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumValue() {
throw unsupported();
}
@@ -427,8 +467,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumValue(long instant) {
throw unsupported();
}
@@ -436,8 +477,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumValue(ReadablePartial instant) {
throw unsupported();
}
@@ -445,8 +487,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumValue(ReadablePartial instant, int[] values) {
throw unsupported();
}
@@ -454,8 +497,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumTextLength(Locale locale) {
throw unsupported();
}
@@ -463,8 +507,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getMaximumShortTextLength(Locale locale) {
throw unsupported();
}
@@ -472,8 +517,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long roundFloor(long instant) {
throw unsupported();
}
@@ -481,8 +527,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long roundCeiling(long instant) {
throw unsupported();
}
@@ -490,8 +537,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long roundHalfFloor(long instant) {
throw unsupported();
}
@@ -499,8 +547,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long roundHalfCeiling(long instant) {
throw unsupported();
}
@@ -508,8 +557,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long roundHalfEven(long instant) {
throw unsupported();
}
@@ -517,8 +567,9 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long remainder(long instant) {
throw unsupported();
}
@@ -529,6 +580,7 @@ public final class UnsupportedDateTimeField extends DateTimeField implements Ser
*
* @return debug string
*/
+ @Override
public String toString() {
return "UnsupportedDateTimeField";
}
diff --git a/src/main/java/org/joda/time/field/UnsupportedDurationField.java b/src/main/java/org/joda/time/field/UnsupportedDurationField.java
index 12264485..461595ad 100644
--- a/src/main/java/org/joda/time/field/UnsupportedDurationField.java
+++ b/src/main/java/org/joda/time/field/UnsupportedDurationField.java
@@ -75,10 +75,12 @@ public final class UnsupportedDurationField extends DurationField implements Ser
// Design note: Simple Accessors return a suitable value, but methods
// intended to perform calculations throw an UnsupportedOperationException.
+ @Override
public final DurationFieldType getType() {
return iType;
}
+ @Override
public String getName() {
return iType.getName();
}
@@ -88,6 +90,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
*
* @return false always
*/
+ @Override
public boolean isSupported() {
return false;
}
@@ -97,6 +100,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
*
* @return true always
*/
+ @Override
public boolean isPrecise() {
return true;
}
@@ -104,8 +108,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getValue(long duration) {
throw unsupported();
}
@@ -113,8 +118,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getValueAsLong(long duration) {
throw unsupported();
}
@@ -122,8 +128,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getValue(long duration, long instant) {
throw unsupported();
}
@@ -131,8 +138,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getValueAsLong(long duration, long instant) {
throw unsupported();
}
@@ -140,8 +148,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getMillis(int value) {
throw unsupported();
}
@@ -149,17 +158,19 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getMillis(long value) {
throw unsupported();
}
/**
- * Always throws UnsupportedOperationException
+ * Always throws UnsupportedOperationException as this is not supported
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getMillis(int value, long instant) {
throw unsupported();
}
@@ -167,8 +178,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getMillis(long value, long instant) {
throw unsupported();
}
@@ -176,8 +188,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long add(long instant, int value) {
throw unsupported();
}
@@ -185,8 +198,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long add(long instant, long value) {
throw unsupported();
}
@@ -194,8 +208,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
throw unsupported();
}
@@ -203,8 +218,9 @@ public final class UnsupportedDurationField extends DurationField implements Ser
/**
* Always throws UnsupportedOperationException
*
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException as this is not supported
*/
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
throw unsupported();
}
@@ -214,6 +230,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
*
* @return zero always
*/
+ @Override
public long getUnitMillis() {
return 0;
}
@@ -234,6 +251,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
* @param obj the object to compare to
* @return true if equal
*/
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -252,6 +270,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
*
* @return the hashcode
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
@@ -261,6 +280,7 @@ public final class UnsupportedDurationField extends DurationField implements Ser
*
* @return debug string
*/
+ @Override
public String toString() {
return "UnsupportedDurationField[" + getName() + ']';
}
diff --git a/src/main/java/org/joda/time/field/ZeroIsMaxDateTimeField.java b/src/main/java/org/joda/time/field/ZeroIsMaxDateTimeField.java
index 8a9011e2..32686fa2 100644
--- a/src/main/java/org/joda/time/field/ZeroIsMaxDateTimeField.java
+++ b/src/main/java/org/joda/time/field/ZeroIsMaxDateTimeField.java
@@ -49,6 +49,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
}
}
+ @Override
public int get(long instant) {
int value = getWrappedField().get(instant);
if (value == 0) {
@@ -57,30 +58,37 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
return value;
}
+ @Override
public long add(long instant, int value) {
return getWrappedField().add(instant, value);
}
+ @Override
public long add(long instant, long value) {
return getWrappedField().add(instant, value);
}
+ @Override
public long addWrapField(long instant, int value) {
return getWrappedField().addWrapField(instant, value);
}
+ @Override
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
return getWrappedField().addWrapField(instant, fieldIndex, values, valueToAdd);
}
+ @Override
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifference(minuendInstant, subtrahendInstant);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
+ @Override
public long set(long instant, int value) {
int max = getMaximumValue();
FieldUtils.verifyValueBounds(this, value, 1, max);
@@ -90,14 +98,17 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
return getWrappedField().set(instant, value);
}
+ @Override
public boolean isLeap(long instant) {
return getWrappedField().isLeap(instant);
}
+ @Override
public int getLeapAmount(long instant) {
return getWrappedField().getLeapAmount(instant);
}
+ @Override
public DurationField getLeapDurationField() {
return getWrappedField().getLeapDurationField();
}
@@ -107,6 +118,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value of 1
*/
+ @Override
public int getMinimumValue() {
return 1;
}
@@ -116,6 +128,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value of 1
*/
+ @Override
public int getMinimumValue(long instant) {
return 1;
}
@@ -125,6 +138,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value of 1
*/
+ @Override
public int getMinimumValue(ReadablePartial instant) {
return 1;
}
@@ -134,6 +148,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the minimum value of 1
*/
+ @Override
public int getMinimumValue(ReadablePartial instant, int[] values) {
return 1;
}
@@ -144,6 +159,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue() {
return getWrappedField().getMaximumValue() + 1;
}
@@ -154,6 +170,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue(long instant) {
return getWrappedField().getMaximumValue(instant) + 1;
}
@@ -164,6 +181,7 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue(ReadablePartial instant) {
return getWrappedField().getMaximumValue(instant) + 1;
}
@@ -174,30 +192,37 @@ public final class ZeroIsMaxDateTimeField extends DecoratedDateTimeField {
*
* @return the maximum value
*/
+ @Override
public int getMaximumValue(ReadablePartial instant, int[] values) {
return getWrappedField().getMaximumValue(instant, values) + 1;
}
+ @Override
public long roundFloor(long instant) {
return getWrappedField().roundFloor(instant);
}
+ @Override
public long roundCeiling(long instant) {
return getWrappedField().roundCeiling(instant);
}
+ @Override
public long roundHalfFloor(long instant) {
return getWrappedField().roundHalfFloor(instant);
}
+ @Override
public long roundHalfCeiling(long instant) {
return getWrappedField().roundHalfCeiling(instant);
}
+ @Override
public long roundHalfEven(long instant) {
return getWrappedField().roundHalfEven(instant);
}
+ @Override
public long remainder(long instant) {
return getWrappedField().remainder(instant);
}
diff --git a/src/main/java/org/joda/time/format/DateTimeFormatter.java b/src/main/java/org/joda/time/format/DateTimeFormatter.java
index ac3c360a..b92542f3 100644
--- a/src/main/java/org/joda/time/format/DateTimeFormatter.java
+++ b/src/main/java/org/joda/time/format/DateTimeFormatter.java
@@ -399,7 +399,9 @@ public class DateTimeFormatter {
* @since 1.1
*/
public DateTimeFormatter withPivotYear(Integer pivotYear) {
- if (iPivotYear == pivotYear || (iPivotYear != null && iPivotYear.equals(pivotYear))) {
+ long oldVal = iPivotYear == null ? Long.MIN_VALUE : iPivotYear;
+ long newVal = pivotYear == null ? Long.MIN_VALUE : pivotYear;
+ if (oldVal == newVal) {
return this;
}
return new DateTimeFormatter(iPrinter, iParser, iLocale,
@@ -517,6 +519,7 @@ public class DateTimeFormatter {
*
* @param out the destination to format to, not null
* @param instant instant to format, null means now
+ * @throws IOException if an IO error occurs
*/
public void printTo(Writer out, ReadableInstant instant) throws IOException {
printTo((Appendable) out, instant);
@@ -527,6 +530,7 @@ public class DateTimeFormatter {
*
* @param appendable the destination to format to, not null
* @param instant instant to format, null means now
+ * @throws IOException if an IO error occurs
* @since 2.0
*/
public void printTo(Appendable appendable, ReadableInstant instant) throws IOException {
@@ -572,6 +576,7 @@ public class DateTimeFormatter {
*
* @param out the destination to format to, not null
* @param instant millis since 1970-01-01T00:00:00Z
+ * @throws IOException if an IO error occurs
*/
public void printTo(Writer out, long instant) throws IOException {
printTo((Appendable) out, instant);
@@ -583,6 +588,7 @@ public class DateTimeFormatter {
*
* @param appendable the destination to format to, not null
* @param instant millis since 1970-01-01T00:00:00Z
+ * @throws IOException if an IO error occurs
* @since 2.0
*/
public void printTo(Appendable appendable, long instant) throws IOException {
@@ -632,6 +638,7 @@ public class DateTimeFormatter {
*
* @param out the destination to format to, not null
* @param partial partial to format
+ * @throws IOException if an IO error occurs
*/
public void printTo(Writer out, ReadablePartial partial) throws IOException {
printTo((Appendable) out, partial);
@@ -645,6 +652,7 @@ public class DateTimeFormatter {
*
* @param appendable the destination to format to, not null
* @param partial partial to format
+ * @throws IOException if an IO error occurs
* @since 2.0
*/
public void printTo(Appendable appendable, ReadablePartial partial) throws IOException {
diff --git a/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java b/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java
index b3fe7a3d..46746c8a 100644
--- a/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java
+++ b/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java
@@ -98,6 +98,7 @@ public class DateTimeFormatterBuilder {
* {@link DateTimeFormatter#isParser()} will help you determine the state
* of the formatter.
*
+ * @return the formatter
* @throws UnsupportedOperationException if neither printing nor parsing is supported
*/
public DateTimeFormatter toFormatter() {
@@ -126,6 +127,7 @@ public class DateTimeFormatterBuilder {
* <p>
* Subsequent changes to this builder do not affect the returned printer.
*
+ * @return the printer
* @throws UnsupportedOperationException if printing is not supported
*/
public DateTimePrinter toPrinter() {
@@ -147,6 +149,7 @@ public class DateTimeFormatterBuilder {
* <p>
* Subsequent changes to this builder do not affect the returned parser.
*
+ * @return the parser
* @throws UnsupportedOperationException if parsing is not supported
*/
public DateTimeParser toParser() {
@@ -339,6 +342,7 @@ public class DateTimeFormatterBuilder {
* time-zone, chronology, offset parsing or pivot/default year, will not be
* extracted by this method.
*
+ * @param parser the parser
* @return this DateTimeFormatterBuilder, for chaining
* @throws IllegalArgumentException if parser is null or of an invalid type
*/
@@ -392,6 +396,7 @@ public class DateTimeFormatterBuilder {
* Instructs the printer to emit a specific character, and the parser to
* expect it. The parser is case-insensitive.
*
+ * @param c the character
* @return this DateTimeFormatterBuilder, for chaining
*/
public DateTimeFormatterBuilder appendLiteral(char c) {
@@ -402,6 +407,7 @@ public class DateTimeFormatterBuilder {
* Instructs the printer to emit specific text, and the parser to expect
* it. The parser is case-insensitive.
*
+ * @param text the text
* @return this DateTimeFormatterBuilder, for chaining
* @throws IllegalArgumentException if text is null
*/
@@ -1126,6 +1132,7 @@ public class DateTimeFormatterBuilder {
* results into this builder.
*
* @param pattern pattern specification
+ * @return this DateTimeFormatterBuilder, for chaining
* @throws IllegalArgumentException if the pattern is invalid
* @see DateTimeFormat
*/
@@ -2382,7 +2389,7 @@ public class DateTimeFormatterBuilder {
prefix = text.subSequence(pos, i + 1).toString();
pos += prefix.length();
String prefixLookup = prefix;
- if (i < textLen) {
+ if (i < textLen - 1) {
prefixLookup += text.charAt(i + 1);
}
suffixSet = GROUPED_IDS.get(prefixLookup);
@@ -2631,7 +2638,7 @@ public class DateTimeFormatterBuilder {
bucket.restoreState(originalState);
}
- if (bestValidPos > position || (bestValidPos == position && isOptional)) {
+ if (bestValidPos > position || (bestValidPos == position && isOptional)) { // LGTM ignore
// Restore the state to the best valid parse.
if (bestValidState != null) {
bucket.restoreState(bestValidState);
diff --git a/src/main/java/org/joda/time/format/DateTimeParserBucket.java b/src/main/java/org/joda/time/format/DateTimeParserBucket.java
index 63ed8911..7285c649 100644
--- a/src/main/java/org/joda/time/format/DateTimeParserBucket.java
+++ b/src/main/java/org/joda/time/format/DateTimeParserBucket.java
@@ -121,8 +121,7 @@ public class DateTimeParserBucket {
* @param defaultYear the default year to use when parsing month-day
* @since 2.0
*/
- public DateTimeParserBucket(long instantLocal, Chronology chrono,
- Locale locale, Integer pivotYear, int defaultYear) {
+ public DateTimeParserBucket(long instantLocal, Chronology chrono, Locale locale, Integer pivotYear, int defaultYear) {
super();
chrono = DateTimeUtils.getChronology(chrono);
iMillis = instantLocal;
@@ -190,6 +189,8 @@ public class DateTimeParserBucket {
//-----------------------------------------------------------------------
/**
* Gets the chronology of the bucket, which will be a local (UTC) chronology.
+ *
+ * @return the chronology
*/
public Chronology getChronology() {
return iChrono;
@@ -208,6 +209,8 @@ public class DateTimeParserBucket {
//-----------------------------------------------------------------------
/**
* Returns the time zone used by computeMillis.
+ *
+ * @return the zone
*/
public DateTimeZone getZone() {
return iZone;
@@ -215,6 +218,8 @@ public class DateTimeParserBucket {
/**
* Set a time zone to be used when computeMillis is called.
+ *
+ * @param zone the zone
*/
public void setZone(DateTimeZone zone) {
iSavedState = null;
@@ -224,6 +229,8 @@ public class DateTimeParserBucket {
//-----------------------------------------------------------------------
/**
* Returns the time zone offset in milliseconds used by computeMillis.
+ *
+ * @return the offset
* @deprecated use Integer version
*/
@Deprecated
@@ -233,6 +240,8 @@ public class DateTimeParserBucket {
/**
* Returns the time zone offset in milliseconds used by computeMillis.
+ *
+ * @return the offset
*/
public Integer getOffsetInteger() {
return iOffset;
@@ -240,6 +249,8 @@ public class DateTimeParserBucket {
/**
* Set a time zone offset to be used when computeMillis is called.
+ *
+ * @param offset the offset
* @deprecated use Integer version
*/
@Deprecated
@@ -250,6 +261,8 @@ public class DateTimeParserBucket {
/**
* Set a time zone offset to be used when computeMillis is called.
+ *
+ * @param offset the pffset
*/
public void setOffset(Integer offset) {
iSavedState = null;
diff --git a/src/main/java/org/joda/time/format/DateTimePrinter.java b/src/main/java/org/joda/time/format/DateTimePrinter.java
index c2e80493..e09ef09c 100644
--- a/src/main/java/org/joda/time/format/DateTimePrinter.java
+++ b/src/main/java/org/joda/time/format/DateTimePrinter.java
@@ -78,6 +78,7 @@ public interface DateTimePrinter {
* this millisecond value
* @param displayZone the time zone to use, null means local time
* @param locale the locale to use, null means default locale
+ * @throws IOException if an IO error occurs
*/
void printTo(Writer out, long instant, Chronology chrono,
int displayOffset, DateTimeZone displayZone, Locale locale) throws IOException;
@@ -98,6 +99,7 @@ public interface DateTimePrinter {
* @param out formatted partial is written out, not null
* @param partial partial to format, not null
* @param locale the locale to use, null means default locale
+ * @throws IOException if an IO error occurs
*/
void printTo(Writer out, ReadablePartial partial, Locale locale) throws IOException;
diff --git a/src/main/java/org/joda/time/format/FormatUtils.java b/src/main/java/org/joda/time/format/FormatUtils.java
index 01e0f97e..7b88a0f9 100644
--- a/src/main/java/org/joda/time/format/FormatUtils.java
+++ b/src/main/java/org/joda/time/format/FormatUtils.java
@@ -63,6 +63,7 @@ public class FormatUtils {
* @param appenadble receives integer converted to a string
* @param value value to convert to a string
* @param size minimum amount of digits to append
+ * @throws IOException if an IO error occurs
* @since 2.4
*/
public static void appendPaddedInteger(Appendable appenadble, int value, int size) throws IOException {
@@ -137,6 +138,7 @@ public class FormatUtils {
* @param appendable receives integer converted to a string
* @param value value to convert to a string
* @param size minimum amount of digits to append
+ * @throws IOException if an IO error occurs
* @since 2.4
*/
public static void appendPaddedInteger(Appendable appendable, long value, int size) throws IOException {
@@ -175,10 +177,9 @@ public class FormatUtils {
* @param out receives integer converted to a string
* @param value value to convert to a string
* @param size minimum amount of digits to append
+ * @throws IOException if an IO error occurs
*/
- public static void writePaddedInteger(Writer out, int value, int size)
- throws IOException
- {
+ public static void writePaddedInteger(Writer out, int value, int size) throws IOException {
if (value < 0) {
out.write('-');
if (value != Integer.MIN_VALUE) {
@@ -232,10 +233,9 @@ public class FormatUtils {
* @param out receives integer converted to a string
* @param value value to convert to a string
* @param size minimum amount of digits to append
+ * @throws IOException if an IO error occurs
*/
- public static void writePaddedInteger(Writer out, long value, int size)
- throws IOException
- {
+ public static void writePaddedInteger(Writer out, long value, int size) throws IOException {
int intValue = (int)value;
if (intValue == value) {
writePaddedInteger(out, intValue, size);
@@ -285,6 +285,7 @@ public class FormatUtils {
*
* @param appendable receives integer converted to a string
* @param value value to convert to a string
+ * @throws IOException if an IO error occurs
* @since 2.4
*/
public static void appendUnpaddedInteger(Appendable appendable, int value) throws IOException {
@@ -335,6 +336,7 @@ public class FormatUtils {
*
* @param appendable receives integer converted to a string
* @param value value to convert to a string
+ * @throws IOException if an IO error occurs
*/
public static void appendUnpaddedInteger(Appendable appendable, long value) throws IOException {
int intValue = (int)value;
@@ -352,10 +354,9 @@ public class FormatUtils {
*
* @param out receives integer converted to a string
* @param value value to convert to a string
+ * @throws IOException if an IO error occurs
*/
- public static void writeUnpaddedInteger(Writer out, int value)
- throws IOException
- {
+ public static void writeUnpaddedInteger(Writer out, int value) throws IOException {
if (value < 0) {
out.write('-');
if (value != Integer.MIN_VALUE) {
@@ -387,10 +388,9 @@ public class FormatUtils {
*
* @param out receives integer converted to a string
* @param value value to convert to a string
+ * @throws IOException if an IO error occurs
*/
- public static void writeUnpaddedInteger(Writer out, long value)
- throws IOException
- {
+ public static void writeUnpaddedInteger(Writer out, long value) throws IOException {
int intValue = (int)value;
if (intValue == value) {
writeUnpaddedInteger(out, intValue);
@@ -402,6 +402,9 @@ public class FormatUtils {
/**
* Calculates the number of decimal digits for the given value,
* including the sign.
+ *
+ * @param value the value
+ * @return the digit count
*/
public static int calculateDigitCount(long value) {
if (value < 0) {
diff --git a/src/main/java/org/joda/time/format/ISODateTimeFormat.java b/src/main/java/org/joda/time/format/ISODateTimeFormat.java
index 906dadb1..4a940940 100644
--- a/src/main/java/org/joda/time/format/ISODateTimeFormat.java
+++ b/src/main/java/org/joda/time/format/ISODateTimeFormat.java
@@ -470,7 +470,6 @@ public class ISODateTimeFormat {
*
* @param bld the builder
* @param extended whether to append the separator
- * @param sep the separator
* @since 1.1
*/
private static void appendSeparator(DateTimeFormatterBuilder bld, boolean extended) {
@@ -494,6 +493,8 @@ public class ISODateTimeFormat {
* week-date-element = xxxx '-W' ww ['-' e]
* offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])
* </pre>
+ *
+ * @return the parser
*/
public static DateTimeFormatter dateParser() {
return Constants.dp;
@@ -513,6 +514,8 @@ public class ISODateTimeFormat {
* ord-date-element = yyyy ['-' DDD]
* week-date-element = xxxx '-W' ww ['-' e]
* </pre>
+ *
+ * @return the parser
* @since 1.3
*/
public static DateTimeFormatter localDateParser() {
@@ -531,6 +534,8 @@ public class ISODateTimeFormat {
* ord-date-element = yyyy ['-' DDD]
* week-date-element = xxxx '-W' ww ['-' e]
* </pre>
+ *
+ * @return the parser
*/
public static DateTimeFormatter dateElementParser() {
return Constants.dpe;
@@ -552,6 +557,8 @@ public class ISODateTimeFormat {
* fraction = ('.' | ',') digit+
* offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])
* </pre>
+ *
+ * @return the parser
*/
public static DateTimeFormatter timeParser() {
return Constants.tp;
@@ -573,6 +580,8 @@ public class ISODateTimeFormat {
* second-element = ':' ss [fraction]
* fraction = ('.' | ',') digit+
* </pre>
+ *
+ * @return the parser
* @since 1.3
*/
public static DateTimeFormatter localTimeParser() {
@@ -593,6 +602,8 @@ public class ISODateTimeFormat {
* second-element = ':' ss [fraction]
* fraction = ('.' | ',') digit+
* </pre>
+ *
+ * @return the parser
*/
public static DateTimeFormatter timeElementParser() {
return Constants.tpe;
@@ -620,6 +631,8 @@ public class ISODateTimeFormat {
* fraction = ('.' | ',') digit+
* offset = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])
* </pre>
+ *
+ * @return the parser
*/
public static DateTimeFormatter dateTimeParser() {
return Constants.dtp;
@@ -646,6 +659,8 @@ public class ISODateTimeFormat {
* fraction = ('.' | ',') digit+
* </pre>
* @since 1.3
+ *
+ * @return the parser
*/
public static DateTimeFormatter dateOptionalTimeParser() {
return Constants.dotp;
@@ -672,6 +687,8 @@ public class ISODateTimeFormat {
* second-element = ':' ss [fraction]
* fraction = ('.' | ',') digit+
* </pre>
+ *
+ * @return the parser
* @since 1.3
*/
public static DateTimeFormatter localDateOptionalTimeParser() {
diff --git a/src/main/java/org/joda/time/format/InternalParserDateTimeParser.java b/src/main/java/org/joda/time/format/InternalParserDateTimeParser.java
index c046c185..533d812c 100644
--- a/src/main/java/org/joda/time/format/InternalParserDateTimeParser.java
+++ b/src/main/java/org/joda/time/format/InternalParserDateTimeParser.java
@@ -69,4 +69,9 @@ class InternalParserDateTimeParser implements DateTimeParser, InternalParser {
return false;
}
+
+ @Override
+ public int hashCode() {
+ return underlying.hashCode();
+ }
}
diff --git a/src/main/java/org/joda/time/format/InternalPrinter.java b/src/main/java/org/joda/time/format/InternalPrinter.java
index 8613cb3a..5c5b154a 100644
--- a/src/main/java/org/joda/time/format/InternalPrinter.java
+++ b/src/main/java/org/joda/time/format/InternalPrinter.java
@@ -52,6 +52,7 @@ interface InternalPrinter {
* this millisecond value
* @param displayZone the time zone to use, null means local time
* @param locale the locale to use, null means default locale
+ * @throws IOException if an IO error occurs
*/
void printTo(Appendable appendable, long instant, Chronology chrono,
int displayOffset, DateTimeZone displayZone, Locale locale) throws IOException;
@@ -62,6 +63,7 @@ interface InternalPrinter {
* @param appendable formatted instant is appended to, not null
* @param partial partial to format, not null
* @param locale the locale to use, null means default locale
+ * @throws IOException if an IO error occurs
*/
void printTo(Appendable appendable, ReadablePartial partial, Locale locale) throws IOException;
diff --git a/src/main/java/org/joda/time/format/InternalPrinterDateTimePrinter.java b/src/main/java/org/joda/time/format/InternalPrinterDateTimePrinter.java
index fbd3d3b2..c8450706 100644
--- a/src/main/java/org/joda/time/format/InternalPrinterDateTimePrinter.java
+++ b/src/main/java/org/joda/time/format/InternalPrinterDateTimePrinter.java
@@ -103,4 +103,8 @@ class InternalPrinterDateTimePrinter implements DateTimePrinter, InternalPrinter
return false;
}
+ @Override
+ public int hashCode() {
+ return underlying.hashCode();
+ }
}
diff --git a/src/main/java/org/joda/time/format/PeriodFormat.java b/src/main/java/org/joda/time/format/PeriodFormat.java
index b763c964..5ef5cc47 100644
--- a/src/main/java/org/joda/time/format/PeriodFormat.java
+++ b/src/main/java/org/joda/time/format/PeriodFormat.java
@@ -196,6 +196,7 @@ public class PeriodFormat {
* Available languages are English, Danish, Dutch, French, German, Japanese,
* Polish, Portuguese and Spanish.
*
+ * @param locale the locale
* @return the formatter, not null
* @since 2.0, regex since 2.5
*/
diff --git a/src/main/java/org/joda/time/format/PeriodFormatter.java b/src/main/java/org/joda/time/format/PeriodFormatter.java
index a69035db..0eba533e 100644
--- a/src/main/java/org/joda/time/format/PeriodFormatter.java
+++ b/src/main/java/org/joda/time/format/PeriodFormatter.java
@@ -222,6 +222,7 @@ public class PeriodFormatter {
*
* @param out the formatted period is written out
* @param period the period to format, not null
+ * @throws IOException if an IO error occurs
*/
public void printTo(Writer out, ReadablePeriod period) throws IOException {
checkPrinter();
diff --git a/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java b/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java
index 78d62a81..bd4d00f8 100644
--- a/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java
+++ b/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java
@@ -200,6 +200,7 @@ public class PeriodFormatterBuilder {
/**
* Appends another formatter.
*
+ * @param formatter the formatter to append
* @return this PeriodFormatterBuilder
*/
public PeriodFormatterBuilder append(PeriodFormatter formatter) {
@@ -235,6 +236,7 @@ public class PeriodFormatterBuilder {
* Instructs the printer to emit specific text, and the parser to expect it.
* The parser is case-insensitive.
*
+ * @param text the text to append
* @return this PeriodFormatterBuilder
* @throws IllegalArgumentException if text is null
*/
@@ -253,6 +255,7 @@ public class PeriodFormatterBuilder {
* fields. By default, the minimum digits printed is one. If the field value
* is zero, it is not printed unless a printZero rule is applied.
*
+ * @param minDigits the minimum number of digits
* @return this PeriodFormatterBuilder
*/
public PeriodFormatterBuilder minimumPrintedDigits(int minDigits) {
@@ -264,6 +267,7 @@ public class PeriodFormatterBuilder {
* Set the maximum digits parsed for the next and following appended
* fields. By default, the maximum digits parsed is ten.
*
+ * @param maxDigits the maximum number of digits
* @return this PeriodFormatterBuilder
*/
public PeriodFormatterBuilder maximumParsedDigits(int maxDigits) {
@@ -274,10 +278,11 @@ public class PeriodFormatterBuilder {
/**
* Reject signed values when parsing the next and following appended fields.
*
+ * @param reject true to reject signed values
* @return this PeriodFormatterBuilder
*/
- public PeriodFormatterBuilder rejectSignedValues(boolean v) {
- iRejectSignedValues = v;
+ public PeriodFormatterBuilder rejectSignedValues(boolean reject) {
+ iRejectSignedValues = reject;
return this;
}
@@ -935,11 +940,15 @@ public class PeriodFormatterBuilder {
void printTo(Writer out, int value) throws IOException;
/**
+ * @param periodStr the period
+ * @param position the position
* @return new position after parsing affix, or ~position of failure
*/
int parse(String periodStr, int position);
/**
+ * @param periodStr the period
+ * @param position the position
* @return position where affix starts, or original ~position if not found
*/
int scan(String periodStr, int position);
@@ -958,7 +967,7 @@ public class PeriodFormatterBuilder {
* - the affix text is also a match
* - the affix text is longer than the match from this object
*
- * @param affixesToIgnore
+ * @param affixesToIgnore the affixes that should be ignored
*/
void finish(Set<PeriodFieldAffix> affixesToIgnore);
}
@@ -1775,7 +1784,7 @@ public class PeriodFormatterBuilder {
if (isZero(period) && iFieldFormatters[iFieldType] == this) {
int i = Math.min(iFieldType, 8); // line split out for IBM JDK
i--; // see bug 1660490
- for (; i >= 0 && i <= MAX_FIELD; i--) {
+ for (; i >= 0; i--) {
if (isSupported(type, i) && iFieldFormatters[i] != null) {
return Long.MAX_VALUE;
}
diff --git a/src/main/java/org/joda/time/format/PeriodPrinter.java b/src/main/java/org/joda/time/format/PeriodPrinter.java
index d633deef..8138c6a3 100644
--- a/src/main/java/org/joda/time/format/PeriodPrinter.java
+++ b/src/main/java/org/joda/time/format/PeriodPrinter.java
@@ -77,6 +77,7 @@ public interface PeriodPrinter {
* @param out the formatted period is written out
* @param period the period to format
* @param locale the locale to use
+ * @throws IOException if an IO error occurs
*/
void printTo(Writer out, ReadablePeriod period, Locale locale) throws IOException;
diff --git a/src/main/java/org/joda/time/format/messages_bg.properties b/src/main/java/org/joda/time/format/messages_bg.properties
index 9fb9bf57..bde391f2 100644
--- a/src/main/java/org/joda/time/format/messages_bg.properties
+++ b/src/main/java/org/joda/time/format/messages_bg.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,\u0438
-PeriodFormat.commaspaceand=, \u0438
+PeriodFormat.commandand=,\u0438
+PeriodFormat.commaspaceand=, \u0438
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ \u0438
PeriodFormat.year=\ \u0433\u043e\u0434\u0438\u043d\u0430
diff --git a/src/main/java/org/joda/time/format/messages_ca.properties b/src/main/java/org/joda/time/format/messages_ca.properties
new file mode 100644
index 00000000..cce91386
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_ca.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,i
+PeriodFormat.commaspaceand=, i
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ i
+PeriodFormat.year=\ any
+PeriodFormat.years=\ anys
+PeriodFormat.month=\ mes
+PeriodFormat.months=\ mesoss
+PeriodFormat.week=\ semana
+PeriodFormat.weeks=\ semanas
+PeriodFormat.day=\ dia
+PeriodFormat.days=\ dies
+PeriodFormat.hour=\ hora
+PeriodFormat.hours=\ hores
+PeriodFormat.minute=\ minut
+PeriodFormat.minutes=\ minuts
+PeriodFormat.second=\ segon
+PeriodFormat.seconds=\ segons
+PeriodFormat.millisecond=\ milisegon
+PeriodFormat.milliseconds=\ milisegons
diff --git a/src/main/java/org/joda/time/format/messages_cs.properties b/src/main/java/org/joda/time/format/messages_cs.properties
index 9a548b78..86fce844 100644
--- a/src/main/java/org/joda/time/format/messages_cs.properties
+++ b/src/main/java/org/joda/time/format/messages_cs.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,a
-PeriodFormat.commaspaceand=, a
+PeriodFormat.commandand=,a
+PeriodFormat.commaspaceand=, a
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ a
PeriodFormat.regex.separator=%
diff --git a/src/main/java/org/joda/time/format/messages_da.properties b/src/main/java/org/joda/time/format/messages_da.properties
index 837cae45..31599b98 100644
--- a/src/main/java/org/joda/time/format/messages_da.properties
+++ b/src/main/java/org/joda/time/format/messages_da.properties
@@ -2,8 +2,8 @@ PeriodFormat.space=\
PeriodFormat.comma=,
PeriodFormat.commandand=,og
PeriodFormat.commaspaceand=, og
-PeriodFormat.commaspace=,\
-PeriodFormat.spaceandspace=\ og\
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ og
PeriodFormat.year=\ \u00e5r
PeriodFormat.years=\ \u00e5r
PeriodFormat.month=\ m\u00e5ned
diff --git a/src/main/java/org/joda/time/format/messages_de.properties b/src/main/java/org/joda/time/format/messages_de.properties
index 177c2a3e..de4e4349 100644
--- a/src/main/java/org/joda/time/format/messages_de.properties
+++ b/src/main/java/org/joda/time/format/messages_de.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,und
-PeriodFormat.commaspaceand=, und
+PeriodFormat.commandand=,und
+PeriodFormat.commaspaceand=, und
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ und
PeriodFormat.year=\ Jahr
diff --git a/src/main/java/org/joda/time/format/messages_el.properties b/src/main/java/org/joda/time/format/messages_el.properties
new file mode 100644
index 00000000..b22fbd97
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_el.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,\u03ba\u03b1\u03b9
+PeriodFormat.commaspaceand=, \u03ba\u03b1\u03b9
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ \u03ba\u03b1\u03b9
+PeriodFormat.year=\ \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2
+PeriodFormat.years=\ \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1
+PeriodFormat.month=\ \u03bc\u03ae\u03bd\u03b1\u03c2
+PeriodFormat.months=\ \u03bc\u03ae\u03bd\u03b5\u03c2
+PeriodFormat.week=\ \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b1
+PeriodFormat.weeks=\ \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b5\u03c2
+PeriodFormat.day=\ \u03bc\u03ad\u03c1\u03b1
+PeriodFormat.days=\ \u03bc\u03ad\u03c1\u03b5\u03c2
+PeriodFormat.hour=\ \u03ce\u03c1\u03b1
+PeriodFormat.hours=\ \u03ce\u03c1\u03b5\u03c2
+PeriodFormat.minute=\ \u03bb\u03b5\u03c0\u03c4\u03cc
+PeriodFormat.minutes=\ \u03bb\u03b5\u03c0\u03c4\u03ac
+PeriodFormat.second=\ \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03bf
+PeriodFormat.seconds=\ \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1
+PeriodFormat.millisecond=\ \u03c7\u03b9\u03bb\u03b9\u03bf\u03c3\u03c4\u03cc \u03c4\u03bf\u03c5 \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03bf\u03bb\u03ad\u03c0\u03c4\u03bf\u03c5
+PeriodFormat.milliseconds=\ \u03c7\u03b9\u03bb\u03b9\u03bf\u03c3\u03c4\u03ac \u03c4\u03bf\u03c5 \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03bf\u03bb\u03ad\u03c0\u03c4\u03bf\u03c5
diff --git a/src/main/java/org/joda/time/format/messages_es.properties b/src/main/java/org/joda/time/format/messages_es.properties
index 2b601cff..9f4fa6b4 100644
--- a/src/main/java/org/joda/time/format/messages_es.properties
+++ b/src/main/java/org/joda/time/format/messages_es.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,y
-PeriodFormat.commaspaceand=, y
+PeriodFormat.commandand=,y
+PeriodFormat.commaspaceand=, y
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ y
PeriodFormat.year=\ a\u00f1o
diff --git a/src/main/java/org/joda/time/format/messages_eu.properties b/src/main/java/org/joda/time/format/messages_eu.properties
new file mode 100644
index 00000000..5ad5f352
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_eu.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,eta
+PeriodFormat.commaspaceand=, eta
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ eta
+PeriodFormat.year=\ urte
+PeriodFormat.years=\ urte
+PeriodFormat.month=\ hilabete
+PeriodFormat.months=\ hilabete
+PeriodFormat.week=\ aste
+PeriodFormat.weeks=\ aste
+PeriodFormat.day=\ egun
+PeriodFormat.days=\ egun
+PeriodFormat.hour=\ ordu
+PeriodFormat.hours=\ ordu
+PeriodFormat.minute=\ minuto
+PeriodFormat.minutes=\ minuto
+PeriodFormat.second=\ segundo
+PeriodFormat.seconds=\ segundo
+PeriodFormat.millisecond=\ milisegundo
+PeriodFormat.milliseconds=\ milisegundo
diff --git a/src/main/java/org/joda/time/format/messages_fi.properties b/src/main/java/org/joda/time/format/messages_fi.properties
new file mode 100644
index 00000000..b1905d22
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_fi.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,ja
+PeriodFormat.commaspaceand=, ja
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ ja
+PeriodFormat.year=\ vuosi
+PeriodFormat.years=\ vuotta
+PeriodFormat.month=\ kuukausi
+PeriodFormat.months=\ kuukautta
+PeriodFormat.week=\ viikko
+PeriodFormat.weeks=\ viikkoa
+PeriodFormat.day=\ p\u00e4iv\u00e4
+PeriodFormat.days=\ p\u00e4iv\u00e4\u00e4
+PeriodFormat.hour=\ tunti
+PeriodFormat.hours=\ tuntia
+PeriodFormat.minute=\ minuutti
+PeriodFormat.minutes=\ minuuttia
+PeriodFormat.second=\ sekunti
+PeriodFormat.seconds=\ sekuntia
+PeriodFormat.millisecond=\ millisekunti
+PeriodFormat.milliseconds=\ millisekuntia
diff --git a/src/main/java/org/joda/time/format/messages_fr.properties b/src/main/java/org/joda/time/format/messages_fr.properties
index 7275856d..a16891ee 100644
--- a/src/main/java/org/joda/time/format/messages_fr.properties
+++ b/src/main/java/org/joda/time/format/messages_fr.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,et
-PeriodFormat.commaspaceand=, et
+PeriodFormat.commandand=,et
+PeriodFormat.commaspaceand=, et
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ et
PeriodFormat.year=\ ann\u00e9e
diff --git a/src/main/java/org/joda/time/format/messages_ga.properties b/src/main/java/org/joda/time/format/messages_ga.properties
new file mode 100644
index 00000000..48ab1f95
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_ga.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,agus
+PeriodFormat.commaspaceand=, agus
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ agus
+PeriodFormat.year=\ bliain
+PeriodFormat.years=\ blianta
+PeriodFormat.month=\ m\u00ed
+PeriodFormat.months=\ m\u00edonna
+PeriodFormat.week=\ seachtain
+PeriodFormat.weeks=\ seachtain\u00ed
+PeriodFormat.day=\ l\u00e1
+PeriodFormat.days=\ laethanta
+PeriodFormat.hour=\ uair
+PeriodFormat.hours=\ uair
+PeriodFormat.minute=\ n\u00f3im\u00e9ad
+PeriodFormat.minutes=\ miontuairisc\u00ed
+PeriodFormat.second=\ dara
+PeriodFormat.seconds=\ soicind
+PeriodFormat.millisecond=\ milleasoicind
+PeriodFormat.milliseconds=\ milleasoicind
diff --git a/src/main/java/org/joda/time/format/messages_hi.properties b/src/main/java/org/joda/time/format/messages_hi.properties
new file mode 100644
index 00000000..99307ecd
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_hi.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,\u0914\u0930
+PeriodFormat.commaspaceand=, \u0914\u0930
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ \u0914\u0930
+PeriodFormat.year=\ \u0938\u093e\u0932
+PeriodFormat.years=\ \u0938\u093e\u0932
+PeriodFormat.month=\ \u092e\u0939\u0940\u0928\u093e
+PeriodFormat.months=\ \u092e\u0939\u0940\u0928\u0947
+PeriodFormat.week=\ \u0938\u092a\u094d\u0924\u093e\u0939
+PeriodFormat.weeks=\ \u0938\u092a\u094d\u0924\u093e\u0939
+PeriodFormat.day=\ \u0926\u093f\u0928
+PeriodFormat.days=\ \u0926\u093f\u0928
+PeriodFormat.hour=\ \u0918\u0902\u091f\u093e
+PeriodFormat.hours=\ \u0918\u0902\u091f\u0947
+PeriodFormat.minute=\ \u092e\u093f\u0928\u091f
+PeriodFormat.minutes=\ \u092e\u093f\u0928\u091f
+PeriodFormat.second=\ \u0938\u0947\u0915\u0902\u0921
+PeriodFormat.seconds=\ \u0938\u0947\u0915\u0902\u0921
+PeriodFormat.millisecond=\ \u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921
+PeriodFormat.milliseconds=\ \u092e\u093f\u0932\u0940\u0938\u0947\u0915\u0902\u0921
\ No newline at end of file
diff --git a/src/main/java/org/joda/time/format/messages_hu.properties b/src/main/java/org/joda/time/format/messages_hu.properties
new file mode 100644
index 00000000..f499d72a
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_hu.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,\u00e9s
+PeriodFormat.commaspaceand=, \u00e9s
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ \u00e9s
+PeriodFormat.year=\ \u00e9v
+PeriodFormat.years=\ \u00e9v
+PeriodFormat.month=\ h\u00f3nap
+PeriodFormat.months=\ h\u00f3nap
+PeriodFormat.week=\ h\u00e9t
+PeriodFormat.weeks=\ h\u00e9t
+PeriodFormat.day=\ nap
+PeriodFormat.days=\ nap
+PeriodFormat.hour=\ \u00f3ra
+PeriodFormat.hours=\ \u00f3ra
+PeriodFormat.minute=\ perc
+PeriodFormat.minutes=\ perc
+PeriodFormat.second=\ m\u00e1sodperc
+PeriodFormat.seconds=\ m\u00e1sodperc
+PeriodFormat.millisecond=\ miliszekundum
+PeriodFormat.milliseconds=\ miliszekundum
\ No newline at end of file
diff --git a/src/main/java/org/joda/time/format/messages_in.properties b/src/main/java/org/joda/time/format/messages_in.properties
new file mode 100644
index 00000000..e4f06c42
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_in.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,dan
+PeriodFormat.commaspaceand=, dan
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ dan
+PeriodFormat.year=\ tahun
+PeriodFormat.years=\ tahun
+PeriodFormat.month=\ bulan
+PeriodFormat.months=\ bulan
+PeriodFormat.week=\ minggu
+PeriodFormat.weeks=\ minggu
+PeriodFormat.day=\ hari
+PeriodFormat.days=\ hari
+PeriodFormat.hour=\ jam
+PeriodFormat.hours=\ jam
+PeriodFormat.minute=\ menit
+PeriodFormat.minutes=\ menit
+PeriodFormat.second=\ detik
+PeriodFormat.seconds=\ detik
+PeriodFormat.millisecond=\ millidetik
+PeriodFormat.milliseconds=\ millidetik
diff --git a/src/main/java/org/joda/time/format/messages_iw.properties b/src/main/java/org/joda/time/format/messages_iw.properties
new file mode 100644
index 00000000..75508ad5
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_iw.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=\u05d5,
+PeriodFormat.commaspaceand=, \u05d5
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ \u05d5-
+PeriodFormat.year=\ \u05e9\u05e0\u05d4
+PeriodFormat.years=\ \u05e9\u05e0\u05d9\u05dd
+PeriodFormat.month=\ \u05d7\u05d5\u05d3\u05e9
+PeriodFormat.months=\ \u05d7\u05d5\u05d3\u05e9\u05d9\u05dd
+PeriodFormat.week=\ \u05e9\u05d1\u05d5\u05e2
+PeriodFormat.weeks=\ \u05e9\u05d1\u05d5\u05e2\u05d5\u05ea
+PeriodFormat.day=\ \u05d9\u05d5\u05dd
+PeriodFormat.days=\ \u05d9\u05de\u05d9\u05dd
+PeriodFormat.hour=\ \u05e9\u05e2\u05d4
+PeriodFormat.hours=\ \u05e9\u05e2\u05d5\u05ea
+PeriodFormat.minute=\ \u05d3\u05e7\u05d4
+PeriodFormat.minutes=\ \u05d3\u05e7\u05d5\u05ea
+PeriodFormat.second=\ \u05e9\u05e0\u05d9\u05d9\u05d4
+PeriodFormat.seconds=\ \u05e9\u05e0\u05d9\u05d5\u05ea
+PeriodFormat.millisecond=\ \u05d0\u05dc\u05e4\u05d9\u05ea \u05e9\u05e0\u05d9\u05d9\u05d4
+PeriodFormat.milliseconds=\ \u05d0\u05dc\u05e4\u05d9\u05d5\u05ea \u05e9\u05e0\u05d9\u05d9\u05d4
diff --git a/src/main/java/org/joda/time/format/messages_ms.properties b/src/main/java/org/joda/time/format/messages_ms.properties
new file mode 100644
index 00000000..1db45c03
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_ms.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,dan
+PeriodFormat.commaspaceand=, dan
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ dan
+PeriodFormat.year=\ tahun
+PeriodFormat.years=\ tahun
+PeriodFormat.month=\ bulan
+PeriodFormat.months=\ bulan
+PeriodFormat.week=\ minggu
+PeriodFormat.weeks=\ minggu
+PeriodFormat.day=\ hari
+PeriodFormat.days=\ hari
+PeriodFormat.hour=\ jam
+PeriodFormat.hours=\ jam
+PeriodFormat.minute=\ minit
+PeriodFormat.minutes=\ minit
+PeriodFormat.second=\ saat
+PeriodFormat.seconds=\ saat
+PeriodFormat.millisecond=\ milisaat
+PeriodFormat.milliseconds=\ milisaat
diff --git a/src/main/java/org/joda/time/format/messages_nl.properties b/src/main/java/org/joda/time/format/messages_nl.properties
index b43f56f6..0b3033c5 100644
--- a/src/main/java/org/joda/time/format/messages_nl.properties
+++ b/src/main/java/org/joda/time/format/messages_nl.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,en
-PeriodFormat.commaspaceand=, en
+PeriodFormat.commandand=,en
+PeriodFormat.commaspaceand=, en
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ en
PeriodFormat.year=\ jaar
diff --git a/src/main/java/org/joda/time/format/messages_nn.properties b/src/main/java/org/joda/time/format/messages_nn.properties
new file mode 100644
index 00000000..013b4f64
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_nn.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,og
+PeriodFormat.commaspaceand=, og
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ og
+PeriodFormat.year=\ \u00e5r
+PeriodFormat.years=\ \u00e5r
+PeriodFormat.month=\ m\u00e5nad
+PeriodFormat.months=\ m\u00e5nader
+PeriodFormat.week=\ veke
+PeriodFormat.weeks=\ veker
+PeriodFormat.day=\ dag
+PeriodFormat.days=\ dagar
+PeriodFormat.hour=\ time
+PeriodFormat.hours=\ timar
+PeriodFormat.minute=\ minutt
+PeriodFormat.minutes=\ minutt
+PeriodFormat.second=\ sekund
+PeriodFormat.seconds=\ sekund
+PeriodFormat.millisecond=\ millisekund
+PeriodFormat.milliseconds=\ millisekund
diff --git a/src/main/java/org/joda/time/format/messages_no.properties b/src/main/java/org/joda/time/format/messages_no.properties
index dacda841..6859b412 100644
--- a/src/main/java/org/joda/time/format/messages_no.properties
+++ b/src/main/java/org/joda/time/format/messages_no.properties
@@ -2,8 +2,8 @@ PeriodFormat.space=\
PeriodFormat.comma=,
PeriodFormat.commandand=,og
PeriodFormat.commaspaceand=, og
-PeriodFormat.commaspace=,\
-PeriodFormat.spaceandspace=\ og\
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ og
PeriodFormat.year=\ \u00e5r
PeriodFormat.years=\ \u00e5r
PeriodFormat.month=\ m\u00e5ned
diff --git a/src/main/java/org/joda/time/format/messages_pl.properties b/src/main/java/org/joda/time/format/messages_pl.properties
index 67c92657..c036fe3d 100644
--- a/src/main/java/org/joda/time/format/messages_pl.properties
+++ b/src/main/java/org/joda/time/format/messages_pl.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,i
-PeriodFormat.commaspaceand=, i
+PeriodFormat.commandand=,i
+PeriodFormat.commaspaceand=, i
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ i
PeriodFormat.regex.separator=%
diff --git a/src/main/java/org/joda/time/format/messages_pt.properties b/src/main/java/org/joda/time/format/messages_pt.properties
index e45b7359..d310b1a0 100644
--- a/src/main/java/org/joda/time/format/messages_pt.properties
+++ b/src/main/java/org/joda/time/format/messages_pt.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,e
-PeriodFormat.commaspaceand=, e
+PeriodFormat.commandand=,e
+PeriodFormat.commaspaceand=, e
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ e
PeriodFormat.year=\ ano
diff --git a/src/main/java/org/joda/time/format/messages_ro.properties b/src/main/java/org/joda/time/format/messages_ro.properties
new file mode 100644
index 00000000..0157cacb
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_ro.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,\u0219i
+PeriodFormat.commaspaceand=, \u0219i
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ \u0219i
+PeriodFormat.year=\ an
+PeriodFormat.years=\ ani
+PeriodFormat.month=\ lun\u0103
+PeriodFormat.months=\ luni
+PeriodFormat.week=\ s\u0103pt\u0103m\u00e2n\u0103
+PeriodFormat.weeks=\ s\u0103pt\u0103m\u00e2ni
+PeriodFormat.day=\ zi
+PeriodFormat.days=\ zile
+PeriodFormat.hour=\ or\u0103
+PeriodFormat.hours=\ ore
+PeriodFormat.minute=\ minut
+PeriodFormat.minutes=\ minute
+PeriodFormat.second=\ secund\u0103
+PeriodFormat.seconds=\ secunde
+PeriodFormat.millisecond=\ milisecund\u0103
+PeriodFormat.milliseconds=\ milisecunde
diff --git a/src/main/java/org/joda/time/format/messages_sk.properties b/src/main/java/org/joda/time/format/messages_sk.properties
new file mode 100644
index 00000000..1438b9aa
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_sk.properties
@@ -0,0 +1,23 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,a
+PeriodFormat.commaspaceand=, a
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ a
+PeriodFormat.regex.separator=%
+PeriodFormat.years.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.years.list=\ rok%\ roky%\ rokov
+PeriodFormat.months.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.months.list=\ mesiac%\ mesiace%\ mesiacov
+PeriodFormat.weeks.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.weeks.list=\ t\u00fd\u017ede\u0148%\ t\u00fd\u017edne%\ t\u00fd\u017ed\u0148ov
+PeriodFormat.days.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.days.list=\ de\u0148%\ dni%\ dn\u00ed
+PeriodFormat.hours.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.hours.list=\ hodina%\ hodiny%\ hod\u00edn
+PeriodFormat.minutes.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.minutes.list=\ min\u00fata%\ min\u00faty%\ min\u00fat
+PeriodFormat.seconds.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.seconds.list=\ sekunda%\ sekundy%\ sek\u00fand
+PeriodFormat.milliseconds.regex=^1$%^[2-4]$%[0-9]*
+PeriodFormat.milliseconds.list=\ milisekunda%\ milisekundy%\ milisek\u00fand
diff --git a/src/main/java/org/joda/time/format/messages_sq.properties b/src/main/java/org/joda/time/format/messages_sq.properties
new file mode 100644
index 00000000..e68b5c2d
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_sq.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,dhe
+PeriodFormat.commaspaceand=, dhe
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ dhe
+PeriodFormat.year=\ vit
+PeriodFormat.years=\ vjet
+PeriodFormat.month=\ muaj
+PeriodFormat.months=\ muaj
+PeriodFormat.week=\ jav\u00EB
+PeriodFormat.weeks=\ jav\u00EB
+PeriodFormat.day=\ dit\u00EB
+PeriodFormat.days=\ dit\u00EB
+PeriodFormat.hour=\ or\u00EB
+PeriodFormat.hours=\ or\u00EB
+PeriodFormat.minute=\ minut\u00EB
+PeriodFormat.minutes=\ minuta
+PeriodFormat.second=\ sekond\u00EB
+PeriodFormat.seconds=\ sekonda
+PeriodFormat.millisecond=\ milisekond\u00EB
+PeriodFormat.milliseconds=\ milisekonda
diff --git a/src/main/java/org/joda/time/format/messages_sv.properties b/src/main/java/org/joda/time/format/messages_sv.properties
new file mode 100644
index 00000000..ba6da1fe
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_sv.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=\
+PeriodFormat.comma=,
+PeriodFormat.commandand=,och
+PeriodFormat.commaspaceand=, och
+PeriodFormat.commaspace=,
+PeriodFormat.spaceandspace=\ och
+PeriodFormat.year=\ \u00e5r
+PeriodFormat.years=\ \u00e5r
+PeriodFormat.month=\ m\u00e5nad
+PeriodFormat.months=\ m\u00e5nader
+PeriodFormat.week=\ vecka
+PeriodFormat.weeks=\ veckor
+PeriodFormat.day=\ dag
+PeriodFormat.days=\ dagar
+PeriodFormat.hour=\ timme
+PeriodFormat.hours=\ timmar
+PeriodFormat.minute=\ minut
+PeriodFormat.minutes=\ minuter
+PeriodFormat.second=\ sekund
+PeriodFormat.seconds=\ sekunder
+PeriodFormat.millisecond=\ millisekund
+PeriodFormat.milliseconds=\ millisekunder
\ No newline at end of file
diff --git a/src/main/java/org/joda/time/format/messages_tr.properties b/src/main/java/org/joda/time/format/messages_tr.properties
index 36bd47a5..0fe8d456 100644
--- a/src/main/java/org/joda/time/format/messages_tr.properties
+++ b/src/main/java/org/joda/time/format/messages_tr.properties
@@ -1,7 +1,7 @@
PeriodFormat.space=\
PeriodFormat.comma=,
-PeriodFormat.commandand=,ve
-PeriodFormat.commaspaceand=, ve
+PeriodFormat.commandand=,ve
+PeriodFormat.commaspaceand=, ve
PeriodFormat.commaspace=,
PeriodFormat.spaceandspace=\ ve
PeriodFormat.year=\ y\u0131l
diff --git a/src/main/java/org/joda/time/format/messages_zh.properties b/src/main/java/org/joda/time/format/messages_zh.properties
new file mode 100644
index 00000000..5d31b7b3
--- /dev/null
+++ b/src/main/java/org/joda/time/format/messages_zh.properties
@@ -0,0 +1,22 @@
+PeriodFormat.space=
+PeriodFormat.comma=
+PeriodFormat.commandand=
+PeriodFormat.commaspaceand=
+PeriodFormat.commaspace=
+PeriodFormat.spaceandspace=
+PeriodFormat.year=\u5E74
+PeriodFormat.years=\u5E74
+PeriodFormat.month=\u4E2A\u6708
+PeriodFormat.months=\u4E2A\u6708
+PeriodFormat.week=\u5468
+PeriodFormat.weeks=\u5468
+PeriodFormat.day=\u5929
+PeriodFormat.days=\u5929
+PeriodFormat.hour=\u5C0F\u65F6
+PeriodFormat.hours=\u5C0F\u65F6
+PeriodFormat.minute=\u5206
+PeriodFormat.minutes=\u5206
+PeriodFormat.second=\u79D2
+PeriodFormat.seconds=\u79D2
+PeriodFormat.millisecond=\u6BEB\u79D2
+PeriodFormat.milliseconds=\u6BEB\u79D2
\ No newline at end of file
diff --git a/src/main/java/org/joda/time/tz/CachedDateTimeZone.java b/src/main/java/org/joda/time/tz/CachedDateTimeZone.java
index 5ffcd770..637093d1 100644
--- a/src/main/java/org/joda/time/tz/CachedDateTimeZone.java
+++ b/src/main/java/org/joda/time/tz/CachedDateTimeZone.java
@@ -95,34 +95,42 @@ public class CachedDateTimeZone extends DateTimeZone {
return iZone;
}
+ @Override
public String getNameKey(long instant) {
return getInfo(instant).getNameKey(instant);
}
+ @Override
public int getOffset(long instant) {
return getInfo(instant).getOffset(instant);
}
+ @Override
public int getStandardOffset(long instant) {
return getInfo(instant).getStandardOffset(instant);
}
+ @Override
public boolean isFixed() {
return iZone.isFixed();
}
+ @Override
public long nextTransition(long instant) {
return iZone.nextTransition(instant);
}
+ @Override
public long previousTransition(long instant) {
return iZone.previousTransition(instant);
}
+ @Override
public int hashCode() {
return iZone.hashCode();
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
diff --git a/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java b/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
index f88ed345..779289fc 100644
--- a/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
+++ b/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
@@ -28,6 +28,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Objects;
import java.util.Set;
import org.joda.time.Chronology;
@@ -639,6 +640,7 @@ public class DateTimeZoneBuilder {
return prev - offset;
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -655,7 +657,13 @@ public class DateTimeZoneBuilder {
}
return false;
}
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(new Object[] {iMode, iMonthOfYear, iDayOfMonth, iDayOfWeek, iAdvance, iMillisOfDay});
+ }
+ @Override
public String toString() {
return
"[OfYear]\n" +
@@ -788,6 +796,7 @@ public class DateTimeZoneBuilder {
return iSaveMillis;
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -802,6 +811,11 @@ public class DateTimeZoneBuilder {
return false;
}
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(new Object[] {iSaveMillis, iNameKey, iOfYear});
+ }
+
public void writeTo(DataOutput out) throws IOException {
iOfYear.writeTo(out);
out.writeUTF(iNameKey);
@@ -1219,22 +1233,27 @@ public class DateTimeZoneBuilder {
iEndRecurrence = endRecurrence;
}
+ @Override
public String getNameKey(long instant) {
return findMatchingRecurrence(instant).getNameKey();
}
+ @Override
public int getOffset(long instant) {
return iStandardOffset + findMatchingRecurrence(instant).getSaveMillis();
}
+ @Override
public int getStandardOffset(long instant) {
return iStandardOffset;
}
+ @Override
public boolean isFixed() {
return false;
}
+ @Override
public long nextTransition(long instant) {
int standardOffset = iStandardOffset;
Recurrence startRecurrence = iStartRecurrence;
@@ -1275,6 +1294,7 @@ public class DateTimeZoneBuilder {
return (start > end) ? end : start;
}
+ @Override
public long previousTransition(long instant) {
// Increment in order to handle the case where instant is exactly at
// a transition.
@@ -1319,6 +1339,7 @@ public class DateTimeZoneBuilder {
return ((start > end) ? start : end) - 1;
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -1334,6 +1355,11 @@ public class DateTimeZoneBuilder {
return false;
}
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(new Object[] {iStandardOffset, iStartRecurrence, iEndRecurrence});
+ }
+
public void writeTo(DataOutput out) throws IOException {
writeMillis(out, iStandardOffset);
iStartRecurrence.writeTo(out);
@@ -1487,7 +1513,7 @@ public class DateTimeZoneBuilder {
}
if (curOffset > nextOffset) {
nameKeys[i] = (curNameKey + "-Summer").intern();
- } else if (curOffset < nextOffset) {
+ } else {
nameKeys[i + 1] = (nextNameKey + "-Summer").intern();
i++;
}
@@ -1545,6 +1571,7 @@ public class DateTimeZoneBuilder {
iTailZone = tailZone;
}
+ @Override
public String getNameKey(long instant) {
long[] transitions = iTransitions;
int i = Arrays.binarySearch(transitions, instant);
@@ -1564,6 +1591,7 @@ public class DateTimeZoneBuilder {
return iTailZone.getNameKey(instant);
}
+ @Override
public int getOffset(long instant) {
long[] transitions = iTransitions;
int i = Arrays.binarySearch(transitions, instant);
@@ -1583,6 +1611,7 @@ public class DateTimeZoneBuilder {
return iTailZone.getOffset(instant);
}
+ @Override
public int getStandardOffset(long instant) {
long[] transitions = iTransitions;
int i = Arrays.binarySearch(transitions, instant);
@@ -1602,10 +1631,12 @@ public class DateTimeZoneBuilder {
return iTailZone.getStandardOffset(instant);
}
+ @Override
public boolean isFixed() {
return false;
}
+ @Override
public long nextTransition(long instant) {
long[] transitions = iTransitions;
int i = Arrays.binarySearch(transitions, instant);
@@ -1623,6 +1654,7 @@ public class DateTimeZoneBuilder {
return iTailZone.nextTransition(instant);
}
+ @Override
public long previousTransition(long instant) {
long[] transitions = iTransitions;
int i = Arrays.binarySearch(transitions, instant);
@@ -1655,6 +1687,7 @@ public class DateTimeZoneBuilder {
return instant;
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -1674,6 +1707,11 @@ public class DateTimeZoneBuilder {
return false;
}
+ @Override
+ public int hashCode() {
+ return getID().hashCode();
+ }
+
public void writeTo(DataOutput out) throws IOException {
int size = iTransitions.length;
diff --git a/src/main/java/org/joda/time/tz/FixedDateTimeZone.java b/src/main/java/org/joda/time/tz/FixedDateTimeZone.java
index 763008a1..4d980547 100644
--- a/src/main/java/org/joda/time/tz/FixedDateTimeZone.java
+++ b/src/main/java/org/joda/time/tz/FixedDateTimeZone.java
@@ -41,30 +41,37 @@ public final class FixedDateTimeZone extends DateTimeZone {
iStandardOffset = standardOffset;
}
+ @Override
public String getNameKey(long instant) {
return iNameKey;
}
+ @Override
public int getOffset(long instant) {
return iWallOffset;
}
+ @Override
public int getStandardOffset(long instant) {
return iStandardOffset;
}
+ @Override
public int getOffsetFromLocal(long instantLocal) {
return iWallOffset;
}
+ @Override
public boolean isFixed() {
return true;
}
+ @Override
public long nextTransition(long instant) {
return instant;
}
+ @Override
public long previousTransition(long instant) {
return instant;
}
@@ -73,6 +80,7 @@ public final class FixedDateTimeZone extends DateTimeZone {
* Override to return the correct timezone instance.
* @since 1.5
*/
+ @Override
public java.util.TimeZone toTimeZone() {
String id = getID();
if (id.length() == 6 && (id.startsWith("+") || id.startsWith("-"))) {
@@ -84,6 +92,7 @@ public final class FixedDateTimeZone extends DateTimeZone {
return new java.util.SimpleTimeZone(iWallOffset, getID());
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -98,6 +107,7 @@ public final class FixedDateTimeZone extends DateTimeZone {
return false;
}
+ @Override
public int hashCode() {
return getID().hashCode() + 37 * iStandardOffset + 31 * iWallOffset;
}
diff --git a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java
index f8f22880..fc66b5b8 100644
--- a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java
+++ b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java
@@ -88,23 +88,26 @@ public class ZoneInfoCompiler {
boolean verbose = false;
int i;
- for (i=0; i<args.length; i++) {
- try {
- if ("-src".equals(args[i])) {
- inputDir = new File(args[++i]);
- } else if ("-dst".equals(args[i])) {
- outputDir = new File(args[++i]);
- } else if ("-verbose".equals(args[i])) {
- verbose = true;
- } else if ("-?".equals(args[i])) {
+ for (i = 0; i < args.length; i++) {
+ if ("-src".equals(args[i])) {
+ if (++i >= args.length) {
+ printUsage();
+ return;
+ }
+ inputDir = new File(args[i]);
+ } else if ("-dst".equals(args[i])) {
+ if (++i >= args.length) {
printUsage();
return;
- } else {
- break;
}
- } catch (IndexOutOfBoundsException e) {
+ outputDir = new File(args[i]);
+ } else if ("-verbose".equals(args[i])) {
+ verbose = true;
+ } else if ("-?".equals(args[i])) {
printUsage();
return;
+ } else {
+ break;
}
}
@@ -165,7 +168,7 @@ public class ZoneInfoCompiler {
Short index = Short.valueOf(count);
idToIndex.put(id, index);
indexToId.put(index, id);
- if (++count == 0) {
+ if (++count == Short.MAX_VALUE) {
throw new InternalError("Too many time zone ids");
}
}
@@ -174,7 +177,7 @@ public class ZoneInfoCompiler {
Short index = Short.valueOf(count);
idToIndex.put(id, index);
indexToId.put(index, id);
- if (++count == 0) {
+ if (++count == Short.MAX_VALUE) {
throw new InternalError("Too many time zone ids");
}
}
@@ -659,10 +662,17 @@ public class ZoneInfoCompiler {
/**
* Adds a recurring savings rule to the builder.
+ *
+ * @param builder the builder
+ * @param nameKey the name key
+ * @param saveMillis the save in millis
+ * @param fromYear the from year
+ * @param toYear the to year
*/
public void addRecurring(DateTimeZoneBuilder builder, String nameKey,
- int saveMillis, int fromYear, int toYear)
- {
+ int saveMillis,
+ int fromYear,
+ int toYear) {
builder.addRecurringSavings(nameKey, saveMillis,
fromYear, toYear,
iZoneChar,
@@ -675,6 +685,9 @@ public class ZoneInfoCompiler {
/**
* Adds a cutover to the builder.
+ *
+ * @param builder the builder
+ * @param year the year
*/
public void addCutover(DateTimeZoneBuilder builder, int year) {
builder.addCutover(year,
@@ -686,6 +699,7 @@ public class ZoneInfoCompiler {
iMillisOfDay);
}
+ @Override
public String toString() {
return
"MonthOfYear: " + iMonthOfYear + "\n" +
@@ -735,6 +749,10 @@ public class ZoneInfoCompiler {
/**
* Adds a recurring savings rule to the builder.
+ *
+ * @param builder the builder
+ * @param negativeSave the negative save value
+ * @param nameFormat the name format
*/
public void addRecurring(DateTimeZoneBuilder builder, int negativeSave, String nameFormat) {
int saveMillis = iSaveMillis + -negativeSave;
@@ -767,6 +785,7 @@ public class ZoneInfoCompiler {
return name.intern();
}
+ @Override
public String toString() {
return
"[Rule]\n" +
@@ -797,6 +816,10 @@ public class ZoneInfoCompiler {
/**
* Adds recurring savings rules to the builder.
+ *
+ * @param builder the builder
+ * @param standardMillis the standard millis
+ * @param nameFormat the name format
*/
public void addRecurring(DateTimeZoneBuilder builder, int standardMillis, String nameFormat) {
// a hack is necessary to remove negative SAVE values from the input tzdb file
@@ -889,15 +912,15 @@ public class ZoneInfoCompiler {
/**
* Adds zone info to the builder.
+ *
+ * @param builder the builder
+ * @param ruleSets the rule sets
*/
public void addToBuilder(DateTimeZoneBuilder builder, Map<String, RuleSet> ruleSets) {
addToBuilder(this, builder, ruleSets);
}
- private static void addToBuilder(Zone zone,
- DateTimeZoneBuilder builder,
- Map<String, RuleSet> ruleSets)
- {
+ private static void addToBuilder(Zone zone, DateTimeZoneBuilder builder, Map<String, RuleSet> ruleSets) {
for (; zone != null; zone = zone.iNext) {
if (zone.iRules == null) {
builder.setStandardOffset(zone.iOffsetMillis);
@@ -928,6 +951,7 @@ public class ZoneInfoCompiler {
}
}
+ @Override
public String toString() {
String str =
"[Zone]\n" +
diff --git a/src/main/java/org/joda/time/tz/ZoneInfoLogger.java b/src/main/java/org/joda/time/tz/ZoneInfoLogger.java
index 1e9c46fe..7234dd52 100644
--- a/src/main/java/org/joda/time/tz/ZoneInfoLogger.java
+++ b/src/main/java/org/joda/time/tz/ZoneInfoLogger.java
@@ -21,6 +21,7 @@ package org.joda.time.tz;
public class ZoneInfoLogger {
static ThreadLocal<Boolean> cVerbose = new ThreadLocal<Boolean>() {
+ @Override
protected Boolean initialValue() {
return Boolean.FALSE;
}
diff --git a/src/main/java/org/joda/time/tz/src/africa b/src/main/java/org/joda/time/tz/src/africa
index 7155a236..58b813a8 100644
--- a/src/main/java/org/joda/time/tz/src/africa
+++ b/src/main/java/org/joda/time/tz/src/africa
@@ -178,7 +178,15 @@ Zone Africa/Lubumbashi 1:49:52 - LMT 1897 Nov 9
Zone Africa/Brazzaville 1:01:08 - LMT 1912
1:00 - WAT
-# Côte d'Ivoire / Ivory Coast
+# Côte d'Ivoire (Ivory Coast)
+
+# The other parts of the St Helena territory are similar:
+# Tristan da Cunha: on GMT, say Whitman and the CIA
+# Ascension: on GMT, say the USNO (1995-12-21) and the CIA
+# Gough (scientific station since 1955; sealers wintered previously):
+# on GMT, says the CIA
+# Inaccessible, Nightingale: uninhabited
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Abidjan -0:16:08 - LMT 1912
0:00 - GMT
@@ -188,12 +196,13 @@ Zone Africa/Abidjan -0:16:08 - LMT 1912
Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
3:00 - EAT
+
###############################################################################
# Egypt
# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
-# observatory; round to nearest. Milne also says that the official time for
+# observatory. Milne also says that the official time for
# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
# did not apply to Cairo, Alexandria, or Port Said.
@@ -367,6 +376,14 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# From Mina Samuel (2016-07-04):
# Egyptian government took the decision to cancel the DST,
+# From Ahmad ElDardiry (2023-03-01):
+# Egypt officially announced today that daylight savings will be
+# applied from last Friday of April to last Thursday of October.
+# From Paul Eggert (2023-03-01):
+# Assume transitions are at 00:00 and 24:00 respectively.
+# From Amir Adib (2023-03-07):
+# https://www.facebook.com/EgyptianCabinet/posts/638829614954129/
+
Rule Egypt 2008 only - Aug lastThu 24:00 0 -
Rule Egypt 2009 only - Aug 20 24:00 0 -
Rule Egypt 2010 only - Aug 10 24:00 0 -
@@ -376,8 +393,11 @@ Rule Egypt 2014 only - May 15 24:00 1:00 S
Rule Egypt 2014 only - Jun 26 24:00 0 -
Rule Egypt 2014 only - Jul 31 24:00 1:00 S
Rule Egypt 2014 only - Sep lastThu 24:00 0 -
+Rule Egypt 2023 max - Apr lastFri 0:00 1:00 S
+Rule Egypt 2023 max - Oct lastThu 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF 2:05:08.9
Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
2:00 Egypt EE%sT
@@ -400,13 +420,6 @@ Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar
2:00 - SAST
# Ethiopia
-#
-# Unfortunately tzdb records only Western clock time in use in Ethiopia,
-# as the tzdb format is not up to properly recording a common Ethiopian
-# timekeeping practice that is based on solar time. See:
-# Mortada D. If you have a meeting in Ethiopia, you'd better double
-# check the time. PRI's The World. 2015-01-30 15:15 -05.
-# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Addis_Ababa 2:34:48 - LMT 1870
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
@@ -469,7 +482,7 @@ Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u
# At midnight on 30 June 1928 the clocks throughout Kenya was put forward
# half an hour by the Alteration of Time Ordinance, 1928.
# https://gazettes.africa/archive/ke/1928/ke-government-gazette-dated-1928-05-11-no-28.pdf
-# [Ordinance No. 11 of 1928, The Offical Gazette, 1928-06-26, p 813]
+# [Ordinance No. 11 of 1928, The Official Gazette, 1928-06-26, p 813]
# https://books.google.com/books?id=2S0S6os32ZUC&pg=PA813
#
# The 1928 ordinance was repealed by the Alteration of Time (repeal) Ordinance,
@@ -501,6 +514,14 @@ Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u
# The 1908-05-01 announcement does not give an effective date,
# so just say "1908 May".
+# From Paul Eggert (2018-09-11):
+# Unfortunately tzdb records only Western clock time in use in Ethiopia,
+# as the tzdb format is not up to properly recording a common Ethiopian
+# timekeeping practice that is based on solar time. See:
+# Mortada D. If you have a meeting in Ethiopia, you'd better double
+# check the time. PRI's The World. 2015-01-30 15:15 -05.
+# https://www.pri.org/stories/2015-01-30/if-you-have-meeting-ethiopia-you-better-double-check-time
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Africa/Nairobi 2:27:16 - LMT 1908 May
2:30 - +0230 1928 Jun 30 24:00
@@ -529,7 +550,7 @@ Zone Africa/Maseru 1:50:00 - LMT 1903 Mar
# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972.
# Monrovia: Executive Mansion.
#
-# Use the abbreviation "MMT" before 1972, as the more-accurate numeric
+# Use the abbreviation "MMT" before 1972, as the more accurate numeric
# abbreviation "-004430" would be one byte over the POSIX limit.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -615,6 +636,7 @@ Zone Africa/Bamako -0:32:00 - LMT 1912
0:00 - GMT 1934 Feb 26
-1:00 - -01 1960 Jun 20
0:00 - GMT
+#PACKRATLIST zone.tab Link Africa/Bamako Africa/Timbuktu
# Mauritania
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -694,8 +716,8 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# DST the coming summer...
#
# Some sources, in French:
-# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB
-# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
+# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-«-L%E2%80%99heure-d%E2%80%99été-ne-sera-pas-appliquée-cette-année-»
+# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-économie-d-énergie-de-l-heure-d-été-ont-été-atteints-
#
# Our wrap-up:
# https://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
@@ -716,13 +738,16 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# Agalega Is, Rodriguez
# no information; probably like Indian/Mauritius
+
+# Morocco
+# See Africa/Ceuta for Spanish Morocco.
+
# Mayotte
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
3:00 - EAT
# Morocco
-# See Africa/Ceuta for Spanish Morocco.
# From Alex Krivenyshev (2008-05-09):
# Here is an article that Morocco plan to introduce Daylight Saving Time between
@@ -830,7 +855,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# More articles in the press
# https://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
-# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT+1-a-partir-de-dim
# From Petr Machata (2011-03-30):
# They have it written in English here:
@@ -845,7 +870,7 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# According to Infomédiaire web site from Morocco (infomediaire.ma),
# on March 9, 2012, (in French) Heure légale:
# Le Maroc adopte officiellement l'heure d'été
-# http://www.infomediaire.ma/news/maroc/heure-l%C3%A9gale-le-maroc-adopte-officiellement-lheure-d%C3%A9t%C3%A9
+# http://www.infomediaire.ma/news/maroc/heure-légale-le-maroc-adopte-officiellement-lheure-dété
# Governing Council adopted draft decree, that Morocco DST starts on
# the last Sunday of March (March 25, 2012) and ends on
# last Sunday of September (September 30, 2012)
@@ -969,19 +994,28 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# Friday or Saturday (and so the 2 days off are on a weekend), the next time
# shift will be the next weekend.
#
-# From Paul Eggert (2020-05-31):
+# From Milamber (2021-03-31, 2022-03-10):
+# https://www.mmsp.gov.ma/fr/actualites.aspx?id=2076
+# https://www.ecoactu.ma/horaires-administration-ramadan-gmtheure-gmt-a-partir-de-dimanche-27-mars/
+#
+# From Milamber (2023-03-14, 2023-03-15):
+# The return to legal GMT time will take place this Sunday, March 19 at 3 a.m.
+# ... the return to GMT+1 will be made on Sunday April 23, 2023 at 2 a.m.
+# https://www.mmsp.gov.ma/fr/actualites/passage-à-l%E2%80%99heure-gmt-à-partir-du-dimanche-19-mars-2023
+#
+# From Paul Eggert (2023-03-14):
# For now, guess that in the future Morocco will fall back at 03:00
# the last Sunday before Ramadan, and spring forward at 02:00 the
-# first Sunday after two days after Ramadan. To implement this,
+# first Sunday after one day after Ramadan. To implement this,
# transition dates and times for 2019 through 2087 were determined by
-# running the following program under GNU Emacs 26.3. (This algorithm
+# running the following program under GNU Emacs 28.2. (This algorithm
# also produces the correct transition dates for 2016 through 2018,
# though the times differ due to Morocco's time zone change in 2018.)
# (let ((islamic-year 1440))
# (require 'cal-islam)
# (while (< islamic-year 1511)
# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-# (b (+ 2 (calendar-islamic-to-absolute (list 10 1 islamic-year))))
+# (b (+ 1 (calendar-islamic-to-absolute (list 10 1 islamic-year))))
# (sunday 0))
# (while (/= sunday (mod (setq a (1- a)) 7)))
# (while (/= sunday (mod b 7))
@@ -995,10 +1029,6 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
-#
-# From Milamber (2021-03-31, 2022-03-10), confirming these predictions:
-# https://www.mmsp.gov.ma/fr/actualites.aspx?id=2076
-# https://www.ecoactu.ma/horaires-administration-ramadan-gmtheure-gmt-a-partir-de-dimanche-27-mars/
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 -
@@ -1051,7 +1081,7 @@ Rule Morocco 2021 only - May 16 2:00 0 -
Rule Morocco 2022 only - Mar 27 3:00 -1:00 -
Rule Morocco 2022 only - May 8 2:00 0 -
Rule Morocco 2023 only - Mar 19 3:00 -1:00 -
-Rule Morocco 2023 only - Apr 30 2:00 0 -
+Rule Morocco 2023 only - Apr 23 2:00 0 -
Rule Morocco 2024 only - Mar 10 3:00 -1:00 -
Rule Morocco 2024 only - Apr 14 2:00 0 -
Rule Morocco 2025 only - Feb 23 3:00 -1:00 -
@@ -1067,7 +1097,7 @@ Rule Morocco 2029 only - Feb 18 2:00 0 -
Rule Morocco 2029 only - Dec 30 3:00 -1:00 -
Rule Morocco 2030 only - Feb 10 2:00 0 -
Rule Morocco 2030 only - Dec 22 3:00 -1:00 -
-Rule Morocco 2031 only - Feb 2 2:00 0 -
+Rule Morocco 2031 only - Jan 26 2:00 0 -
Rule Morocco 2031 only - Dec 14 3:00 -1:00 -
Rule Morocco 2032 only - Jan 18 2:00 0 -
Rule Morocco 2032 only - Nov 28 3:00 -1:00 -
@@ -1083,7 +1113,7 @@ Rule Morocco 2036 only - Nov 23 2:00 0 -
Rule Morocco 2037 only - Oct 4 3:00 -1:00 -
Rule Morocco 2037 only - Nov 15 2:00 0 -
Rule Morocco 2038 only - Sep 26 3:00 -1:00 -
-Rule Morocco 2038 only - Nov 7 2:00 0 -
+Rule Morocco 2038 only - Oct 31 2:00 0 -
Rule Morocco 2039 only - Sep 18 3:00 -1:00 -
Rule Morocco 2039 only - Oct 23 2:00 0 -
Rule Morocco 2040 only - Sep 2 3:00 -1:00 -
@@ -1099,7 +1129,7 @@ Rule Morocco 2044 only - Aug 28 2:00 0 -
Rule Morocco 2045 only - Jul 9 3:00 -1:00 -
Rule Morocco 2045 only - Aug 20 2:00 0 -
Rule Morocco 2046 only - Jul 1 3:00 -1:00 -
-Rule Morocco 2046 only - Aug 12 2:00 0 -
+Rule Morocco 2046 only - Aug 5 2:00 0 -
Rule Morocco 2047 only - Jun 23 3:00 -1:00 -
Rule Morocco 2047 only - Jul 28 2:00 0 -
Rule Morocco 2048 only - Jun 7 3:00 -1:00 -
@@ -1115,7 +1145,7 @@ Rule Morocco 2052 only - Jun 2 2:00 0 -
Rule Morocco 2053 only - Apr 13 3:00 -1:00 -
Rule Morocco 2053 only - May 25 2:00 0 -
Rule Morocco 2054 only - Apr 5 3:00 -1:00 -
-Rule Morocco 2054 only - May 17 2:00 0 -
+Rule Morocco 2054 only - May 10 2:00 0 -
Rule Morocco 2055 only - Mar 28 3:00 -1:00 -
Rule Morocco 2055 only - May 2 2:00 0 -
Rule Morocco 2056 only - Mar 12 3:00 -1:00 -
@@ -1131,7 +1161,7 @@ Rule Morocco 2060 only - Mar 7 2:00 0 -
Rule Morocco 2061 only - Jan 16 3:00 -1:00 -
Rule Morocco 2061 only - Feb 27 2:00 0 -
Rule Morocco 2062 only - Jan 8 3:00 -1:00 -
-Rule Morocco 2062 only - Feb 19 2:00 0 -
+Rule Morocco 2062 only - Feb 12 2:00 0 -
Rule Morocco 2062 only - Dec 31 3:00 -1:00 -
Rule Morocco 2063 only - Feb 4 2:00 0 -
Rule Morocco 2063 only - Dec 16 3:00 -1:00 -
@@ -1147,7 +1177,7 @@ Rule Morocco 2067 only - Dec 11 2:00 0 -
Rule Morocco 2068 only - Oct 21 3:00 -1:00 -
Rule Morocco 2068 only - Dec 2 2:00 0 -
Rule Morocco 2069 only - Oct 13 3:00 -1:00 -
-Rule Morocco 2069 only - Nov 24 2:00 0 -
+Rule Morocco 2069 only - Nov 17 2:00 0 -
Rule Morocco 2070 only - Oct 5 3:00 -1:00 -
Rule Morocco 2070 only - Nov 9 2:00 0 -
Rule Morocco 2071 only - Sep 20 3:00 -1:00 -
@@ -1163,7 +1193,7 @@ Rule Morocco 2075 only - Sep 15 2:00 0 -
Rule Morocco 2076 only - Jul 26 3:00 -1:00 -
Rule Morocco 2076 only - Sep 6 2:00 0 -
Rule Morocco 2077 only - Jul 18 3:00 -1:00 -
-Rule Morocco 2077 only - Aug 29 2:00 0 -
+Rule Morocco 2077 only - Aug 22 2:00 0 -
Rule Morocco 2078 only - Jul 10 3:00 -1:00 -
Rule Morocco 2078 only - Aug 14 2:00 0 -
Rule Morocco 2079 only - Jun 25 3:00 -1:00 -
@@ -1173,13 +1203,13 @@ Rule Morocco 2080 only - Jul 21 2:00 0 -
Rule Morocco 2081 only - Jun 1 3:00 -1:00 -
Rule Morocco 2081 only - Jul 13 2:00 0 -
Rule Morocco 2082 only - May 24 3:00 -1:00 -
-Rule Morocco 2082 only - Jul 5 2:00 0 -
+Rule Morocco 2082 only - Jun 28 2:00 0 -
Rule Morocco 2083 only - May 16 3:00 -1:00 -
Rule Morocco 2083 only - Jun 20 2:00 0 -
Rule Morocco 2084 only - Apr 30 3:00 -1:00 -
Rule Morocco 2084 only - Jun 11 2:00 0 -
Rule Morocco 2085 only - Apr 22 3:00 -1:00 -
-Rule Morocco 2085 only - Jun 3 2:00 0 -
+Rule Morocco 2085 only - May 27 2:00 0 -
Rule Morocco 2086 only - Apr 14 3:00 -1:00 -
Rule Morocco 2086 only - May 19 2:00 0 -
Rule Morocco 2087 only - Mar 30 3:00 -1:00 -
@@ -1223,7 +1253,6 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún
Zone Africa/Maputo 2:10:20 - LMT 1903 Mar
2:00 - CAT
-
# Namibia
# From Arthur David Olson (2017-08-09):
@@ -1313,15 +1342,15 @@ Zone Africa/Niamey 0:08:28 - LMT 1912
# From P Chan (2020-12-03):
# GMT was adopted as the standard time of Lagos on 1905-07-01.
# Lagos Weekly Record, 1905-06-24, p 3
-# http://ddsnext.crl.edu/titles/31558#?c=0&m=668&s=0&cv=2&r=0&xywh=1446%2C5221%2C1931%2C1235
+# http://ddsnext.crl.edu/titles/31558#?c=0&m=668&s=0&cv=2&r=0&xywh=1446,5221,1931,1235
# says "It is officially notified that on and after the 1st of July 1905
-# Greenwich Mean Solar Time will be adopted thought the Colony and
+# Greenwich Mean Solar Time will be adopted throughout the Colony and
# Protectorate, and that it will be necessary to put all clocks 13 minutes and
# 35 seconds back, recording local mean time."
#
# It seemed that Lagos returned to LMT on 1908-07-01.
# [The Lagos Standard], 1908-07-01, p 5
-# http://ddsnext.crl.edu/titles/31556#?c=0&m=78&s=0&cv=4&r=0&xywh=-92%2C3590%2C3944%2C2523
+# http://ddsnext.crl.edu/titles/31556#?c=0&m=78&s=0&cv=4&r=0&xywh=-92,3590,3944,2523
# says "Scarcely have the people become accustomed to this new time, when
# another official notice has now appeared announcing that from and after the
# 1st July next, return will be made to local mean time."
@@ -1333,7 +1362,7 @@ Zone Africa/Niamey 0:08:28 - LMT 1912
# https://libsysdigi.library.illinois.edu/ilharvest/Africana/Books2011-05/3064634/3064634_1914/3064634_1914_opt.pdf#page=27
# "On January 1st [1914], a universal standard time for Nigeria was adopted,
# viz., half an hour fast on Greenwich mean time, corresponding to the meridian
-# 7 [degrees] 30' E. long."
+# 7° 30' E. long."
# Lloyd's Register of Shipping (1915) says "Hitherto the time observed in Lagos
# was the local mean time. On 1st January, 1914, standard time for the whole of
# Nigeria was introduced ... Lagos time has been advanced about 16 minutes
@@ -1351,7 +1380,7 @@ Zone Africa/Niamey 0:08:28 - LMT 1912
# The Lagos Weekly Record, 1919-09-20, p 3 details discussion on the first
# reading of this Bill by the Legislative Council of the Colony of Nigeria on
# Thursday 1919-08-28:
-# http://ddsnext.crl.edu/titles/31558?terms&item_id=303484#?m=1118&c=1&s=0&cv=2&r=0&xywh=1261%2C3408%2C2994%2C1915
+# http://ddsnext.crl.edu/titles/31558?terms&item_id=303484#?m=1118&c=1&s=0&cv=2&r=0&xywh=1261,3408,2994,1915
# "The proposal is that the Globe should be divided into twelve zones East and
# West of Greenwich, of one hour each, Nigeria falling into the zone with a
# standard of one hour fast on Greenwich Mean Time. Nigeria standard time is
@@ -1402,13 +1431,6 @@ Zone Atlantic/St_Helena -0:22:48 - LMT 1890 # Jamestown
-0:22:48 - JMT 1951 # Jamestown Mean Time
0:00 - GMT
-# The other parts of the St Helena territory are similar:
-# Tristan da Cunha: on GMT, say Whitman and the CIA
-# Ascension: on GMT, say the USNO (1995-12-21) and the CIA
-# Gough (scientific station since 1955; sealers wintered previously):
-# on GMT, says the CIA
-# Inaccessible, Nightingale: uninhabited
-
# São Tomé and Príncipe
# See Europe/Lisbon for info about the 1912 transition.
@@ -1427,9 +1449,10 @@ Zone Atlantic/St_Helena -0:22:48 - LMT 1890 # Jamestown
# From Michael Deckers (2018-12-30):
# https://www.legis-palop.org/download.jsp?idFile=102818
# ... [The legal time of the country, which coincides with universal
-# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.]
+# coordinated time, will be reinstituted at 2 o'clock on day 1 of January, 2019.]
Zone Africa/Sao_Tome 0:26:56 - LMT 1884
+ #STDOFF -0:36:44.68
-0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT
0:00 - GMT 2018 Jan 1 01:00
1:00 - WAT 2019 Jan 1 02:00
@@ -1442,19 +1465,6 @@ Zone Africa/Dakar -1:09:44 - LMT 1912
0:00 - GMT
# Seychelles
-
-# From P Chan (2020-11-27):
-# Standard Time was adopted on 1907-01-01.
-#
-# Standard Time Ordinance (Chapter 237)
-# The Laws of Seychelles in Force on the 31st December, 1971, Vol. 6, p 571
-# https://books.google.com/books?id=efE-AQAAIAAJ&pg=PA571
-#
-# From Tim Parenti (2020-12-05):
-# A footnote on https://books.google.com/books?id=DYdDAQAAMAAJ&pg=PA1689
-# confirms that Ordinance No. 9 of 1906 "was brought into force on the 1st
-# January, 1907."
-
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Mahe 3:41:48 - LMT 1907 Jan 1 # Victoria
4:00 - +04
@@ -1477,7 +1487,7 @@ Zone Africa/Freetown -0:53:00 - LMT 1882
-0:53:00 - FMT 1913 Jul 1 # Freetown MT
-1:00 SL %s 1939 Sep 5
-1:00 - -01 1941 Dec 6 24:00
- 0:00 SL GMT/+01
+ 0:00 - GMT
# Somalia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
diff --git a/src/main/java/org/joda/time/tz/src/antarctica b/src/main/java/org/joda/time/tz/src/antarctica
index fd8fb8b1..3b9af240 100644
--- a/src/main/java/org/joda/time/tz/src/antarctica
+++ b/src/main/java/org/joda/time/tz/src/antarctica
@@ -157,9 +157,11 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
# St Paul Island - near Amsterdam, uninhabited
# fishing stations operated variously 1819/1931
#
+# Kerguelen
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
5:00 - +05
+
#
# year-round base in the main continent
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
@@ -251,29 +253,7 @@ Zone Antarctica/Troll 0 - -00 2005 Feb 12
# year-round from 1960/61 to 1992
# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
-# From Craig Mundell (1994-12-15):
-# http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP
-# Vostok, which is one of the Russian stations, is set on the same
-# time as Moscow, Russia.
-#
-# From Lee Hotz (2001-03-08):
-# I queried the folks at Columbia who spent the summer at Vostok and this is
-# what they had to say about time there:
-# "in the US Camp (East Camp) we have been on New Zealand (McMurdo)
-# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
-# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
-# of GMT). This is a time zone I think two hours east of Moscow. The
-# natural time zone is in between the two: 8 hours ahead of GMT."
-#
-# From Paul Eggert (2001-05-04):
-# This seems to be hopelessly confusing, so I asked Lee Hotz about it
-# in person. He said that some Antarctic locations set their local
-# time so that noon is the warmest part of the day, and that this
-# changes during the year and does not necessarily correspond to mean
-# solar noon. So the Vostok time might have been whatever the clocks
-# happened to be during their visit. So we still don't really know what time
-# it is at Vostok. But we'll guess +06.
-#
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/Vostok 0 - -00 1957 Dec 16
6:00 - +06
@@ -327,7 +307,7 @@ Zone Antarctica/Rothera 0 - -00 1976 Dec 1
# but that he found it more convenient to keep GMT+12
# as supplies for the station were coming from McMurdo Sound,
# which was on GMT+12 because New Zealand was on GMT+12 all year
-# at that time (1957). (Source: Siple's book 90 Degrees South.)
+# at that time (1957). (Source: Siple's book 90° South.)
#
# From Susan Smith
# http://www.cybertours.com/whs/pole10.html
@@ -341,4 +321,4 @@ Zone Antarctica/Rothera 0 - -00 1976 Dec 1
# we have to go around and set them back 5 minutes or so.
# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
#
-# See 'australasia' for Antarctica/McMurdo.
+# See Pacific/Auckland.
diff --git a/src/main/java/org/joda/time/tz/src/asia b/src/main/java/org/joda/time/tz/src/asia
index 6b7132fe..ed13787e 100644
--- a/src/main/java/org/joda/time/tz/src/asia
+++ b/src/main/java/org/joda/time/tz/src/asia
@@ -264,7 +264,7 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
7:30 - +0730 1933
8:00 - +08
-# Burma / Myanmar
+# Myanmar (Burma)
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
@@ -290,7 +290,6 @@ Zone Asia/Phnom_Penh 6:59:40 - LMT 1906 Jul 1
9:00 - +09 1945 Sep 2
7:00 - +07
-
# China
# From Phake Nick (2020-04-15):
@@ -354,12 +353,9 @@ Rule Shang 1919 only - Sep 30 24:00 0 S
# in the city at the time for people who use different time standard to adjust
# their clock to their preferred time.
#
-# a. For the 1940 May 31 spring forward, the essay claim that it was
-# coordinared between the international settlement authority and the French
-# concession authority and have gathered support from Hong Kong and Xiamen,
-# that it would spring forward an hour from May 31 "midnight", and the essay
-# claim "Hong Kong government implemented the spring forward in the same time
-# on the same date as Shanghai".
+# a. For the 1940 May 31 spring forward, the essay [says] ... "Hong
+# Kong government implemented the spring forward in the same time on
+# the same date as Shanghai".
#
# b. For the 1940 fall back, it was said that they initially intended to do
# so on September 30 00:59 at night, however they postponed it to October 12
@@ -555,7 +551,7 @@ Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D
# Zhongyuan Time ("Central plain Time") UT +08
# Now part of Asia/Shanghai.
# most of China
-# Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
+# Milne gives 8:05:43.2 for Xujiahui Observatory time....
# Guo says Shanghai switched to UT +08 "from the end of the 19th century".
#
# Long-shu Time (probably as Long and Shu were two names of the area) UT +07
@@ -674,18 +670,19 @@ Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Beijing time, used throughout China; represented by Shanghai.
+ #STDOFF 8:05:43.2
Zone Asia/Shanghai 8:05:43 - LMT 1901
8:00 Shang C%sT 1949 May 28
8:00 PRC C%sT
# Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
# / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.)
+# Vostok base in Antarctica matches this since 1970.
Zone Asia/Urumqi 5:50:20 - LMT 1928
6:00 - +06
-
# Hong Kong
-# Milne gives 7:36:41.7; round this.
+# Milne gives 7:36:41.7.
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong
@@ -869,7 +866,8 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May 13 3:30 1:00 S
Rule HK 1979 only - Oct 21 3:30 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42
+ #STDOFF 7:36:41.7
+Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 29 17:00u
8:00 - HKT 1941 Jun 15 3:00
8:00 1:00 HKST 1941 Oct 1 4:00
8:00 0:30 HKWT 1941 Dec 25
@@ -1184,10 +1182,6 @@ Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
3:00 - +03 2017 Oct 29 1:00u
2:00 EUAsia EE%sT
-# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
-# However, for various reasons many users expect to find it under Europe.
-Link Asia/Nicosia Europe/Nicosia
-
# Georgia
# From Paul Eggert (1994-11-19):
# Today's _Economist_ (p 60) reports that Georgia moved its clocks forward
@@ -1344,7 +1338,7 @@ Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata
#
# From Paul Eggert (2014-09-06):
# The 1876 Report of the Secretary of the [US] Navy, p 306 says that Batavia
-# civil time was 7:07:12.5; round to even for Jakarta.
+# civil time was 7:07:12.5.
#
# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
# http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime
@@ -1380,10 +1374,11 @@ Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Java, Sumatra
+ #STDOFF 7:07:12.5
Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10
# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
# but this must be a typo.
- 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia
+ 7:07:12 - BMT 1923 Dec 31 16:40u # Batavia
7:20 - +0720 1932 Nov
7:30 - +0730 1942 Mar 23
9:00 - +09 1945 Sep 23
@@ -1415,6 +1410,111 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# Iran
+# From Roozbeh Pournader (2022-05-30):
+# Here's an order from the Cabinet to the rest of the government to switch to
+# Tehran time, which is mentioned to be already at +03:30:
+# https://qavanin.ir/Law/TreeText/180138
+# Just in case that goes away, I also saved a copy at archive.org:
+# https://web.archive.org/web/20220530111940/https://qavanin.ir/Law/TreeText/180138
+# Here's my translation:
+#
+# "Circular on Matching the Hours of Governmental and Official Circles
+# in Provinces
+# Approved 1314/03/22 [=1935-06-13]
+# According to the ruling of the Honorable Cabinet, it is ordered that from
+# now on in all internal provinces of the country, governmental and official
+# circles set their time to match Tehran time (three hours and half before
+# Greenwich)....
+#
+# I still haven't found out when Tehran itself switched to +03:30....
+#
+# From Paul Eggert (2022-06-05):
+# Although the above says Tehran was at +03:30 before 1935-06-13, we don't
+# know when it switched to +03:30. For now, use 1935-06-13 as the switch date.
+# Although most likely wrong, we have no better info.
+
+# From Roozbeh Pournader (2022-06-01):
+# This is from Kayhan newspaper, one of the major Iranian newspapers, from
+# March 20, 1978, page 2:
+#
+# "Pull the clocks 60 minutes forward
+# As we informed before, from the fourth day of the month Farvardin of the
+# new year [=1978-03-24], clocks will be pulled forward, and people's daily
+# work and life program will start one hour earlier than the current program.
+# On the 1st day of the month Farvardin of this year [=1977-03-21], they had
+# pulled the clocks forward by one hour, but in the month of Mehr
+# [=1977-09-23], the clocks were pulled back by 30 minutes.
+# In this way, from the 4th day of the month Farvardin, clocks will be ahead
+# of the previous years by one hour and a half.
+# According to the new program, during the night of 4th of Farvardin, when
+# the midnight, meaning 24 o'clock is announced, the hands of the clock must
+# be pulled forward by one hour and thus consider midnight 1 o'clock in the
+# forenoon."
+#
+# This implies that in September 1977, when the daylight savings time was
+# done with, Iran didn't go back to +03:30, but immediately to +04:00.
+#
+#
+# This is from the major Iranian newspaper Ettela'at, dated [1978-08-03]...,
+# page 32. It looks like they decided to get the clocks back to +4:00
+# just in time for Ramadan that year:
+#
+# "Tomorrow Night, Pull the Clocks Back by One Hour
+# At 1 o'clock in the forenoon of Saturday 14 Mordad [=1978-08-05], the
+# clocks will be pulled one hour back and instead of 1 o'clock in the
+# forenoon, Radio Iran will announce 24 o'clock.
+# This decision was made in the Cabinet of Ministers meeting of 25 Tir
+# [=1978-07-16], [...]
+# At the beginning of the year 2537 [=March 1978: Iran was using a different
+# year number for a few years then, based on the Coronation of Cyrus the
+# Great], the country's official time was pulled forward by one hour and now
+# the official time is one hour and a half ahead compared to last year,
+# because in Farvardin of last year [=March 1977], the official time was
+# pulled forward one hour and this continued until the second half of last
+# year [=September 1977] until in the second half of last year the official
+# time was pulled back half an hour and that half hour still remains."
+#
+# This matches the time of the true noon published in the newspapers, as they
+# clearly go from +05:00 to +04:00 after that date (which happened during a
+# long weekend in Iran).
+
+# From Roozbeh Pournader (2022-05-31):
+# [Movahedi S. Cultural preconceptions of time: Can we use operational time
+# to meddle in God's Time? Comp Stud Soc Hist. 1985;27(3):385-400]
+# https://www.jstor.org/stable/178704
+# Here's the quotes from the paper:
+# 1. '"Iran's official time keeper moved the clock one hour forward as from
+# March 22, 1977 (Farvardin 2, 2536) to make maximum use of daylight and save
+# in energy consumption. Thus Iran joined such other countries as Britain in
+# observing what is known as 'daylight saving.' The proposal was originally
+# put forward by the Ministry of Energy, in no way having any influence on
+# observing religious ceremonies. Moving time one hour forward in summer
+# means that at 11:00 o'clock on March 21, the official time was set as
+# midnight March 22. Then September 24 will actually begin one hour later
+# than the end of September 23 [...]." Iran's time base thus continued to be
+# Greenwich Mean Time plus three and one-half hours (plus four and one-half
+# hours in summer).'
+#
+# The article sources this from Iran Almanac and Book of Facts, 1977, Tehran:
+# Echo of Iran, which is on Google Books at
+# https://www.google.com/books/edition/Iran_Almanac_and_Book_of_Facts/9ybVAAAAMAAJ.
+# (I confirmed it by searching for snippets.)
+#
+# 2. "After the fall of the shah, the revolutionary government returned to
+# daylight-saving time (DST) on 26 May 1979."
+#
+# This seems to have been announced just one day in advance, on 25 May 1979.
+#
+# The change in 1977 clearly seems to be the first daylight savings effort in
+# Iran. But the article doesn't mention what happened in 1978 (which was
+# still during the shah's government), or how things continued in 1979
+# onwards (which was during the Islamic Republic).
+
+# From Francis Santoni (2022-06-01):
+# for Iran and 1977 the effective change is only 20 October
+# (UIT No. 143 17.XI.1977) and not 23 September (UIT No. 141 13.IX.1977).
+# UIT is the Operational Bulletin of International Telecommunication Union.
+
# From Roozbeh Pournader (2003-03-15):
# This is an English translation of what I just found (originally in Persian).
# The Gregorian dates in brackets are mine:
@@ -1449,65 +1549,12 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# leap year calculation involved. There has never been any serious
# plan to change that law....
#
-# From Paul Eggert (2018-11-30):
-# Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter.
-# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran"
-# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's
-# cal-persia implementation of Birashk's approximation, which in the
-# 2008-2087 range disagrees with the astronomical Persian calendar
-# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), so
-# the following code special-cases those years. See Table 15.1, page 264, of:
-# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations:
-# The Ultimate Edition, Cambridge University Press (2018).
-# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition
-# Page 258, footnote 2, of this book says there is some dispute over what will
-# happen in 2091 (and some other years after that), so this code
-# stops in 2087, as 2088 and 2089 agree with the "max" rule below.
-# (cl-loop
-# initially (require 'cal-persia)
-# with first-persian-year = 1387
-# with last-persian-year = 1466
-# ;; Exceptional years in the above range,
-# ;; from Reingold & Dershowitz Table 15.1, page 264:
-# with exceptional-persian-years = '(1404 1437)
-# with range-start = nil
-# for persian-year from first-persian-year to last-persian-year
-# do
-# (let*
-# ((exceptional-year-offset
-# (if (member persian-year exceptional-persian-years) 1 0))
-# (beg-dst-absolute
-# (+ (calendar-persian-to-absolute (list 1 1 persian-year))
-# exceptional-year-offset))
-# (end-dst-absolute
-# (+ (calendar-persian-to-absolute (list 6 30 persian-year))
-# exceptional-year-offset))
-# (next-year-beg-dst-absolute
-# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year)))
-# (if (member (1+ persian-year) exceptional-persian-years) 1 0)))
-# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute))
-# (end-dst (calendar-gregorian-from-absolute end-dst-absolute))
-# (next-year-beg-dst (calendar-gregorian-from-absolute
-# next-year-beg-dst-absolute))
-# (year (calendar-extract-year beg-dst))
-# (range-end (if range-start year "only")))
-# (setq range-start (or range-start year))
-# (when (or (/= (calendar-extract-day beg-dst)
-# (calendar-extract-day next-year-beg-dst))
-# (= persian-year last-persian-year))
-# (insert
-# (format
-# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n"
-# range-start range-end
-# (calendar-month-name (calendar-extract-month beg-dst) t)
-# (calendar-extract-day beg-dst)))
-# (insert
-# (format
-# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n"
-# range-start range-end
-# (calendar-month-name (calendar-extract-month end-dst) t)
-# (calendar-extract-day end-dst)))
-# (setq range-start nil))))
+# From Paul Eggert (2022-06-30):
+# Go with Pournader for 1935 through spring 1979, and for timestamps
+# after August 1991; go with with Shanks & Pottenger for other timestamps.
+# Go with Santoni's citation of the UIT for fall 1977, as 20 October 1977
+# is 28 Mehr 1356, consistent with the "Mehr" in Pournader's source.
+# Assume that the UIT's "1930" is UTC, i.e., 24:00 local time.
#
# From Oscar van Vlijmen (2005-03-30), writing about future
# discrepancies between cal-persia and the Iranian calendar:
@@ -1541,10 +1588,23 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# be changed back to its previous state on the 24 hours of the
# thirtieth day of Shahrivar.
#
+# From Ali Mirjamali (2022-05-10):
+# Official IR News Agency announcement: irna.ir/xjJ3TT
+# ...
+# Highlights: DST will be cancelled for the next Iranian year 1402
+# (i.e 2023-March-21) and forthcoming years.
+#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Iran 1978 1980 - Mar 20 24:00 1:00 -
-Rule Iran 1978 only - Oct 20 24:00 0 -
+# Work around a bug in zic 2022a and earlier.
+Rule Iran 1910 only - Jan 1 00:00 0 -
+#
+Rule Iran 1977 only - Mar 21 23:00 1:00 -
+Rule Iran 1977 only - Oct 20 24:00 0 -
+Rule Iran 1978 only - Mar 24 24:00 1:00 -
+Rule Iran 1978 only - Aug 5 01:00 0 -
+Rule Iran 1979 only - May 26 24:00 1:00 -
Rule Iran 1979 only - Sep 18 24:00 0 -
+Rule Iran 1980 only - Mar 20 24:00 1:00 -
Rule Iran 1980 only - Sep 22 24:00 0 -
Rule Iran 1991 only - May 2 24:00 1:00 -
Rule Iran 1992 1995 - Mar 21 24:00 1:00 -
@@ -1575,85 +1635,13 @@ Rule Iran 2017 2019 - Mar 21 24:00 1:00 -
Rule Iran 2017 2019 - Sep 21 24:00 0 -
Rule Iran 2020 only - Mar 20 24:00 1:00 -
Rule Iran 2020 only - Sep 20 24:00 0 -
-Rule Iran 2021 2023 - Mar 21 24:00 1:00 -
-Rule Iran 2021 2023 - Sep 21 24:00 0 -
-Rule Iran 2024 only - Mar 20 24:00 1:00 -
-Rule Iran 2024 only - Sep 20 24:00 0 -
-Rule Iran 2025 2027 - Mar 21 24:00 1:00 -
-Rule Iran 2025 2027 - Sep 21 24:00 0 -
-Rule Iran 2028 2029 - Mar 20 24:00 1:00 -
-Rule Iran 2028 2029 - Sep 20 24:00 0 -
-Rule Iran 2030 2031 - Mar 21 24:00 1:00 -
-Rule Iran 2030 2031 - Sep 21 24:00 0 -
-Rule Iran 2032 2033 - Mar 20 24:00 1:00 -
-Rule Iran 2032 2033 - Sep 20 24:00 0 -
-Rule Iran 2034 2035 - Mar 21 24:00 1:00 -
-Rule Iran 2034 2035 - Sep 21 24:00 0 -
-Rule Iran 2036 2037 - Mar 20 24:00 1:00 -
-Rule Iran 2036 2037 - Sep 20 24:00 0 -
-Rule Iran 2038 2039 - Mar 21 24:00 1:00 -
-Rule Iran 2038 2039 - Sep 21 24:00 0 -
-Rule Iran 2040 2041 - Mar 20 24:00 1:00 -
-Rule Iran 2040 2041 - Sep 20 24:00 0 -
-Rule Iran 2042 2043 - Mar 21 24:00 1:00 -
-Rule Iran 2042 2043 - Sep 21 24:00 0 -
-Rule Iran 2044 2045 - Mar 20 24:00 1:00 -
-Rule Iran 2044 2045 - Sep 20 24:00 0 -
-Rule Iran 2046 2047 - Mar 21 24:00 1:00 -
-Rule Iran 2046 2047 - Sep 21 24:00 0 -
-Rule Iran 2048 2049 - Mar 20 24:00 1:00 -
-Rule Iran 2048 2049 - Sep 20 24:00 0 -
-Rule Iran 2050 2051 - Mar 21 24:00 1:00 -
-Rule Iran 2050 2051 - Sep 21 24:00 0 -
-Rule Iran 2052 2053 - Mar 20 24:00 1:00 -
-Rule Iran 2052 2053 - Sep 20 24:00 0 -
-Rule Iran 2054 2055 - Mar 21 24:00 1:00 -
-Rule Iran 2054 2055 - Sep 21 24:00 0 -
-Rule Iran 2056 2057 - Mar 20 24:00 1:00 -
-Rule Iran 2056 2057 - Sep 20 24:00 0 -
-Rule Iran 2058 2059 - Mar 21 24:00 1:00 -
-Rule Iran 2058 2059 - Sep 21 24:00 0 -
-Rule Iran 2060 2062 - Mar 20 24:00 1:00 -
-Rule Iran 2060 2062 - Sep 20 24:00 0 -
-Rule Iran 2063 only - Mar 21 24:00 1:00 -
-Rule Iran 2063 only - Sep 21 24:00 0 -
-Rule Iran 2064 2066 - Mar 20 24:00 1:00 -
-Rule Iran 2064 2066 - Sep 20 24:00 0 -
-Rule Iran 2067 only - Mar 21 24:00 1:00 -
-Rule Iran 2067 only - Sep 21 24:00 0 -
-Rule Iran 2068 2070 - Mar 20 24:00 1:00 -
-Rule Iran 2068 2070 - Sep 20 24:00 0 -
-Rule Iran 2071 only - Mar 21 24:00 1:00 -
-Rule Iran 2071 only - Sep 21 24:00 0 -
-Rule Iran 2072 2074 - Mar 20 24:00 1:00 -
-Rule Iran 2072 2074 - Sep 20 24:00 0 -
-Rule Iran 2075 only - Mar 21 24:00 1:00 -
-Rule Iran 2075 only - Sep 21 24:00 0 -
-Rule Iran 2076 2078 - Mar 20 24:00 1:00 -
-Rule Iran 2076 2078 - Sep 20 24:00 0 -
-Rule Iran 2079 only - Mar 21 24:00 1:00 -
-Rule Iran 2079 only - Sep 21 24:00 0 -
-Rule Iran 2080 2082 - Mar 20 24:00 1:00 -
-Rule Iran 2080 2082 - Sep 20 24:00 0 -
-Rule Iran 2083 only - Mar 21 24:00 1:00 -
-Rule Iran 2083 only - Sep 21 24:00 0 -
-Rule Iran 2084 2086 - Mar 20 24:00 1:00 -
-Rule Iran 2084 2086 - Sep 20 24:00 0 -
-Rule Iran 2087 only - Mar 21 24:00 1:00 -
-Rule Iran 2087 only - Sep 21 24:00 0 -
-#
-# The following rules are approximations starting in the year 2088.
-# These are the best post-2088 approximations available, given the
-# restrictions of a single rule using ordinary Gregorian dates.
-# At some point this table will need to be extended, though quite
-# possibly Iran will change the rules first.
-Rule Iran 2088 max - Mar 20 24:00 1:00 -
-Rule Iran 2088 max - Sep 20 24:00 0 -
+Rule Iran 2021 2022 - Mar 21 24:00 1:00 -
+Rule Iran 2021 2022 - Sep 21 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Tehran 3:25:44 - LMT 1916
- 3:25:44 - TMT 1946 # Tehran Mean Time
- 3:30 - +0330 1977 Nov
+ 3:25:44 - TMT 1935 Jun 13 # Tehran Mean Time
+ 3:30 Iran +0330/+0430 1977 Oct 20 24:00
4:00 Iran +04/+05 1979
3:30 Iran +0330/+0430
@@ -2249,6 +2237,17 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# From the Arabic version, it seems to say it would be at midnight
# (assume 24:00) on the last Thursday in February, starting from 2022.
+# From Issam Al-Zuwairi (2022-10-05):
+# The Council of Ministers in Jordan decided Wednesday 5th October 2022,
+# that daylight saving time (DST) will be throughout the year....
+#
+# From Brian Inglis (2022-10-06):
+# https://petra.gov.jo/Include/InnerPage.jsp?ID=45567&lang=en&name=en_news
+#
+# From Paul Eggert (2022-10-05):
+# Like Syria, model this as a transition from EEST +03 (DST) to plain +03
+# (non-DST) at the point where DST would otherwise have ended.
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Jordan 1973 only - Jun 6 0:00 1:00 S
Rule Jordan 1973 1975 - Oct 1 0:00 0 -
@@ -2280,11 +2279,12 @@ Rule Jordan 2005 only - Sep lastFri 0:00s 0 -
Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 -
Rule Jordan 2013 only - Dec 20 0:00 0 -
Rule Jordan 2014 2021 - Mar lastThu 24:00 1:00 S
-Rule Jordan 2014 max - Oct lastFri 0:00s 0 -
-Rule Jordan 2022 max - Feb lastThu 24:00 1:00 S
+Rule Jordan 2014 2022 - Oct lastFri 0:00s 0 -
+Rule Jordan 2022 only - Feb lastThu 24:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Amman 2:23:44 - LMT 1931
- 2:00 Jordan EE%sT
+ 2:00 Jordan EE%sT 2022 Oct 28 0:00s
+ 3:00 - +03
# Kazakhstan
@@ -2475,9 +2475,9 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# the third time belt (before 1930 this means +03).
# From Alexander Konzurovski (2018-12-20):
-# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from
-# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is
-# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language).
+# (Asia/Qyzylorda) is changing its time zone from UTC+6 to UTC+5
+# effective December 21st, 2018....
+# http://adilet.zan.kz/rus/docs/P1800000817 (russian language).
# Zone NAME STDOFF RULES FORMAT [UNTIL]
#
@@ -2710,8 +2710,6 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
8:30 - KST 2018 May 4 23:30
9:00 - KST
-###############################################################################
-
# Kuwait
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kuwait 3:11:56 - LMT 1950
@@ -2728,8 +2726,41 @@ Zone Asia/Vientiane 6:50:24 - LMT 1906 Jul 1
8:00 - +08 1955 Apr 15
7:00 - +07
-
# Lebanon
+#
+# From Saadallah Itani (2023-03-23):
+# Lebanon ... announced today delay of Spring forward from March 25 to April 20.
+#
+# From Paul Eggert (2023-03-27):
+# This announcement was by the Lebanese caretaker prime minister Najib Mikati.
+# https://www.mtv.com.lb/en/News/Local/1352516/lebanon-postpones-daylight-saving-time-adoption
+# A video was later leaked to the media of parliament speaker Nabih Berri
+# asking Mikati to postpone DST to aid observance of Ramadan, Mikati objecting
+# that this would cause problems such as scheduling airline flights, to which
+# Berri interjected, "What flights?"
+#
+# The change was controversial and led to a partly-sectarian divide.
+# Many Lebanese institutions, including the education ministry, the Maronite
+# church, and two news channels LCBI and MTV, ignored the announcement and
+# went ahead with the long-scheduled spring-forward on March 25/26, some
+# arguing that the prime minister had not followed the law because the change
+# had not been approved by the cabinet. Google went with the announcement;
+# Apple ignored it. At least one bank followed the announcement for its doors,
+# but ignored the announcement in internal computer systems.
+# Beirut international airport listed two times for each departure.
+# Dan Azzi wrote "My view is that this whole thing is a Dumb and Dumber movie."
+# Eventually the prime minister backed down, said the cabinet had decided to
+# stick with its 1998 decision, and that DST would begin midnight March 29/30.
+# https://www.nna-leb.gov.lb/en/miscellaneous/604093/lebanon-has-two-times-of-day-amid-daylight-savings
+# https://www.cnbc.com/2023/03/27/lebanon-in-two-different-time-zones-as-government-disagrees-on-daylight-savings.html
+#
+# Although we could model the chaos with two Zones, that would likely cause
+# more trouble than it would cure. Since so many manual clocks and
+# computer-based timestamps ignored the announcement, stick with official
+# cabinet resolutions in the data while recording the prime minister's
+# announcement as a comment. This is how we treated a similar situation in
+# Rio de Janeiro in spring 1993.
+#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Lebanon 1920 only - Mar 28 0:00 1:00 S
Rule Lebanon 1920 only - Oct 25 0:00 0 -
@@ -2755,19 +2786,20 @@ Rule Lebanon 1992 only - Oct 4 0:00 0 -
Rule Lebanon 1993 max - Mar lastSun 0:00 1:00 S
Rule Lebanon 1993 1998 - Sep lastSun 0:00 0 -
Rule Lebanon 1999 max - Oct lastSun 0:00 0 -
+# This one-time rule, announced by the prime minister first for April 21
+# then for March 30, is commented out for reasons described above.
+#Rule Lebanon 2023 only - Mar 30 0:00 1:00 S
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Beirut 2:22:00 - LMT 1880
2:00 Lebanon EE%sT
-# Malaysia
+# Malaysia (eastern)
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 -
Rule NBorneo 1935 1941 - Dec 14 0:00 0 -
#
-# peninsular Malaysia
-# taken from Mok Ly Yng (2003-10-30)
-# https://web.archive.org/web/20190822231045/http://www.math.nus.edu.sg/~mathelmr/teaching/timezone.html
-# This agrees with Singapore since 1905-06-01.
+# Peninsular Malaysia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1
6:55:25 - SMT 1905 Jun 1 # Singapore M.T.
@@ -2776,8 +2808,10 @@ Zone Asia/Kuala_Lumpur 6:46:46 - LMT 1901 Jan 1
7:20 - +0720 1941 Sep 1
7:30 - +0730 1942 Feb 16
9:00 - +09 1945 Sep 12
- 7:30 - +0730 1982 Jan 1
+ 7:30 - +0730 1981 Dec 31 16:00u
8:00 - +08
+
+#
# Sabah & Sarawak
# From Paul Eggert (2014-08-12):
# The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945
@@ -3008,7 +3042,7 @@ Zone Asia/Muscat 3:54:24 - LMT 1920
# 9pm and moving clocks forward by one hour for the next three months. ...."
#
# http://www.worldtimezone.com/dst_news/dst_news_pakistan01.html
-# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
+# http://www.dailytimes.com.pk/default.asp?page=2008\05\15\story_15-5-2008_pg1_4
# From Arthur David Olson (2008-05-19):
# XXX--midnight transitions is a guess; 2008 only is a guess.
@@ -3331,7 +3365,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# Some of many sources in Arabic:
# http://www.samanews.com/index.php?act=Show&id=122638
#
-# http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
+# http://safa.ps/details/news/74352/بدء-التوقيت-الصيفي-بالضفة-وغزة-ليلة-الجمعة.html
#
# Our brief summary:
# https://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
@@ -3341,7 +3375,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# time from midnight on Friday, March 29, 2013" (translated).
# [These are in Arabic and are for Gaza and for Ramallah, respectively.]
# http://www.samanews.com/index.php?act=Show&id=154120
-# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
+# http://safa.ps/details/news/99844/رام-الله-بدء-التوقيت-الصيفي-29-الجاري.html
# From Steffen Thorsen (2013-09-24):
# The Gaza and West Bank are ending DST Thursday at midnight
@@ -3415,10 +3449,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# The winter time in 2015 started on October 23 at 01:00.
# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY
# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583
-#
-# From Paul Eggert (2019-04-10):
-# For now, guess spring-ahead transitions are at 00:00 on the Saturday
-# preceding March's last Sunday (i.e., Sat>=24).
# From P Chan (2021-10-18):
# http://wafa.ps/Pages/Details/34701
@@ -3435,6 +3465,50 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# From Heba Hamad (2022-03-10):
# summer time will begin in Palestine from Sunday 03-27-2022, 00:00 AM.
+# From Heba Hamad (2022-08-30):
+# winter time will begin in Palestine from Saturday 10-29, 02:00 AM by
+# 60 minutes backwards. Also the state of Palestine adopted the summer
+# and winter time for the years: 2023,2024,2025,2026 ...
+# https://mm.icann.org/pipermail/tz/attachments/20220830/9f024566/Time-0001.pdf
+# (2022-08-31): ... the Saturday before the last Sunday in March and October
+# at 2:00 AM ,for the years from 2023 to 2026.
+# (2022-09-05): https://mtit.pna.ps/Site/New/1453
+
+# From Heba Hamad (2023-03-22):
+# ... summer time will begin in Palestine from Saturday 04-29-2023,
+# 02:00 AM by 60 minutes forward.
+#
+# From Paul Eggert (2023-03-22):
+# For now, guess that spring and fall transitions will normally
+# continue to use 2022's rules, that during DST Palestine will switch
+# to standard time at 02:00 the last Saturday before Ramadan and back
+# to DST at 02:00 the first Saturday after Ramadan, and that
+# if the normal spring-forward or fall-back transition occurs during
+# Ramadan the former is delayed and the latter advanced.
+# To implement this, I predicted Ramadan-oriented transition dates for
+# 2023 through 2086 by running the following program under GNU Emacs 28.2,
+# with the results integrated by hand into the table below.
+# Predictions after 2086 are approximated without Ramadan.
+#
+# (let ((islamic-year 1444))
+# (require 'cal-islam)
+# (while (< islamic-year 1510)
+# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
+# (b (+ 1 (calendar-islamic-to-absolute (list 10 1 islamic-year))))
+# (saturday 6))
+# (while (/= saturday (mod (setq a (1- a)) 7)))
+# (while (/= saturday (mod b 7))
+# (setq b (1+ b)))
+# (setq a (calendar-gregorian-from-absolute a))
+# (setq b (calendar-gregorian-from-absolute b))
+# (insert
+# (format
+# (concat "Rule Palestine\t%d\tonly\t-\t%s\t%2d\t2:00\t0\t-\n"
+# "Rule Palestine\t%d\tonly\t-\t%s\t%2d\t2:00\t1:00\tS\n")
+# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+# (setq islamic-year (+ 1 islamic-year))))
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 -
@@ -3465,14 +3539,94 @@ Rule Palestine 2013 only - Sep 27 0:00 0 -
Rule Palestine 2014 only - Oct 24 0:00 0 -
Rule Palestine 2015 only - Mar 28 0:00 1:00 S
Rule Palestine 2015 only - Oct 23 1:00 0 -
-Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S
-Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 -
+Rule Palestine 2016 2018 - Mar Sat<=30 1:00 1:00 S
+Rule Palestine 2016 2018 - Oct Sat<=30 1:00 0 -
Rule Palestine 2019 only - Mar 29 0:00 1:00 S
-Rule Palestine 2019 only - Oct Sat>=24 0:00 0 -
-Rule Palestine 2020 2021 - Mar Sat>=24 0:00 1:00 S
+Rule Palestine 2019 only - Oct Sat<=30 0:00 0 -
+Rule Palestine 2020 2021 - Mar Sat<=30 0:00 1:00 S
Rule Palestine 2020 only - Oct 24 1:00 0 -
-Rule Palestine 2021 max - Oct Fri>=23 1:00 0 -
-Rule Palestine 2022 max - Mar Sun>=25 0:00 1:00 S
+Rule Palestine 2021 only - Oct 29 1:00 0 -
+Rule Palestine 2022 only - Mar 27 0:00 1:00 S
+Rule Palestine 2022 2035 - Oct Sat<=30 2:00 0 -
+Rule Palestine 2023 only - Apr 29 2:00 1:00 S
+Rule Palestine 2024 only - Apr 13 2:00 1:00 S
+Rule Palestine 2025 only - Apr 5 2:00 1:00 S
+Rule Palestine 2026 2054 - Mar Sat<=30 2:00 1:00 S
+Rule Palestine 2036 only - Oct 18 2:00 0 -
+Rule Palestine 2037 only - Oct 10 2:00 0 -
+Rule Palestine 2038 only - Sep 25 2:00 0 -
+Rule Palestine 2039 only - Sep 17 2:00 0 -
+Rule Palestine 2039 only - Oct 22 2:00 1:00 S
+Rule Palestine 2039 2067 - Oct Sat<=30 2:00 0 -
+Rule Palestine 2040 only - Sep 1 2:00 0 -
+Rule Palestine 2040 only - Oct 13 2:00 1:00 S
+Rule Palestine 2041 only - Aug 24 2:00 0 -
+Rule Palestine 2041 only - Sep 28 2:00 1:00 S
+Rule Palestine 2042 only - Aug 16 2:00 0 -
+Rule Palestine 2042 only - Sep 20 2:00 1:00 S
+Rule Palestine 2043 only - Aug 1 2:00 0 -
+Rule Palestine 2043 only - Sep 12 2:00 1:00 S
+Rule Palestine 2044 only - Jul 23 2:00 0 -
+Rule Palestine 2044 only - Aug 27 2:00 1:00 S
+Rule Palestine 2045 only - Jul 15 2:00 0 -
+Rule Palestine 2045 only - Aug 19 2:00 1:00 S
+Rule Palestine 2046 only - Jun 30 2:00 0 -
+Rule Palestine 2046 only - Aug 11 2:00 1:00 S
+Rule Palestine 2047 only - Jun 22 2:00 0 -
+Rule Palestine 2047 only - Jul 27 2:00 1:00 S
+Rule Palestine 2048 only - Jun 6 2:00 0 -
+Rule Palestine 2048 only - Jul 18 2:00 1:00 S
+Rule Palestine 2049 only - May 29 2:00 0 -
+Rule Palestine 2049 only - Jul 3 2:00 1:00 S
+Rule Palestine 2050 only - May 21 2:00 0 -
+Rule Palestine 2050 only - Jun 25 2:00 1:00 S
+Rule Palestine 2051 only - May 6 2:00 0 -
+Rule Palestine 2051 only - Jun 17 2:00 1:00 S
+Rule Palestine 2052 only - Apr 27 2:00 0 -
+Rule Palestine 2052 only - Jun 1 2:00 1:00 S
+Rule Palestine 2053 only - Apr 12 2:00 0 -
+Rule Palestine 2053 only - May 24 2:00 1:00 S
+Rule Palestine 2054 only - Apr 4 2:00 0 -
+Rule Palestine 2054 only - May 16 2:00 1:00 S
+Rule Palestine 2055 only - May 1 2:00 1:00 S
+Rule Palestine 2056 only - Apr 22 2:00 1:00 S
+Rule Palestine 2057 only - Apr 7 2:00 1:00 S
+Rule Palestine 2058 max - Mar Sat<=30 2:00 1:00 S
+Rule Palestine 2068 only - Oct 20 2:00 0 -
+Rule Palestine 2069 only - Oct 12 2:00 0 -
+Rule Palestine 2070 only - Oct 4 2:00 0 -
+Rule Palestine 2071 only - Sep 19 2:00 0 -
+Rule Palestine 2072 only - Sep 10 2:00 0 -
+Rule Palestine 2072 only - Oct 15 2:00 1:00 S
+Rule Palestine 2073 only - Sep 2 2:00 0 -
+Rule Palestine 2073 only - Oct 7 2:00 1:00 S
+Rule Palestine 2074 only - Aug 18 2:00 0 -
+Rule Palestine 2074 only - Sep 29 2:00 1:00 S
+Rule Palestine 2075 only - Aug 10 2:00 0 -
+Rule Palestine 2075 only - Sep 14 2:00 1:00 S
+Rule Palestine 2075 max - Oct Sat<=30 2:00 0 -
+Rule Palestine 2076 only - Jul 25 2:00 0 -
+Rule Palestine 2076 only - Sep 5 2:00 1:00 S
+Rule Palestine 2077 only - Jul 17 2:00 0 -
+Rule Palestine 2077 only - Aug 28 2:00 1:00 S
+Rule Palestine 2078 only - Jul 9 2:00 0 -
+Rule Palestine 2078 only - Aug 13 2:00 1:00 S
+Rule Palestine 2079 only - Jun 24 2:00 0 -
+Rule Palestine 2079 only - Aug 5 2:00 1:00 S
+Rule Palestine 2080 only - Jun 15 2:00 0 -
+Rule Palestine 2080 only - Jul 20 2:00 1:00 S
+Rule Palestine 2081 only - Jun 7 2:00 0 -
+Rule Palestine 2081 only - Jul 12 2:00 1:00 S
+Rule Palestine 2082 only - May 23 2:00 0 -
+Rule Palestine 2082 only - Jul 4 2:00 1:00 S
+Rule Palestine 2083 only - May 15 2:00 0 -
+Rule Palestine 2083 only - Jun 19 2:00 1:00 S
+Rule Palestine 2084 only - Apr 29 2:00 0 -
+Rule Palestine 2084 only - Jun 10 2:00 1:00 S
+Rule Palestine 2085 only - Apr 21 2:00 0 -
+Rule Palestine 2085 only - Jun 2 2:00 1:00 S
+Rule Palestine 2086 only - Apr 13 2:00 0 -
+Rule Palestine 2086 only - May 18 2:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
@@ -3569,6 +3723,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
# Saudi Arabia
#
+# Japan's year-round bases in Antarctica match this since 1970.
+#
# From Paul Eggert (2018-08-29):
# Time in Saudi Arabia and other countries in the Arabian peninsula was not
# standardized until 1968 or so; we don't know exactly when, and possibly it
@@ -3624,7 +3780,7 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
7:20 - +0720 1941 Sep 1
7:30 - +0730 1942 Feb 16
9:00 - +09 1945 Sep 12
- 7:30 - +0730 1982 Jan 1
+ 7:30 - +0730 1981 Dec 31 16:00u
8:00 - +08
# Spratly Is
@@ -3671,7 +3827,7 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# standard time is SLST.
#
# From Paul Eggert (2016-10-18):
-# "SLST" seems to be reasonably recent and rarely-used outside time
+# "SLST" seems to be reasonably recent and rarely used outside time
# zone nerd sources. I searched Google News and found three uses of
# it in the International Business Times of India in February and
# March of this year when discussing cricket match times, but nothing
@@ -3840,19 +3996,27 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# Our brief summary:
# https://www.timeanddate.com/news/time/syria-dst-2012.html
-# From Arthur David Olson (2012-03-27):
-# Assume last Friday in March going forward XXX.
+# From Steffen Thorsen (2022-10-05):
+# Syria is adopting year-round DST, starting this autumn....
+# From https://www.enabbaladi.net/archives/607812
+# "This [the decision] came after the weekly government meeting today,
+# Tuesday 4 October ..."
+#
+# From Paul Eggert (2022-10-05):
+# Like Jordan, model this as a transition from EEST +03 (DST) to plain +03
+# (non-DST) at the point where DST would otherwise have ended.
Rule Syria 2008 only - Apr Fri>=1 0:00 1:00 S
Rule Syria 2008 only - Nov 1 0:00 0 -
Rule Syria 2009 only - Mar lastFri 0:00 1:00 S
Rule Syria 2010 2011 - Apr Fri>=1 0:00 1:00 S
-Rule Syria 2012 max - Mar lastFri 0:00 1:00 S
-Rule Syria 2009 max - Oct lastFri 0:00 0 -
+Rule Syria 2012 2022 - Mar lastFri 0:00 1:00 S
+Rule Syria 2009 2022 - Oct lastFri 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq
- 2:00 Syria EE%sT
+ 2:00 Syria EE%sT 2022 Oct 28 0:00
+ 3:00 - +03
# Tajikistan
# From Shanks & Pottenger.
@@ -3860,7 +4024,7 @@ Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq
Zone Asia/Dushanbe 4:35:12 - LMT 1924 May 2
5:00 - +05 1930 Jun 21
6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s
- 5:00 1:00 +05/+06 1991 Sep 9 2:00s
+ 5:00 1:00 +06 1991 Sep 9 2:00s
5:00 - +05
# Thailand
@@ -3879,6 +4043,8 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
5:00 - +05
# United Arab Emirates
+#
+# The Crozet Is also observe Réunion time; see the 'antarctica' file.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Dubai 3:41:12 - LMT 1920
4:00 - +04
@@ -3893,14 +4059,15 @@ Zone Asia/Samarkand 4:27:53 - LMT 1924 May 2
6:00 - +06 1982 Apr 1
5:00 RussiaAsia +05/+06 1992
5:00 - +05
-# Milne says Tashkent was 4:37:10.8; round to nearest.
+# Milne says Tashkent was 4:37:10.8.
+ #STDOFF 4:37:10.8
Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
5:00 - +05 1930 Jun 21
6:00 RussiaAsia +06/+07 1991 Mar 31 2:00
5:00 RussiaAsia +05/+06 1992
5:00 - +05
-# Vietnam
+# Vietnam (southern)
# From Paul Eggert (2014-10-04):
# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
@@ -3912,7 +4079,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# The English-language name of Vietnam's most populous city is "Ho Chi Minh
# City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters.
-# From Paul Eggert (2014-10-21) after a heads-up from Trần Ngọc Quân:
+# From Paul Eggert (2022-07-27) after a 2014 heads-up from Trần Ngọc Quân:
# Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)"
# (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50,
# is quoted verbatim in:
@@ -3924,8 +4091,8 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# The 1906 transition was effective July 1 and standardized Indochina to
# Phù Liễn Observatory, legally 104° 17' 17" east of Paris.
# It's unclear whether this meant legal Paris Mean Time (00:09:21) or
-# the Paris Meridian (2° 20' 14.03" E); the former yields 07:06:30.1333...
-# and the latter 07:06:29.333... so either way it rounds to 07:06:30,
+# the Paris Meridian; for now guess the former and round the exact
+# 07:06:30.1333... to 07:06:30.13 as the legal spec used 66 2/3 ms precision.
# which is used below even though the modern-day Phù Liễn Observatory
# is closer to 07:06:31. Abbreviate Phù Liễn Mean Time as PLMT.
#
@@ -3952,7 +4119,8 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# NXB Thuận Hoá, Huế, 1995.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
+ #STDOFF 7:06:30.13
+Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1
7:06:30 - PLMT 1911 May 1 # Phù Liễn MT
7:00 - +07 1942 Dec 31 23:00
8:00 - +08 1945 Mar 14 23:00
@@ -3974,7 +4142,6 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
# use Asia/Bangkok; see the VN entries in the file zone1970.tab.
# For timestamps before 1970, see Asia/Hanoi in the file 'backzone'.
-
# Yemen
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Aden 2:59:54 - LMT 1950
diff --git a/src/main/java/org/joda/time/tz/src/australasia b/src/main/java/org/joda/time/tz/src/australasia
index c52e4c61..86e911f5 100644
--- a/src/main/java/org/joda/time/tz/src/australasia
+++ b/src/main/java/org/joda/time/tz/src/australasia
@@ -256,14 +256,11 @@ Zone Antarctica/Macquarie 0 - -00 1899 Nov
Zone Indian/Christmas 7:02:52 - LMT 1895 Feb
7:00 - +07
-# Cocos (Keeling) Is
-# These islands were ruled by the Ross family from about 1830 to 1978.
-# We don't know when standard time was introduced; for now, we guess 1900.
+# Cocos (Keeling) Islands
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Indian/Cocos 6:27:40 - LMT 1900
6:30 - +0630
-
# Fiji
# Milne gives 11:55:44 for Suva.
@@ -336,7 +333,7 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# From Steffen Thorsen (2013-01-10):
# Fiji will end DST on 2014-01-19 02:00:
-# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-%281%29.aspx
+# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-(1).aspx
# From Ken Rylander (2014-10-20):
# DST will start Nov. 2 this year.
@@ -399,8 +396,14 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# concerned shifting arrival and departure times, which may look like a simple
# thing but requires some significant logistical adjustments domestically and
# internationally."
-# Assume for now that DST will resume with the recent pre-2020 rules for the
-# 2022/2023 season.
+
+# From Shalvin Narayan (2022-10-27):
+# Please note that there will not be any daylight savings time change
+# in Fiji for 2022-2023....
+# https://www.facebook.com/FijianGovernment/posts/pfbid0mmWVTYmTibn66ybpFda75pDcf34SSpoSaskJW5gXwaKo5Sgc7273Q4fXWc6kQV6Hl
+#
+# From Paul Eggert (2022-10-27):
+# For now, assume DST is suspended indefinitely.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 -
@@ -415,8 +418,6 @@ Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 2015 2021 - Jan Sun>=12 3:00 0 -
Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2020 only - Dec 20 2:00 1:00 -
-Rule Fiji 2022 max - Nov Sun>=8 2:00 1:00 -
-Rule Fiji 2023 max - Jan Sun>=12 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13
@@ -432,6 +433,7 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete
# Clipperton (near North America) is administered from French Polynesia;
# it is uninhabited.
+
# Guam
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
@@ -473,10 +475,14 @@ Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31
10:00 Guam G%sT 2000 Dec 23
10:00 - ChST # Chamorro Standard Time
-# Kiribati
+
+# Kiribati (Gilbert Is)
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki
12:00 - +12
+
+# Kiribati (except Gilbert Is)
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kanton 0 - -00 1937 Aug 31
-12:00 - -12 1979 Oct
-11:00 - -11 1994 Dec 31
@@ -490,8 +496,8 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Saipan -14:17:00 - LMT 1844 Dec 31
9:43:00 - LMT 1901
- 9:00 - +09 1969 Oct
- 10:00 - +10 2000 Dec 23
+ 9:00 - +09 1944 Jul 9
+ 10:00 Guam G%sT 2000 Dec 23
10:00 - ChST # Chamorro Standard Time
# Marshall Is
@@ -504,6 +510,8 @@ Zone Pacific/Majuro 11:24:48 - LMT 1901
9:00 - +09 1944 Jan 30
11:00 - +11 1969 Oct
12:00 - +12
+
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kwajalein 11:09:20 - LMT 1901
11:00 - +11 1937
10:00 - +10 1941 Apr 1
@@ -521,6 +529,8 @@ Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31
10:00 - +10 1941 Apr 1
9:00 - +09 1945 Aug
10:00 - +10
+
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia
10:32:52 - LMT 1901
11:00 - +11 1914 Oct
@@ -529,6 +539,8 @@ Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia
10:00 - +10 1941 Apr 1
9:00 - +09 1945 Aug
11:00 - +11
+
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31
10:51:56 - LMT 1901
11:00 - +11 1914 Oct
@@ -563,6 +575,7 @@ Zone Pacific/Noumea 11:05:48 - LMT 1912 Jan 13 # Nouméa
###############################################################################
# New Zealand
+# McMurdo Station and Scott Base in Antarctica use Auckland time.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule NZ 1927 only - Nov 6 2:00 1:00 S
@@ -598,14 +611,15 @@ Rule Chatham 2008 max - Apr Sun>=1 2:45s 0 -
Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2
11:30 NZ NZ%sT 1946 Jan 1
12:00 NZ NZ%sT
-Zone Pacific/Chatham 12:13:48 - LMT 1868 Nov 2
- 12:15 - +1215 1946 Jan 1
- 12:45 Chatham +1245/+1345
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Antarctica/McMurdo 0 - -00 1956
12:00 NZ NZ%sT
+Zone Pacific/Chatham 12:13:48 - LMT 1868 Nov 2
+ 12:15 - +1215 1946 Jan 1
+ 12:45 Chatham +1245/+1345
+
# Auckland Is
# uninhabited; Māori and Moriori, colonial settlers, pastoralists, sealers,
# and scientific personnel have wintered
@@ -664,7 +678,7 @@ Zone Pacific/Rarotonga 13:20:56 - LMT 1899 Dec 26 # Avarua
# Niue
-# See Pacific/Raratonga comments for 1952 transition.
+# See Pacific/Rarotonga comments for 1952 transition.
#
# From Tim Parenti (2021-09-13):
# Consecutive contemporaneous editions of The Air Almanac listed -11:20 for
@@ -750,7 +764,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1892 Jul 5
#
# Samoa's Daylight Saving Time Act 2009 is available here, but does not
# contain any dates:
-# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
+# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20(English)%20-%20Final%207-7-091.pdf
# From Laupue Raymond Hughes (2010-10-07):
# Please see
@@ -869,7 +883,6 @@ Zone Pacific/Tongatapu 12:19:12 - LMT 1945 Sep 10
Zone Pacific/Funafuti 11:56:52 - LMT 1901
12:00 - +12
-
# US minor outlying islands
# Howland, Baker
@@ -924,7 +937,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
Zone Pacific/Midway -11:49:28 - LMT 1901
-11:00 - -11 1956 Jun 3
-11:00 1:00 -10 1956 Sep 2
- -11:00 - -11
+ -11:00 - SST # S=Samoa
# Palmyra
# uninhabited since World War II; was probably like Pacific/Kiritimati
@@ -934,7 +947,6 @@ Zone Pacific/Midway -11:49:28 - LMT 1901
Zone Pacific/Wake 11:06:28 - LMT 1901
12:00 - +12
-
# Vanuatu
# From P Chan (2020-11-27):
@@ -975,6 +987,7 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
Zone Pacific/Wallis 12:15:20 - LMT 1901
12:00 - +12
+
###############################################################################
# NOTES
@@ -1291,6 +1304,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# to have the extra hour of sunshine removed from their area." See:
# Daylight saving coming to WA in 2019. Guardian Express. 2018-04-01.
# https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/
+# [The article ends with "Today's date is April 1."]
# Queensland
@@ -1834,16 +1848,12 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# "In Marshall Islands, Friday is followed by Sunday", NY Times. 1993-08-22.
# https://www.nytimes.com/1993/08/22/world/in-marshall-islands-friday-is-followed-by-sunday.html
-# From Phake Nick (2018-10-27):
-# <https://wiki.suikawiki.org/n/南洋群島の標準時> ... pointed out that
-# currently tzdata say Pacific/Kwajalein switched from GMT+11 to GMT-12 in
-# 1969 October without explanation, however an 1993 article from NYT say it
-# synchorized its day with US mainland about 40 years ago and thus the switch
-# should occur at around 1950s instead.
-#
-# From Paul Eggert (2018-11-18):
-# The NYT (actually, AP) article is vague and possibly wrong about this.
-# The article says the earlier switch was "40 years ago when the United States
+# From Paul Eggert (2022-03-31):
+# Phake Nick (2018-10-27) noted <https://wiki.suikawiki.org/n/南洋群島の標準時>'s
+# citation of a 1993 AP article published in the New York Times saying
+# Kwajalein synchronized its day with the US mainland about 40 years earlier.
+# However the AP article is vague and possibly wrong about this. The article
+# says the earlier switch was "about 40 years ago when the United States
# Army established a missile test range here". However, the Kwajalein Test
# Center was established on 1960-10-01 and was run by the US Navy. It was
# transferred to the US Army on 1964-07-01. See "Seize the High Ground"
@@ -1860,7 +1870,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# period. It would probably be reasonable to assume Guam use GMT+9 during
# that period of time like the surrounding area.
-# From Paul Eggert (2018-11-18):
+# From Paul Eggert (2023-01-23):
# Howse writes (p 153) "The Spaniards, on the other hand, reached the
# Philippines and the Ladrones from America," and implies that the Ladrones
# (now called the Marianas) kept American date for quite some time.
@@ -1873,7 +1883,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# they did as that avoids the need for a separate zone due to our 1970 cutoff.
#
# US Public Law 106-564 (2000-12-23) made UT +10 the official standard time,
-# under the name "Chamorro Standard Time". There is no official abbreviation,
+# under the name "Chamorro standard time". There is no official abbreviation,
# but Congressman Robert A. Underwood, author of the bill that became law,
# wrote in a press release (2000-12-27) that he will seek the use of "ChST".
@@ -1890,13 +1900,6 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Like the Ladrones (see Guam commentary), assume the Spanish East Indies
# kept American time until the Philippines switched at the end of 1844.
-# Alan Eugene Davis writes (1996-03-16),
-# "I am certain, having lived there for the past decade, that 'Truk'
-# (now properly known as Chuuk) ... is in the time zone GMT+10."
-#
-# Shanks & Pottenger write that Truk switched from UT +10 to +11
-# on 1978-10-01; ignore this for now.
-
# From Paul Eggert (1999-10-29):
# The Federated States of Micronesia Visitors Board writes in
# The Federated States of Micronesia - Visitor Information (1999-01-26)
@@ -2227,7 +2230,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# through the third Sunday in January at 03:00, like Fiji, for now.
# From David Wade (2017-10-18):
-# In August government was disolved by the King. The current prime minister
+# In August government was dissolved by the King. The current prime minister
# continued in office in care taker mode. It is easy to see that few
# decisions will be made until elections 16th November.
#
@@ -2235,26 +2238,6 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# For now, guess that DST is discontinued. That's what the IATA is guessing.
-# Wake
-
-# From Vernice Anderson, Personal Secretary to Philip Jessup,
-# US Ambassador At Large (oral history interview, 1971-02-02):
-#
-# Saturday, the 14th [of October, 1950] - ... The time was all the
-# more confusing at that point, because we had crossed the
-# International Date Line, thus getting two Sundays. Furthermore, we
-# discovered that Wake Island had two hours of daylight saving time
-# making calculation of time in Washington difficult if not almost
-# impossible.
-#
-# https://www.trumanlibrary.org/oralhist/andrsonv.htm
-
-# From Paul Eggert (2003-03-23):
-# We have no other report of DST in Wake Island, so omit this info for now.
-
-# See also the commentary for Micronesia.
-
-
###############################################################################
# The International Date Line
@@ -2278,24 +2261,18 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# an international standard, there are some places on the high seas where the
# correct date is ambiguous.
-# From Wikipedia <https://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
-# Before 1920, all ships kept local apparent time on the high seas by setting
-# their clocks at night or at the morning sight so that, given the ship's
-# speed and direction, it would be 12 o'clock when the Sun crossed the ship's
-# meridian (12 o'clock = local apparent noon). During 1917, at the
-# Anglo-French Conference on Time-keeping at Sea, it was recommended that all
-# ships, both military and civilian, should adopt hourly standard time zones
-# on the high seas. Whenever a ship was within the territorial waters of any
-# nation it would use that nation's standard time. The captain was permitted
-# to change his ship's clocks at a time of his choice following his ship's
-# entry into another zone time - he often chose midnight. These zones were
-# adopted by all major fleets between 1920 and 1925 but not by many
-# independent merchant ships until World War II.
-
-# From Paul Eggert, using references suggested by Oscar van Vlijmen
-# (2005-03-20):
-#
-# The American Practical Navigator (2002)
-# http://pollux.nss.nima.mil/pubs/pubs_j_apn_sections.html?rid=187
-# talks only about the 180-degree meridian with respect to ships in
-# international waters; it ignores the international date line.
+# From Wikipedia <https://en.wikipedia.org/wiki/Nautical_time> (2023-01-23):
+# The nautical time zone system is analogous to the terrestrial time zone
+# system for use on high seas. Under the system time changes are required for
+# changes of longitude in one-hour steps. The one-hour step corresponds to a
+# time zone width of 15° longitude. The 15° gore that is offset from GMT or
+# UT1 (not UTC) by twelve hours is bisected by the nautical date line into two
+# 7°30' gores that differ from GMT by ±12 hours. A nautical date line is
+# implied but not explicitly drawn on time zone maps. It follows the 180th
+# meridian except where it is interrupted by territorial waters adjacent to
+# land, forming gaps: it is a pole-to-pole dashed line.
+
+# From Paul Eggert (2023-01-23):
+# The American Practical Navigator <https://msi.nga.mil/Publications/APN>,
+# 2019 edition, merely says that the International Date Line
+# "coincides with the 180th meridian over most of its length."
diff --git a/src/main/java/org/joda/time/tz/src/backward b/src/main/java/org/joda/time/tz/src/backward
index e0b65b32..12465358 100644
--- a/src/main/java/org/joda/time/tz/src/backward
+++ b/src/main/java/org/joda/time/tz/src/backward
@@ -4,54 +4,33 @@
# 2009-05-17 by Arthur David Olson.
# This file provides links from old or merged timezone names to current ones.
-# Many names changed in late 1993. Several of these names are
+# Many names changed in 1993 and in 1995, and many merged names moved here
+# in the period from 2013 through 2022. Several of these names are
# also present in the file 'backzone', which has data important only
# for pre-1970 timestamps and so is out of scope for tzdb proper.
-# Link TARGET LINK-NAME
-Link Africa/Asmara Africa/Asmera
-Link Africa/Bamako Africa/Timbuktu
-Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
-Link America/Adak America/Atka
-Link America/Argentina/Buenos_Aires America/Buenos_Aires
-Link America/Argentina/Catamarca America/Catamarca
-Link America/Atikokan America/Coral_Harbour
-Link America/Argentina/Cordoba America/Cordoba
-Link America/Tijuana America/Ensenada
-Link America/Indiana/Indianapolis America/Fort_Wayne
-Link America/Nuuk America/Godthab
-Link America/Indiana/Indianapolis America/Indianapolis
-Link America/Argentina/Jujuy America/Jujuy
-Link America/Indiana/Knox America/Knox_IN
-Link America/Kentucky/Louisville America/Louisville
-Link America/Argentina/Mendoza America/Mendoza
-Link America/Toronto America/Montreal
-Link America/Rio_Branco America/Porto_Acre
-Link America/Argentina/Cordoba America/Rosario
-Link America/Tijuana America/Santa_Isabel
-Link America/Denver America/Shiprock
-Link America/St_Thomas America/Virgin
-Link Antarctica/McMurdo Antarctica/South_Pole
-Link Asia/Ashgabat Asia/Ashkhabad
-Link Asia/Kolkata Asia/Calcutta
-Link Asia/Shanghai Asia/Chongqing
-Link Asia/Shanghai Asia/Chungking
-Link Asia/Dhaka Asia/Dacca
-Link Asia/Shanghai Asia/Harbin
-Link Asia/Urumqi Asia/Kashgar
-Link Asia/Kathmandu Asia/Katmandu
-Link Asia/Macau Asia/Macao
-Link Asia/Yangon Asia/Rangoon
-Link Asia/Ho_Chi_Minh Asia/Saigon
-Link Asia/Jerusalem Asia/Tel_Aviv
-Link Asia/Thimphu Asia/Thimbu
-Link Asia/Makassar Asia/Ujung_Pandang
-Link Asia/Ulaanbaatar Asia/Ulan_Bator
-Link Atlantic/Faroe Atlantic/Faeroe
-Link Europe/Oslo Atlantic/Jan_Mayen
-Link Australia/Sydney Australia/ACT
-Link Australia/Sydney Australia/Canberra
-Link Australia/Hobart Australia/Currie
+# Although this file is optional and tzdb will work if you omit it by
+# building with 'make BACKWARD=', in practice downstream users
+# typically use this file for backward compatibility.
+
+# This file is divided into sections, one for each major reason for a
+# backward compatibility link. Each section is sorted by link name.
+
+# A "#= TARGET1" comment labels each link inserted only because some
+# .zi parsers (including tzcode through 2022e) mishandle links to links.
+# The comment says what the target would be if these parsers were fixed
+# so that data could contain links to links. For example, the line
+# "Link Australia/Sydney Australia/ACT #= Australia/Canberra" would be
+# "Link Australia/Canberra Australia/ACT" were it not that data lines
+# refrain from linking to links like Australia/Canberra, which means
+# the Australia/ACT line links instead to Australia/Sydney,
+# Australia/Canberra's target.
+
+
+# Pre-1993 naming conventions
+
+# Link TARGET LINK-NAME #= TARGET1
+Link Australia/Sydney Australia/ACT #= Australia/Canberra
Link Australia/Lord_Howe Australia/LHI
Link Australia/Sydney Australia/NSW
Link Australia/Darwin Australia/North
@@ -61,7 +40,7 @@ Link Australia/Hobart Australia/Tasmania
Link Australia/Melbourne Australia/Victoria
Link Australia/Perth Australia/West
Link Australia/Broken_Hill Australia/Yancowinna
-Link America/Rio_Branco Brazil/Acre
+Link America/Rio_Branco Brazil/Acre #= America/Porto_Acre
Link America/Noronha Brazil/DeNoronha
Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
@@ -81,15 +60,34 @@ Link Pacific/Easter Chile/EasterIsland
Link America/Havana Cuba
Link Africa/Cairo Egypt
Link Europe/Dublin Eire
+# Vanguard section, for most .zi parsers.
+#Link GMT Etc/GMT
+#Link GMT Etc/GMT+0
+#Link GMT Etc/GMT-0
+#Link GMT Etc/GMT0
+#Link GMT Etc/Greenwich
+# Rearguard section, for TZUpdater 2.3.2 and earlier.
+Link Etc/GMT Etc/GMT+0
+Link Etc/GMT Etc/GMT-0
+Link Etc/GMT Etc/GMT0
+Link Etc/GMT Etc/Greenwich
+# End of rearguard section.
Link Etc/UTC Etc/UCT
-Link Europe/London Europe/Belfast
-Link Europe/Chisinau Europe/Tiraspol
+Link Etc/UTC Etc/Universal
+Link Etc/UTC Etc/Zulu
Link Europe/London GB
Link Europe/London GB-Eire
+# Vanguard section, for most .zi parsers.
+#Link GMT GMT+0
+#Link GMT GMT-0
+#Link GMT GMT0
+#Link GMT Greenwich
+# Rearguard section, for TZUpdater 2.3.2 and earlier.
Link Etc/GMT GMT+0
Link Etc/GMT GMT-0
Link Etc/GMT GMT0
Link Etc/GMT Greenwich
+# End of rearguard section.
Link Asia/Hong_Kong Hongkong
Link Atlantic/Reykjavik Iceland
Link Asia/Tehran Iran
@@ -103,14 +101,8 @@ Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
-Link America/Denver Navajo
+Link America/Denver Navajo #= America/Shiprock
Link Asia/Shanghai PRC
-Link Pacific/Kanton Pacific/Enderbury
-Link Pacific/Honolulu Pacific/Johnston
-Link Pacific/Pohnpei Pacific/Ponape
-Link Pacific/Pago_Pago Pacific/Samoa
-Link Pacific/Chuuk Pacific/Truk
-Link Pacific/Chuuk Pacific/Yap
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
Link Asia/Taipei ROC
@@ -134,3 +126,87 @@ Link Etc/UTC UTC
Link Etc/UTC Universal
Link Europe/Moscow W-SU
Link Etc/UTC Zulu
+
+
+# Two-part names that were renamed mostly to three-part names in 1995
+
+# Link TARGET LINK-NAME #= TARGET1
+Link America/Argentina/Buenos_Aires America/Buenos_Aires
+Link America/Argentina/Catamarca America/Catamarca
+Link America/Argentina/Cordoba America/Cordoba
+Link America/Indiana/Indianapolis America/Indianapolis
+Link America/Argentina/Jujuy America/Jujuy
+Link America/Indiana/Knox America/Knox_IN
+Link America/Kentucky/Louisville America/Louisville
+Link America/Argentina/Mendoza America/Mendoza
+Link America/St_Thomas America/Virgin
+Link Pacific/Pago_Pago Pacific/Samoa
+
+
+# Pre-2013 practice, which typically had a Zone per zone.tab line
+
+# Link TARGET LINK-NAME
+
+
+# Non-zone.tab locations with timestamps since 1970 that duplicate
+# those of an existing location
+
+# Link TARGET LINK-NAME
+Link Africa/Bamako Africa/Timbuktu
+Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
+Link America/Adak America/Atka
+Link America/Atikokan America/Coral_Harbour
+Link America/Tijuana America/Ensenada
+Link America/Indiana/Indianapolis America/Fort_Wayne
+Link America/Toronto America/Montreal
+Link America/Toronto America/Nipigon
+Link America/Iqaluit America/Pangnirtung
+Link America/Rio_Branco America/Porto_Acre
+Link America/Winnipeg America/Rainy_River
+Link America/Argentina/Cordoba America/Rosario
+Link America/Tijuana America/Santa_Isabel
+Link America/Denver America/Shiprock
+Link America/Toronto America/Thunder_Bay
+Link America/Edmonton America/Yellowknife
+Link Antarctica/McMurdo Antarctica/South_Pole
+Link Asia/Shanghai Asia/Chongqing
+Link Asia/Shanghai Asia/Harbin
+Link Asia/Urumqi Asia/Kashgar
+Link Asia/Jerusalem Asia/Tel_Aviv
+Link Europe/Oslo Atlantic/Jan_Mayen
+Link Australia/Sydney Australia/Canberra
+Link Australia/Hobart Australia/Currie
+Link Europe/London Europe/Belfast
+Link Europe/Chisinau Europe/Tiraspol
+Link Europe/Kyiv Europe/Uzhgorod
+Link Europe/Kyiv Europe/Zaporozhye
+Link Pacific/Kanton Pacific/Enderbury
+Link Pacific/Honolulu Pacific/Johnston
+Link Pacific/Chuuk Pacific/Yap
+
+
+# Alternate names for the same location
+
+# Link TARGET LINK-NAME #= TARGET1
+Link Africa/Asmara Africa/Asmera
+Link America/Nuuk America/Godthab
+Link Asia/Ashgabat Asia/Ashkhabad
+Link Asia/Kolkata Asia/Calcutta
+Link Asia/Shanghai Asia/Chungking #= Asia/Chongqing
+Link Asia/Dhaka Asia/Dacca
+# Istanbul is in both continents.
+Link Europe/Istanbul Asia/Istanbul
+Link Asia/Kathmandu Asia/Katmandu
+Link Asia/Macau Asia/Macao
+Link Asia/Yangon Asia/Rangoon
+Link Asia/Ho_Chi_Minh Asia/Saigon
+Link Asia/Thimphu Asia/Thimbu
+Link Asia/Makassar Asia/Ujung_Pandang
+Link Asia/Ulaanbaatar Asia/Ulan_Bator
+Link Atlantic/Faroe Atlantic/Faeroe
+Link Europe/Kyiv Europe/Kiev
+# Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72.
+# However, for various reasons many users expect to find it under Europe.
+Link Asia/Nicosia Europe/Nicosia
+Link Pacific/Pohnpei Pacific/Ponape
+Link Pacific/Chuuk Pacific/Truk
diff --git a/src/main/java/org/joda/time/tz/src/etcetera b/src/main/java/org/joda/time/tz/src/etcetera
index 1dc7411f..865a220c 100644
--- a/src/main/java/org/joda/time/tz/src/etcetera
+++ b/src/main/java/org/joda/time/tz/src/etcetera
@@ -16,22 +16,23 @@
# Do not use a POSIX TZ setting like TZ='GMT+4', which is four hours
# behind GMT but uses the completely misleading abbreviation "GMT".
-Zone Etc/GMT 0 - GMT
+# The following zone is used by tzcode functions like gmtime,
+# which load the "UTC" file to handle seconds properly.
Zone Etc/UTC 0 - UTC
+# Functions like gmtime load the "GMT" file to handle leap seconds properly.
+# Vanguard section, which works with most .zi parsers.
+#Zone GMT 0 - GMT
+# Rearguard section, for TZUpdater 2.3.2 and earlier.
+Zone Etc/GMT 0 - GMT
+
# The following link uses older naming conventions,
# but it belongs here, not in the file 'backward',
-# as functions like gmtime load the "GMT" file to handle leap seconds properly.
-# We want this to work even on installations that omit the other older names.
+# as it is needed for tzcode releases through 2022a,
+# where functions like gmtime load "GMT" instead of the "Etc/UTC".
+# We want this to work even on installations that omit 'backward'.
Link Etc/GMT GMT
-
-Link Etc/UTC Etc/Universal
-Link Etc/UTC Etc/Zulu
-
-Link Etc/GMT Etc/Greenwich
-Link Etc/GMT Etc/GMT-0
-Link Etc/GMT Etc/GMT+0
-Link Etc/GMT Etc/GMT0
+# End of rearguard section.
# Be consistent with POSIX TZ settings in the Zone names,
# even though this is the opposite of what many people expect.
diff --git a/src/main/java/org/joda/time/tz/src/europe b/src/main/java/org/joda/time/tz/src/europe
index c9bc337b..2a70eec2 100644
--- a/src/main/java/org/joda/time/tz/src/europe
+++ b/src/main/java/org/joda/time/tz/src/europe
@@ -303,8 +303,7 @@
# UT-00:25:22 and cites the International Telegraph Bureau. As it is
# not clear that there was any practical significance to the change
# from UT-00:25:22 to UT-00:25:21.1 in civil timekeeping, omit this
-# transition for now and just use the latter value, omitting its
-# fraction since our format cannot represent fractions.
+# transition for now and just use the latter value.
# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time
# was among various actions undertaken by the 'English' government that
@@ -499,7 +498,7 @@ Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s
+Zone Europe/London -0:01:15 - LMT 1847 Dec 1
0:00 GB-Eire %s 1968 Oct 27
1:00 - BST 1971 Oct 31 2:00u
0:00 GB-Eire %s 1996
@@ -541,9 +540,7 @@ Zone Europe/Isle_of_Man -0:17:55 - LMT 1883 Mar 30 0:00s
# other form with a traditional approximation for Irish timestamps
# after 1971-10-31 02:00 UTC; although this approximation has tm_isdst
# flags that are reversed, its UTC offsets are correct and this often
-# suffices. This source file currently uses only nonnegative SAVE
-# values, but this is intended to change and downstream code should
-# not rely on it.
+# suffices....
#
# The following is like GB-Eire and EU, except with standard time in
# summer and negative daylight saving time in winter. It is for when
@@ -558,7 +555,8 @@ Rule Eire 1990 1995 - Oct Sun>=22 1:00u -1:00 -
Rule Eire 1996 max - Oct lastSun 1:00u -1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
+ #STDOFF -0:25:21.1
+Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00s
-0:25:21 1:00 IST 1916 Oct 1 2:00s
0:00 GB-Eire %s 1921 Dec 6 # independence
@@ -982,7 +980,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880
1:00 Belgium CE%sT 1977
1:00 EU CE%sT
-# Bosnia and Herzegovina
+# Bosnia & Herzegovina
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Sarajevo 1:13:40 - LMT 1884
1:00 - CET 1941 Apr 18 23:00
@@ -1028,7 +1026,7 @@ Zone Europe/Zagreb 1:03:52 - LMT 1884
# Cyprus
# Please see the 'asia' file for Asia/Nicosia.
-# Czech Republic / Czechia
+# Czech Republic (Czechia)
#
# From Paul Eggert (2018-04-15):
# The source for Czech data is: Kdy začíná a končí letní čas. 2018-04-15.
@@ -1055,42 +1053,8 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# End of rearguard section.
1:00 Czech CE%sT 1979
1:00 EU CE%sT
-# Use Europe/Prague also for Slovakia.
-
-# Denmark, Faroe Islands, and Greenland
-
-# From Jesper Nørgaard Welen (2005-04-26):
-# the law [introducing standard time] was in effect from 1894-01-01....
-# The page https://www.retsinformation.dk/eli/lta/1893/83
-# confirms this, and states that the law was put forth 1893-03-29.
-#
-# The EU [actually, EEC and Euratom] treaty with effect from 1973:
-# https://www.retsinformation.dk/eli/lta/1972/21100
-#
-# This provoked a new law from 1974 to make possible summer time changes
-# in subsequent decrees with the law
-# https://www.retsinformation.dk/eli/lta/1974/223
-#
-# It seems however that no decree was set forward until 1980. I have
-# not found any decree, but in another related law, the effecting DST
-# changes are stated explicitly to be from 1980-04-06 at 02:00 to
-# 1980-09-28 at 02:00. If this is true, this differs slightly from
-# the EU rule in that DST runs to 02:00, not 03:00. We don't know
-# when Denmark began using the EU rule correctly, but we have only
-# confirmation of the 1980-time, so I presume it was correct in 1981:
-# The law is about the management of the extra hour, concerning
-# working hours reported and effect on obligatory-rest rules (which
-# was suspended on that night):
-# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267
-
-# From Jesper Nørgaard Welen (2005-06-11):
-# The Herning Folkeblad (1980-09-26) reported that the night between
-# Saturday and Sunday the clock is set back from three to two.
-
-# From Paul Eggert (2005-06-11):
-# Hence the "02:00" of the 1980 law refers to standard time, not
-# wall-clock time, and so the EU rules were in effect in 1980.
+# Denmark
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Denmark 1916 only - May 14 23:00 1:00 S
Rule Denmark 1916 only - Sep 30 23:00 0 -
@@ -1104,6 +1068,7 @@ Rule Denmark 1947 only - Aug 10 2:00s 0 -
Rule Denmark 1948 only - May 9 2:00s 1:00 S
Rule Denmark 1948 only - Aug 8 2:00s 0 -
#
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Copenhagen 0:50:20 - LMT 1890
0:50:20 - CMT 1894 Jan 1 # Copenhagen MT
@@ -1111,9 +1076,14 @@ Zone Europe/Copenhagen 0:50:20 - LMT 1890
1:00 C-Eur CE%sT 1945 Apr 2 2:00
1:00 Denmark CE%sT 1980
1:00 EU CE%sT
+
+# Faroe Is
+# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
0:00 - WET 1981
0:00 EU WE%sT
+
+# Greenland
#
# From Paul Eggert (2004-10-31):
# During World War II, Germany maintained secret manned weather stations in
@@ -1192,7 +1162,29 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
# "National Park" by Executive Order:
# http://naalakkersuisut.gl/~/media/Nanoq/Files/Attached%20Files/Engelske-tekster/Legislation/Executive%20Order%20National%20Park.rtf
# It is their only National Park.
-#
+
+# From Jonas Nyrup (2022-11-24):
+# On last Saturday in October 2023 when DST ends America/Nuuk will switch
+# from -03/-02 to -02/-01
+# https://sermitsiaq.ag/forslagtidsforskel-danmark-mindskes-sommertid-beholdes
+# ...
+# https://sermitsiaq.ag/groenland-skifte-tidszone-trods-bekymringer
+#
+# From Jürgen Appel (2022-11-25):
+# https://ina.gl/samlinger/oversigt-over-samlinger/samling/dagsordener/dagsorden.aspx?lang=da&day=24-11-2022
+#
+# From Thomas M. Steenholdt (2022-12-02):
+# - The bill to move America/Nuuk from UTC-03 to UTC-02 passed.
+# - The bill to stop observing DST did not (Greenland will stop observing DST
+# when EU does).
+# Details on the implementation are here (section 6):
+# https://ina.gl/dvd/EM%202022/pdf/media/2553529/pkt17_em2022_tidens_bestemmelse_bem_da.pdf
+# This is how the change will be implemented:
+# 1. The shift *to* DST in 2023 happens as normal.
+# 2. The shift *from* DST in 2023 happens as normal, but coincides with the
+# shift to UTC-02 normaltime (people will not change their clocks here).
+# 3. After this, DST is still observed, but as -02/-01 instead of -03/-02.
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Thule 1991 1992 - Mar lastSun 2:00 1:00 D
Rule Thule 1991 1992 - Sep lastSun 2:00 0 S
@@ -1215,7 +1207,8 @@ Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit
-1:00 EU -01/+00
Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb
-3:00 - -03 1980 Apr 6 2:00
- -3:00 EU -03/-02
+ -3:00 EU -03/-02 2023 Oct 29 1:00u
+ -2:00 EU -02/-01
Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik
-4:00 Thule A%sT
@@ -1330,10 +1323,10 @@ Rule Finland 1942 only - Oct 4 1:00 0 -
Rule Finland 1981 1982 - Mar lastSun 2:00 1:00 S
Rule Finland 1981 1982 - Sep lastSun 3:00 0 -
-# Milne says Helsinki (Helsingfors) time was 1:39:49.2 (official document);
-# round to nearest.
+# Milne says Helsinki (Helsingfors) time was 1:39:49.2 (official document).
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF 1:39:49.2
Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
1:39:49 - HMT 1921 May # Helsinki Mean Time
2:00 Finland EE%sT 1983
@@ -1342,7 +1335,6 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
# Åland Is
Link Europe/Helsinki Europe/Mariehamn
-
# France
# From Ciro Discepolo (2000-12-20):
@@ -1500,13 +1492,59 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 16
# this was equivalent to UT +03, not +04.
+# From Steffen Thorsen (2001-05-01):
+# Although I could not find it explicitly, it seems that Jan Mayen and
+# Svalbard have been using the same time as Norway at least since the
+# time they were declared as parts of Norway. Svalbard was declared
+# as a part of Norway by law of 1925-07-17 no 11, section 4 and Jan
+# Mayen by law of 1930-02-27 no 2, section 2. (From
+# <http://www.lovdata.no/all/nl-19250717-011.html> and
+# <http://www.lovdata.no/all/nl-19300227-002.html>). The law/regulation
+# for normal/standard time in Norway is from 1894-06-29 no 1 (came
+# into operation on 1895-01-01) and Svalbard/Jan Mayen seem to be a
+# part of this law since 1925/1930. (From
+# <http://www.lovdata.no/all/nl-18940629-001.html>) I have not been
+# able to find if Jan Mayen used a different time zone (e.g. -0100)
+# before 1930. Jan Mayen has only been "inhabited" since 1921 by
+# Norwegian meteorologists and maybe used the same time as Norway ever
+# since 1921. Svalbard (Arctic/Longyearbyen) has been inhabited since
+# before 1895, and therefore probably changed the local time somewhere
+# between 1895 and 1925 (inclusive).
+
+# From Paul Eggert (2013-09-04):
+#
+# Actually, Jan Mayen was never occupied by Germany during World War II,
+# so it must have diverged from Oslo time during the war, as Oslo was
+# keeping Berlin time.
+#
+# <https://www.jan-mayen.no/history.htm> says that the meteorologists
+# burned down their station in 1940 and left the island, but returned in
+# 1941 with a small Norwegian garrison and continued operations despite
+# frequent air attacks from Germans. In 1943 the Americans established a
+# radiolocating station on the island, called "Atlantic City". Possibly
+# the UT offset changed during the war, but I think it unlikely that
+# Jan Mayen used German daylight-saving rules.
+#
+# Svalbard is more complicated, as it was raided in August 1941 by an
+# Allied party that evacuated the civilian population to England (says
+# <http://www.bartleby.com/65/sv/Svalbard.html>). The Svalbard FAQ
+# <http://www.svalbard.com/SvalbardFAQ.html> says that the Germans were
+# expelled on 1942-05-14. However, small parties of Germans did return,
+# and according to Wilhelm Dege's book "War North of 80" (1954)
+# http://www.ucalgary.ca/UofC/departments/UP/1-55238/1-55238-110-2.html
+# the German armed forces at the Svalbard weather station code-named
+# Haudegen did not surrender to the Allies until September 1945.
+#
+# All these events predate our cutoff date of 1970, so use Europe/Berlin
+# for these regions.
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Germany 1946 only - Apr 14 2:00s 1:00 S
Rule Germany 1946 only - Oct 7 2:00s 0 -
Rule Germany 1947 1949 - Oct Sun>=1 2:00s 0 -
-# http://www.ptb.de/de/org/4/44/441/salt.htm says the following transition
-# occurred at 3:00 MEZ, not the 2:00 MEZ given in Shanks & Pottenger.
-# Go with the PTB.
+# https://www.ptb.de/cms/en/ptb/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany/dst-and-midsummer-dst-in-germany-until-1979.html
+# says the following transition occurred at 3:00 MEZ, not the 2:00 MEZ
+# given in Shanks & Pottenger. Go with the PTB.
Rule Germany 1947 only - Apr 6 3:00s 1:00 S
Rule Germany 1947 only - May 11 2:00s 2:00 M
Rule Germany 1947 only - Jun 29 3:00 1:00 S
@@ -1524,21 +1562,6 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 Germany CE%sT 1980
1:00 EU CE%sT
-# From Tobias Conradi (2011-09-12):
-# Büsingen <http://www.buesingen.de>, surrounded by the Swiss canton
-# Schaffhausen, did not start observing DST in 1980 as the rest of DE
-# (West Germany at that time) and DD (East Germany at that time) did.
-# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
-# which in turn is covered by the zone Europe/Berlin.
-#
-# Source for the time in Büsingen 1980:
-# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
-
-# From Arthur David Olson (2012-03-03):
-# Büsingen and Zurich have shared clocks since 1970.
-
-Link Europe/Zurich Europe/Busingen
-
# Georgia
# Please see the "asia" file for Asia/Tbilisi.
# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
@@ -1546,7 +1569,7 @@ Link Europe/Zurich Europe/Busingen
# Gibraltar
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2 0:00s
+Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2
0:00 GB-Eire %s 1957 Apr 14 2:00
1:00 - CET 1982
1:00 EU CE%sT
@@ -1657,38 +1680,6 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1
1:00 EU CE%sT
# Iceland
-#
-# From Adam David (1993-11-06):
-# The name of the timezone in Iceland for system / mail / news purposes is GMT.
-#
-# (1993-12-05):
-# This material is paraphrased from the 1988 edition of the University of
-# Iceland Almanak.
-#
-# From January 1st, 1908 the whole of Iceland was standardised at 1 hour
-# behind GMT. Previously, local mean solar time was used in different parts
-# of Iceland, the almanak had been based on Reykjavík mean solar time which
-# was 1 hour and 28 minutes behind GMT.
-#
-# "first day of winter" referred to [below] means the first day of the 26 weeks
-# of winter, according to the old icelandic calendar that dates back to the
-# time the norsemen first settled Iceland. The first day of winter is always
-# Saturday, but is not dependent on the Julian or Gregorian calendars.
-#
-# (1993-12-10):
-# I have a reference from the Oxford Icelandic-English dictionary for the
-# beginning of winter, which ties it to the ecclesiastical calendar (and thus
-# to the julian/gregorian calendar) over the period in question.
-# the winter begins on the Saturday next before St. Luke's day
-# (old style), or on St. Luke's day, if a Saturday.
-# St. Luke's day ought to be traceable from ecclesiastical sources. "old style"
-# might be a reference to the Julian calendar as opposed to Gregorian, or it
-# might mean something else (???).
-#
-# From Paul Eggert (2014-11-22):
-# The information below is taken from the 1988 Almanak; see
-# http://www.almanak.hi.is/klukkan.html
-#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Iceland 1917 1919 - Feb 19 23:00 1:00 -
Rule Iceland 1917 only - Oct 21 1:00 0 -
@@ -1709,6 +1700,7 @@ Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 -
Rule Iceland 1949 only - Oct 30 1:00s 0 -
Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 -
Rule Iceland 1967 only - Oct 29 1:00s 0 -
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Atlantic/Reykjavik -1:28 - LMT 1908
-1:00 Iceland -01/+00 1968 Apr 7 1:00s
@@ -1828,7 +1820,7 @@ Rule Italy 1978 only - Oct 1 0:00s 0 -
Rule Italy 1979 only - Sep 30 0:00s 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Rome 0:49:56 - LMT 1866 Dec 12
- 0:49:56 - RMT 1893 Oct 31 23:49:56 # Rome Mean
+ 0:49:56 - RMT 1893 Oct 31 23:00u # Rome Mean
1:00 Italy CE%sT 1943 Sep 10
1:00 C-Eur CE%sT 1944 Jun 4
1:00 Italy CE%sT 1980
@@ -1837,10 +1829,6 @@ Zone Europe/Rome 0:49:56 - LMT 1866 Dec 12
# Kosovo
# See Europe/Belgrade.
-
-Link Europe/Rome Europe/Vatican
-Link Europe/Rome Europe/San_Marino
-
# Latvia
# From Liene Kanepe (1998-09-17):
@@ -1924,21 +1912,11 @@ Zone Europe/Riga 1:36:34 - LMT 1880
2:00 EU EE%sT
# Liechtenstein
-
-# From Paul Eggert (2013-09-09):
-# Shanks & Pottenger say Vaduz is like Zurich.
-
-# From Alois Treindl (2019-07-04):
-# I was able to access the online archive of the Vaduz paper Vaterland ...
-# I could confirm from the paper that Liechtenstein did in fact follow
-# the same DST in 1941 and 1942 as Switzerland did.
-
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun
1:00 Swiss CE%sT 1981
1:00 EU CE%sT
-
# Lithuania
# From Paul Eggert (2016-03-18):
@@ -1992,8 +1970,6 @@ Zone Europe/Vilnius 1:41:16 - LMT 1880
2:00 EU EE%sT
# Luxembourg
-# Whitman disagrees with most of these dates in minor ways;
-# go with Shanks & Pottenger.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Lux 1916 only - May 14 23:00 1:00 S
Rule Lux 1916 only - Oct 1 1:00 0 -
@@ -2018,6 +1994,7 @@ Rule Lux 1926 only - Apr 17 23:00 1:00 S
Rule Lux 1927 only - Apr 9 23:00 1:00 S
Rule Lux 1928 only - Apr 14 23:00 1:00 S
Rule Lux 1929 only - Apr 20 23:00 1:00 S
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
1:00 Lux CE%sT 1918 Nov 25
@@ -2050,7 +2027,7 @@ Rule Malta 1975 1979 - Apr Sun>=15 2:00 1:00 S
Rule Malta 1975 1980 - Sep Sun>=15 2:00 0 -
Rule Malta 1980 only - Mar 31 2:00 1:00 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
+Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
1:00 Italy CE%sT 1973 Mar 31
1:00 Malta CE%sT 1981
1:00 EU CE%sT
@@ -2132,21 +2109,6 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
2:00 Moldova EE%sT
# Monaco
-#
-# From Michael Deckers (2020-06-12):
-# In the "Journal de Monaco" of 1892-05-24, online at
-# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/b1c67c12c5af11b41ea888fb048e4fe8.pdf
-# we read: ...
-# [In virtue of a Sovereign Ordinance of the May 13 of the current [year],
-# legal time in the Principality will be set to, from the date of June 1,
-# 1892 onwards, to the meridian of Paris, as in France.]
-# In the "Journal de Monaco" of 1911-03-28, online at
-# https://journaldemonaco.gouv.mc/var/jdm/storage/original/application/de74ffb7db53d4f599059fe8f0ed482a.pdf
-# we read an ordinance of 1911-03-16: ...
-# [Legal time in the Principality will be set, from the date of promulgation
-# of the present ordinance, to legal time in France.... Consequently, legal
-# time will be retarded by 9 minutes and 21 seconds.]
-#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Monaco 0:29:32 - LMT 1892 Jun 1
0:09:21 - PMT 1911 Mar 29 # Paris Mean Time
@@ -2158,49 +2120,6 @@ Zone Europe/Monaco 0:29:32 - LMT 1892 Jun 1
Link Europe/Belgrade Europe/Podgorica
# Netherlands
-
-# Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
-# but for other purposes the Netherlands used Amsterdam mean time.
-
-# However, Robert H. van Gent writes (2001-04-01):
-# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
-# Amsterdam mean time) onwards, the whole of the Netherlands (including
-# the Dutch railways) was required by law to observe Amsterdam mean time
-# (19 minutes 32.13 seconds ahead of GMT). This had already been the
-# common practice (except for the railways) for many decades but it was
-# not until 1909 when the Dutch government finally defined this by law.
-# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
-# was generally known as Dutch Time ("Nederlandse Tijd").
-#
-# (2001-04-08):
-# 1892-05-01 was the date when the Dutch railways were by law required to
-# observe GMT while the remainder of the Netherlands adhered to the common
-# practice of following Amsterdam mean time.
-#
-# (2001-04-09):
-# In 1835 the authorities of the province of North Holland requested the
-# municipal authorities of the towns and cities in the province to observe
-# Amsterdam mean time but I do not know in how many cases this request was
-# actually followed.
-#
-# From 1852 onwards the Dutch telegraph offices were by law required to
-# observe Amsterdam mean time. As the time signals from the observatory of
-# Leiden were also distributed by the telegraph system, I assume that most
-# places linked up with the telegraph (and railway) system automatically
-# adopted Amsterdam mean time.
-#
-# Although the early Dutch railway companies initially observed a variety
-# of times, most of them had adopted Amsterdam mean time by 1858 but it
-# was not until 1866 when they were all required by law to observe
-# Amsterdam mean time.
-
-# The data entries before 1945 are taken from
-# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
-
-# From Paul Eggert (2021-05-09):
-# I invented the abbreviations AMT for Amsterdam Mean Time and NST for
-# Netherlands Summer Time, used in the Netherlands from 1835 to 1937.
-
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
Rule Neth 1916 only - Oct 1 0:00 0 AMT # Amsterdam Mean Time
@@ -2224,9 +2143,8 @@ Rule Neth 1937 1939 - Oct Sun>=2 2:00s 0 -
Rule Neth 1938 1939 - May 15 2:00s 1:00 S
Rule Neth 1945 only - Apr 2 2:00s 1:00 S
Rule Neth 1945 only - Sep 16 2:00s 0 -
-#
-# Amsterdam Mean Time was +00:19:32.13, but the .13 is omitted
-# below because the current format requires STDOFF to be an integer.
+ #STDOFF 0:19:32.13
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Amsterdam 0:19:32 - LMT 1835
0:19:32 Neth %s 1937 Jul 1
@@ -2236,8 +2154,6 @@ Zone Europe/Amsterdam 0:19:32 - LMT 1835
1:00 EU CE%sT
# Norway
-# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
-# Pottenger.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Norway 1916 only - May 22 1:00 1:00 S
Rule Norway 1916 only - Sep 30 0:00 0 -
@@ -2246,6 +2162,7 @@ Rule Norway 1945 only - Oct 1 2:00s 0 -
Rule Norway 1959 1964 - Mar Sun>=15 2:00s 1:00 S
Rule Norway 1959 1965 - Sep Sun>=15 2:00s 0 -
Rule Norway 1965 only - Apr 25 2:00s 1:00 S
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
1:00 Norway CE%sT 1940 Aug 10 23:00
@@ -2254,52 +2171,6 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
1:00 EU CE%sT
# Svalbard & Jan Mayen
-
-# From Steffen Thorsen (2001-05-01):
-# Although I could not find it explicitly, it seems that Jan Mayen and
-# Svalbard have been using the same time as Norway at least since the
-# time they were declared as parts of Norway. Svalbard was declared
-# as a part of Norway by law of 1925-07-17 no 11, section 4 and Jan
-# Mayen by law of 1930-02-27 no 2, section 2. (From
-# <http://www.lovdata.no/all/nl-19250717-011.html> and
-# <http://www.lovdata.no/all/nl-19300227-002.html>). The law/regulation
-# for normal/standard time in Norway is from 1894-06-29 no 1 (came
-# into operation on 1895-01-01) and Svalbard/Jan Mayen seem to be a
-# part of this law since 1925/1930. (From
-# <http://www.lovdata.no/all/nl-18940629-001.html>) I have not been
-# able to find if Jan Mayen used a different time zone (e.g. -0100)
-# before 1930. Jan Mayen has only been "inhabited" since 1921 by
-# Norwegian meteorologists and maybe used the same time as Norway ever
-# since 1921. Svalbard (Arctic/Longyearbyen) has been inhabited since
-# before 1895, and therefore probably changed the local time somewhere
-# between 1895 and 1925 (inclusive).
-
-# From Paul Eggert (2013-09-04):
-#
-# Actually, Jan Mayen was never occupied by Germany during World War II,
-# so it must have diverged from Oslo time during the war, as Oslo was
-# keeping Berlin time.
-#
-# <https://www.jan-mayen.no/history.htm> says that the meteorologists
-# burned down their station in 1940 and left the island, but returned in
-# 1941 with a small Norwegian garrison and continued operations despite
-# frequent air attacks from Germans. In 1943 the Americans established a
-# radiolocating station on the island, called "Atlantic City". Possibly
-# the UT offset changed during the war, but I think it unlikely that
-# Jan Mayen used German daylight-saving rules.
-#
-# Svalbard is more complicated, as it was raided in August 1941 by an
-# Allied party that evacuated the civilian population to England (says
-# <http://www.bartleby.com/65/sv/Svalbard.html>). The Svalbard FAQ
-# <http://www.svalbard.com/SvalbardFAQ.html> says that the Germans were
-# expelled on 1942-05-14. However, small parties of Germans did return,
-# and according to Wilhelm Dege's book "War North of 80" (1954)
-# http://www.ucalgary.ca/UofC/departments/UP/1-55238/1-55238-110-2.html
-# the German armed forces at the Svalbard weather station code-named
-# Haudegen did not surrender to the Allies until September 1945.
-#
-# All these events predate our cutoff date of 1970, so use Europe/Oslo
-# for these regions.
Link Europe/Oslo Arctic/Longyearbyen
# Poland
@@ -2354,7 +2225,6 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# According to a Portuguese decree (1911-05-26)
# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
-# Round the old offset to -0:36:45. This agrees with Willett....
#
# From Michael Deckers (2018-02-15):
# article 5 [of the 1911 decree; Deckers's translation] ...:
@@ -2441,6 +2311,7 @@ Rule Port 1981 1982 - Mar lastSun 1:00s 1:00 S
Rule Port 1983 only - Mar lastSun 2:00s 1:00 S
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -0:36:44.68
Zone Europe/Lisbon -0:36:45 - LMT 1884
-0:36:45 - LMT 1912 Jan 1 0:00u # Lisbon MT
0:00 Port WE%sT 1966 Apr 3 2:00
@@ -2449,9 +2320,13 @@ Zone Europe/Lisbon -0:36:45 - LMT 1884
0:00 W-Eur WE%sT 1992 Sep 27 1:00s
1:00 EU CE%sT 1996 Mar 31 1:00u
0:00 EU WE%sT
-# This Zone can be simplified once we assume zic %z.
Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada
-1:54:32 - HMT 1912 Jan 1 2:00u # Horta MT
+# Vanguard section, for zic and other parsers that support %z.
+# -2:00 Port %z 1966 Apr 3 2:00
+# -1:00 Port %z 1983 Sep 25 1:00s
+# -1:00 W-Eur %z 1992 Sep 27 1:00s
+# Rearguard section, for parsers lacking %z; see ziguard.awk.
-2:00 Port -02/-01 1942 Apr 25 22:00s
-2:00 Port +00 1942 Aug 15 22:00s
-2:00 Port -02/-01 1943 Apr 17 22:00s
@@ -2463,11 +2338,14 @@ Zone Atlantic/Azores -1:42:40 - LMT 1884 # Ponta Delgada
-2:00 Port -02/-01 1966 Apr 3 2:00
-1:00 Port -01/+00 1983 Sep 25 1:00s
-1:00 W-Eur -01/+00 1992 Sep 27 1:00s
+# End of rearguard section.
0:00 EU WE%sT 1993 Mar 28 1:00u
-1:00 EU -01/+00
-# This Zone can be simplified once we assume zic %z.
Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
-1:07:36 - FMT 1912 Jan 1 1:00u # Funchal MT
+# Vanguard section, for zic and other parsers that support %z.
+# -1:00 Port %z 1966 Apr 3 2:00
+# Rearguard section, for parsers lacking %z; see ziguard.awk.
-1:00 Port -01/+00 1942 Apr 25 22:00s
-1:00 Port +01 1942 Aug 15 22:00s
-1:00 Port -01/+00 1943 Apr 17 22:00s
@@ -2477,6 +2355,7 @@ Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
-1:00 Port -01/+00 1945 Apr 21 22:00s
-1:00 Port +01 1945 Aug 25 22:00s
-1:00 Port -01/+00 1966 Apr 3 2:00
+# End of rearguard section.
0:00 Port WE%sT 1983 Sep 25 1:00s
0:00 EU WE%sT
@@ -2569,7 +2448,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# the State Duma has approved ... the draft bill on returning to
# winter time standard and return Russia 11 time zones. The new
# regulations will come into effect on October 26, 2014 at 02:00 ...
-# http://asozd2.duma.gov.ru/main.nsf/%28Spravka%29?OpenAgent&RN=431985-6&02
+# http://asozd2.duma.gov.ru/main.nsf/(Spravka)?OpenAgent&RN=431985-6&02
# Here is a link where we put together table (based on approved Bill N
# 431985-6) with proposed 11 Russian time zones and corresponding
# areas/cities/administrative centers in the Russian Federation (in English):
@@ -2895,28 +2774,31 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
2:00 - EET 1992 Mar 20
# Central Crimea used Moscow time 1994/1997.
#
-# From Paul Eggert (2006-03-22):
-# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
-# from Kiev to Moscow time sometime after the January 1994 elections.
+# From Paul Eggert (2022-07-21):
+# The _Economist_ (1994-05-28, p 45) reported that central Crimea switched
+# from Kyiv to Moscow time sometime after the January 1994 elections.
# Shanks (1999) says "date of change uncertain", but implies that it happened
# sometime between the 1994 DST switches. Shanks & Pottenger simply say
# 1994-09-25 03:00, but that can't be right. For now, guess it
-# changed in May.
+# changed in May. This change evidently didn't last long; see below.
2:00 C-Eur EE%sT 1994 May
-# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
- 3:00 E-Eur MSK/MSD 1996 Mar 31 0:00s
+# From IATA SSIM (1994/1997), which also said that Kerch is still like Kyiv.
+ 3:00 C-Eur MSK/MSD 1996 Mar 31 0:00s
3:00 1:00 MSD 1996 Oct 27 3:00s
-# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
+# IATA SSIM (1997-09) said Crimea switched to EET/EEST.
# Assume it happened in March by not changing the clocks.
- 3:00 Russia MSK/MSD 1997
3:00 - MSK 1997 Mar lastSun 1:00u
# From Alexander Krivenyshev (2014-03-17):
# time change at 2:00 (2am) on March 30, 2014
# https://vz.ru/news/2014/3/17/677464.html
-# From Paul Eggert (2014-03-30):
-# Simferopol and Sevastopol reportedly changed their central town clocks
-# late the previous day, but this appears to have been ceremonial
-# and the discrepancies are small enough to not worry about.
+# From Tim Parenti (2022-07-01), per Paul Eggert (2014-03-30):
+# The clocks at the railway station in Simferopol were put forward from 22:00
+# to 24:00 the previous day in a "symbolic ceremony"; however, per
+# contemporaneous news reports, "ordinary Crimeans [made] the daylight savings
+# time switch at 2am" on Sunday.
+# https://www.business-standard.com/article/pti-stories/crimea-to-set-clocks-to-russia-time-114033000014_1.html
+# https://www.reuters.com/article/us-ukraine-crisis-crimea-time/crimea-switches-to-moscow-time-amid-incorporation-frenzy-idUKBREA2S0LT20140329
+# https://www.bbc.com/news/av/world-europe-26806583
2:00 EU EE%sT 2014 Mar 30 2:00
4:00 - MSK 2014 Oct 26 2:00s
3:00 - MSK
@@ -2976,13 +2858,13 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
3:00 - +03 1930 Jun 21
4:00 - +04 1961 Nov 11
4:00 Russia +04/+05 1988 Mar 27 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
+ 3:00 Russia MSK/MSD 1991 Mar 31 2:00s
4:00 - +04 1992 Mar 29 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04 2014 Oct 26 2:00s
- 3:00 - +03 2018 Oct 28 2:00s
+ 3:00 Russia MSK/MSD 2011 Mar 27 2:00s
+ 4:00 - MSK 2014 Oct 26 2:00s
+ 3:00 - MSK 2018 Oct 28 2:00s
4:00 - +04 2020 Dec 27 2:00s
- 3:00 - +03
+ 3:00 - MSK
# From Paul Eggert (2016-11-11):
# Europe/Saratov covers:
@@ -3013,11 +2895,11 @@ Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u
Zone Europe/Kirov 3:18:48 - LMT 1919 Jul 1 0:00u
3:00 - +03 1930 Jun 21
4:00 Russia +04/+05 1989 Mar 26 2:00s
- 3:00 Russia +03/+04 1991 Mar 31 2:00s
+ 3:00 Russia MSK/MSD 1991 Mar 31 2:00s
4:00 - +04 1992 Mar 29 2:00s
- 3:00 Russia +03/+04 2011 Mar 27 2:00s
- 4:00 - +04 2014 Oct 26 2:00s
- 3:00 - +03
+ 3:00 Russia MSK/MSD 2011 Mar 27 2:00s
+ 4:00 - MSK 2014 Oct 26 2:00s
+ 3:00 - MSK
# From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2001-08-25):
# Europe/Samara covers...
@@ -3077,11 +2959,12 @@ Zone Europe/Ulyanovsk 3:13:36 - LMT 1919 Jul 1 0:00u
# Note: Effective 2005-12-01, (59) Perm Oblast and (81) Komi-Permyak
# Autonomous Okrug merged to form (90, RU-PER) Perm Krai.
-# Milne says Yekaterinburg was 4:02:32.9; round to nearest.
+# Milne says Yekaterinburg was 4:02:32.9.
# Byalokoz 1919 says its provincial time was based on Perm, at 3:45:05.
# Assume it switched on 1916-07-03, the time of the new standard.
# The 1919 and 1930 transitions are from Shanks.
+ #STDOFF 4:02:32.9
Zone Asia/Yekaterinburg 4:02:33 - LMT 1916 Jul 3
3:45:05 - PMT 1919 Jul 15 4:00
4:00 - +04 1930 Jun 21
@@ -3393,8 +3276,8 @@ Zone Asia/Vladivostok 8:47:31 - LMT 1922 Nov 15
# 14-28 **** Tomponsky District
# 14-30 **** Ust-Maysky District
-# From Arthur David Olson (2012-05-09):
-# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
+# From Arthur David Olson (2022-03-21):
+# Tomponsky and Ust-Maysky switched from Vladivostok time to Yakutsk time
# in 2011.
# From Paul Eggert (2012-11-25):
@@ -3519,8 +3402,8 @@ Zone Asia/Srednekolymsk 10:14:52 - LMT 1924 May 2
# Asia/Ust-Nera covers parts of (14, RU-SA) Sakha (Yakutia) Republic:
# 14-22 **** Oymyakonsky District
-# From Arthur David Olson (2012-05-09):
-# Ojmyakonskij [and the Kuril Islands] switched from
+# From Arthur David Olson (2022-03-21):
+# Oymyakonsky and the Kuril Islands switched from
# Magadan time to Vladivostok time in 2011.
#
# From Tim Parenti (2014-07-06), per Alexander Krivenyshev (2014-07-02):
@@ -3571,9 +3454,8 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2
11:00 Russia +11/+12 2011 Mar 27 2:00s
12:00 - +12
-
# San Marino
-# See Europe/Rome.
+Link Europe/Rome Europe/San_Marino
# Serbia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -3589,7 +3471,7 @@ Zone Europe/Belgrade 1:22:00 - LMT 1884
1:00 EU CE%sT
# Slovakia
-Link Europe/Prague Europe/Bratislava
+Link Europe/Prague Europe/Bratislava
# Slovenia
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -3684,11 +3566,11 @@ Rule SpainAfrica 1977 only - Sep 28 0:00 0 -
Rule SpainAfrica 1978 only - Jun 1 0:00 1:00 S
Rule SpainAfrica 1978 only - Aug 4 0:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Europe/Madrid -0:14:44 - LMT 1900 Dec 31 23:45:16
+Zone Europe/Madrid -0:14:44 - LMT 1901 Jan 1 0:00u
0:00 Spain WE%sT 1940 Mar 16 23:00
1:00 Spain CE%sT 1979
1:00 EU CE%sT
-Zone Africa/Ceuta -0:21:16 - LMT 1900 Dec 31 23:38:44
+Zone Africa/Ceuta -0:21:16 - LMT 1901 Jan 1 0:00u
0:00 - WET 1918 May 6 23:00
0:00 1:00 WEST 1918 Oct 7 23:00
0:00 - WET 1924
@@ -3706,54 +3588,6 @@ Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
# Ignore this for now, as the Canaries are part of the EU.
# Sweden
-
-# From Ivan Nilsson (2001-04-13), superseding Shanks & Pottenger:
-#
-# The law "Svensk författningssamling 1878, no 14" about standard time in 1879:
-# From the beginning of 1879 (that is 01-01 00:00) the time for all
-# places in the country is "the mean solar time for the meridian at
-# three degrees, or twelve minutes of time, to the west of the
-# meridian of the Observatory of Stockholm". The law is dated 1878-05-31.
-#
-# The observatory at that time had the meridian 18° 03' 30"
-# eastern longitude = 01:12:14 in time. Less 12 minutes gives the
-# national standard time as 01:00:14 ahead of GMT....
-#
-# About the beginning of CET in Sweden. The lawtext ("Svensk
-# författningssamling 1899, no 44") states, that "from the beginning
-# of 1900... ... the same as the mean solar time for the meridian at
-# the distance of one hour of time from the meridian of the English
-# observatory at Greenwich, or at 12 minutes 14 seconds to the west
-# from the meridian of the Observatory of Stockholm". The law is dated
-# 1899-06-16. In short: At 1900-01-01 00:00:00 the new standard time
-# in Sweden is 01:00:00 ahead of GMT.
-#
-# 1916: The lawtext ("Svensk författningssamling 1916, no 124") states
-# that "1916-05-15 is considered to begin one hour earlier". It is
-# pretty obvious that at 05-14 23:00 the clocks are set to 05-15 00:00....
-# Further the law says, that "1916-09-30 is considered to end one hour later".
-#
-# The laws regulating [DST] are available on the site of the Swedish
-# Parliament beginning with 1985 - the laws regulating 1980/1984 are
-# not available on the site (to my knowledge they are only available
-# in Swedish): <http://www.riksdagen.se/english/work/sfst.asp> (type
-# "sommartid" without the quotes in the field "Fritext" and then click
-# the Sök-button).
-#
-# (2001-05-13):
-#
-# I have now found a newspaper stating that at 1916-10-01 01:00
-# summertime the church-clocks etc were set back one hour to show
-# 1916-10-01 00:00 standard time. The article also reports that some
-# people thought the switch to standard time would take place already
-# at 1916-10-01 00:00 summer time, but they had to wait for another
-# hour before the event took place.
-#
-# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
-
-# An extra-special abbreviation style is SET for Swedish Time (svensk
-# normaltid) 1879-1899, 3° west of the Stockholm Observatory.
-
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
1:00:14 - SET 1900 Jan 1 # Swedish Time
@@ -3854,6 +3688,19 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
# 1853-07-16, though it probably occurred at some other date in Zurich, and
# legal civil time probably changed at still some other transition date.
+# From Tobias Conradi (2011-09-12):
+# Büsingen <http://www.buesingen.de>, surrounded by the Swiss canton
+# Schaffhausen, did not start observing DST in 1980 as the rest of DE
+# (West Germany at that time) and DD (East Germany at that time) did.
+# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
+# which in turn is covered by the zone Europe/Berlin.
+#
+# Source for the time in Büsingen 1980:
+# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
+#
+# From Arthur David Olson (2012-03-03):
+# Büsingen and Zurich have shared clocks since 1970.
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
@@ -3862,6 +3709,7 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
0:29:46 - BMT 1894 Jun # Bern Mean Time
1:00 Swiss CE%sT 1981
1:00 EU CE%sT
+Link Europe/Zurich Europe/Busingen
# Turkey
@@ -4066,11 +3914,10 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
2:00 1:00 EEST 2015 Nov 8 1:00u
2:00 EU EE%sT 2016 Sep 7
3:00 - +03
-Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine
#
-# From Alois Triendl (2014-03-01):
+# From Alois Treindl (2014-03-01):
# REGULATION A N O V A on March 20, 1992 N 139 ... means that from
# 1992 on, Ukraine had DST with begin time at 02:00 am, on last Sunday
# in March, and end time 03:00 am, last Sunday in September....
@@ -4087,8 +3934,8 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# US colleague David Cochrane) are still trying to get more
# information upon these local deviations from Kiev rules.
#
-# From Paul Eggert (2022-02-08):
-# For now, assume that Ukraine's other three zones followed the same rules,
+# From Paul Eggert (2022-08-27):
+# For now, assume that Ukraine's zones all followed the same rules,
# except that Crimea switched to Moscow time in 1994 as described elsewhere.
# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
@@ -4130,7 +3977,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# The law documents themselves are at
# http://w1.c1.rada.gov.ua/pls/zweb_n/webproc4_1?id=&pf3511=41484
-# From Vladimir in Moscow via Alois Treindl re Kiev time 1991/2 (2014-02-28):
+# From Vladimir in Moscow via Alois Treindl re Kyiv time 1991/2 (2014-02-28):
# First in Ukraine they changed Time zone from UTC+3 to UTC+2 with DST:
# 03 25 1990 02:00 -03.00 1 Time Zone 3 with DST
# 07 01 1990 02:00 -02.00 1 Time Zone 2 with DST
@@ -4158,23 +4005,9 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# * Ukrainian Government's Resolution of 20.03.1992, No. 139.
# http://www.uazakon.com/documents/date_8u/pg_grcasa.htm
-# From Paul Eggert (2018-10-03):
-# As is usual in tzdb, Ukrainian zones use the most common English spellings.
-# For example, tzdb uses Europe/Kiev, as "Kiev" is the most common spelling in
-# English for Ukraine's capital, even though it is certainly wrong as a
-# transliteration of the Ukrainian "Київ". This is similar to tzdb's use of
-# Europe/Prague, which is certainly wrong as a transliteration of the Czech
-# "Praha". ("Kiev" came from old Slavic via Russian to English, and "Prague"
-# came from old Slavic via French to English, so the two cases have something
-# in common.) Admittedly English-language spelling of Ukrainian names is
-# controversial, and some day "Kyiv" may become substantially more popular in
-# English; in the meantime, stick with the traditional English "Kiev" as that
-# means less disruption for our users.
-
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-# This represents most of Ukraine. See above for the spelling of "Kiev".
-Zone Europe/Kiev 2:02:04 - LMT 1880
- 2:02:04 - KMT 1924 May 2 # Kiev Mean Time
+Zone Europe/Kyiv 2:02:04 - LMT 1880
+ 2:02:04 - KMT 1924 May 2 # Kyiv Mean Time
2:00 - EET 1930 Jun 21
3:00 - MSK 1941 Sep 20
1:00 C-Eur CE%sT 1943 Nov 6
@@ -4182,37 +4015,10 @@ Zone Europe/Kiev 2:02:04 - LMT 1880
2:00 1:00 EEST 1991 Sep 29 3:00
2:00 C-Eur EE%sT 1996 May 13
2:00 EU EE%sT
-# Transcarpathia used CET 1990/1991.
-# "Uzhhorod" is the transliteration of the Rusyn/Ukrainian pronunciation, but
-# "Uzhgorod" is more common in English.
-Zone Europe/Uzhgorod 1:29:12 - LMT 1890 Oct
- 1:00 - CET 1940
- 1:00 C-Eur CE%sT 1944 Oct
- 1:00 1:00 CEST 1944 Oct 26
- 1:00 - CET 1945 Jun 29
- 3:00 Russia MSK/MSD 1990
- 3:00 - MSK 1990 Jul 1 2:00
- 1:00 - CET 1991 Mar 31 3:00
- 2:00 - EET 1992 Mar 20
- 2:00 C-Eur EE%sT 1996 May 13
- 2:00 EU EE%sT
-# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
-# "Zaporizhia" is the transliteration of the Ukrainian name, but
-# "Zaporozh'ye" is more common in English. Use the common English
-# spelling, except omit the apostrophe as it is not allowed in
-# portable Posix file names.
-Zone Europe/Zaporozhye 2:20:40 - LMT 1880
- 2:20 - +0220 1924 May 2
- 2:00 - EET 1930 Jun 21
- 3:00 - MSK 1941 Aug 25
- 1:00 C-Eur CE%sT 1943 Oct 25
- 3:00 Russia MSK/MSD 1991 Mar 31 2:00
- 2:00 E-Eur EE%sT 1992 Mar 20
- 2:00 C-Eur EE%sT 1996 May 13
- 2:00 EU EE%sT
# Vatican City
-# See Europe/Rome.
+Link Europe/Rome Europe/Vatican
+
###############################################################################
diff --git a/src/main/java/org/joda/time/tz/src/northamerica b/src/main/java/org/joda/time/tz/src/northamerica
index 693f8462..51c028fa 100644
--- a/src/main/java/org/joda/time/tz/src/northamerica
+++ b/src/main/java/org/joda/time/tz/src/northamerica
@@ -276,9 +276,10 @@ Zone PST8PDT -8:00 US P%sT
# -10 Standard Alaska Time (AST) Alaska-Hawaii standard time (AHST)
# -11 (unofficial) Nome (NST) Bering standard time (BST)
#
-# From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
+# From Paul Eggert (2023-01-23), from a 2001-01-08 heads-up from Rives McDow:
+# Public law 106-564 (2000-12-23) introduced "Chamorro standard time"
# for time in Guam and the Northern Marianas. See the file "australasia".
+# Also see 15 U.S.C. §263 <https://www.law.cornell.edu/uscode/text/15/263>.
#
# From Paul Eggert (2015-04-17):
# HST and HDT are standardized abbreviations for Hawaii-Aleutian
@@ -344,8 +345,7 @@ Zone PST8PDT -8:00 US P%sT
# From Paul Eggert (2014-09-06):
# Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
# says that New York City Hall time was 3 minutes 58.4 seconds fast of
-# Eastern time (i.e., -4:56:01.6) just before the 1883 switch. Round to the
-# nearest second.
+# Eastern time (i.e., -4:56:01.6) just before the 1883 switch.
# Rule NAME FROM TO - IN ON AT SAVE LETTER
Rule NYC 1920 only - Mar lastSun 2:00 1:00 D
@@ -354,7 +354,8 @@ Rule NYC 1921 1966 - Apr lastSun 2:00 1:00 D
Rule NYC 1921 1954 - Sep lastSun 2:00 0 S
Rule NYC 1955 1966 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
+ #STDOFF -4:56:01.6
+Zone America/New_York -4:56:02 - LMT 1883 Nov 18 17:00u
-5:00 US E%sT 1920
-5:00 NYC E%sT 1942
-5:00 US E%sT 1946
@@ -439,7 +440,7 @@ Rule Chicago 1922 1966 - Apr lastSun 2:00 1:00 D
Rule Chicago 1922 1954 - Sep lastSun 2:00 0 S
Rule Chicago 1955 1966 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 12:09:24
+Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1920
-6:00 Chicago C%sT 1936 Mar 1 2:00
-5:00 - EST 1936 Nov 15 2:00
@@ -448,7 +449,7 @@ Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 12:09:24
-6:00 Chicago C%sT 1967
-6:00 US C%sT
# Oliver County, ND switched from mountain to central time on 1992-10-25.
-Zone America/North_Dakota/Center -6:45:12 - LMT 1883 Nov 18 12:14:48
+Zone America/North_Dakota/Center -6:45:12 - LMT 1883 Nov 18 19:00u
-7:00 US M%sT 1992 Oct 25 2:00
-6:00 US C%sT
# Morton County, ND, switched from mountain to central time on
@@ -458,7 +459,7 @@ Zone America/North_Dakota/Center -6:45:12 - LMT 1883 Nov 18 12:14:48
# Jones, Mellette, and Todd Counties in South Dakota;
# but in practice these other counties were already observing central time.
# See <http://www.epa.gov/fedrgstr/EPA-IMPACT/2003/October/Day-28/i27056.htm>.
-Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
+Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 19:00u
-7:00 US M%sT 2003 Oct 26 2:00
-6:00 US C%sT
@@ -475,7 +476,7 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
# largest city in Mercer County). Google Maps places Beulah's city hall
# at 47° 15' 51" N, 101° 46' 40" W, which yields an offset of 6h47'07".
-Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
+Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 19:00u
-7:00 US M%sT 2010 Nov 7 2:00
-6:00 US C%sT
@@ -507,7 +508,7 @@ Rule Denver 1921 only - May 22 2:00 0 S
Rule Denver 1965 1966 - Apr lastSun 2:00 1:00 D
Rule Denver 1965 1966 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
+Zone America/Denver -6:59:56 - LMT 1883 Nov 18 19:00u
-7:00 US M%sT 1920
-7:00 Denver M%sT 1942
-7:00 US M%sT 1946
@@ -560,7 +561,7 @@ Rule CA 1950 1966 - Apr lastSun 1:00 1:00 D
Rule CA 1950 1961 - Sep lastSun 2:00 0 S
Rule CA 1962 1966 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
+Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 20:00u
-8:00 US P%sT 1946
-8:00 CA P%sT 1967
-8:00 US P%sT
@@ -595,7 +596,7 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# local times of other Alaskan locations so that they change simultaneously.
# From Paul Eggert (2014-07-18):
-# One opinion of the early-1980s turmoil in Alaska over time zones and
+# One opinion of the early 1980s turmoil in Alaska over time zones and
# daylight saving time appeared as graffiti on a Juneau airport wall:
# "Welcome to Juneau. Please turn your watch back to the 19th century."
# See: Turner W. Alaska's four time zones now two. NY Times 1983-11-01.
@@ -667,6 +668,10 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# So they won't be waiting for Alaska to join them on 2019-03-10, but will
# rather change their clocks twice in seven weeks.
+# From Paul Eggert (2023-01-23):
+# America/Adak is for the Aleutian Islands that are part of Alaska
+# and are west of 169.5° W.
+
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Juneau 15:02:19 - LMT 1867 Oct 19 15:33:32
-8:57:41 - LMT 1900 Aug 20 12:00
@@ -822,7 +827,7 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00
# Go with the Arizona State Library instead.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Phoenix -7:28:18 - LMT 1883 Nov 18 11:31:42
+Zone America/Phoenix -7:28:18 - LMT 1883 Nov 18 19:00u
-7:00 US M%sT 1944 Jan 1 0:01
-7:00 - MST 1944 Apr 1 0:01
-7:00 US M%sT 1944 Oct 1 0:01
@@ -849,7 +854,7 @@ Zone America/Phoenix -7:28:18 - LMT 1883 Nov 18 11:31:42
# switched four weeks late in 1974.
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Boise -7:44:49 - LMT 1883 Nov 18 12:15:11
+Zone America/Boise -7:44:49 - LMT 1883 Nov 18 20:00u
-8:00 US P%sT 1923 May 13 2:00
-7:00 US M%sT 1974
-7:00 - MST 1974 Feb 3 2:00
@@ -921,7 +926,7 @@ Rule Indianapolis 1941 only - Jun 22 2:00 1:00 D
Rule Indianapolis 1941 1954 - Sep lastSun 2:00 0 S
Rule Indianapolis 1946 1954 - Apr lastSun 2:00 1:00 D
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 12:15:22
+Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1920
-6:00 Indianapolis C%sT 1942
-6:00 US C%sT 1946
@@ -941,7 +946,7 @@ Rule Marengo 1951 only - Sep lastSun 2:00 0 S
Rule Marengo 1954 1960 - Apr lastSun 2:00 1:00 D
Rule Marengo 1954 1960 - Sep lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Marengo -5:45:23 - LMT 1883 Nov 18 12:14:37
+Zone America/Indiana/Marengo -5:45:23 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1951
-6:00 Marengo C%sT 1961 Apr 30 2:00
-5:00 - EST 1969
@@ -965,7 +970,7 @@ Rule Vincennes 1960 only - Oct lastSun 2:00 0 S
Rule Vincennes 1961 only - Sep lastSun 2:00 0 S
Rule Vincennes 1962 1963 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov 18 12:09:53
+Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1946
-6:00 Vincennes C%sT 1964 Apr 26 2:00
-5:00 - EST 1969
@@ -985,7 +990,7 @@ Rule Perry 1955 1960 - Sep lastSun 2:00 0 S
Rule Perry 1956 1963 - Apr lastSun 2:00 1:00 D
Rule Perry 1961 1963 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Tell_City -5:47:03 - LMT 1883 Nov 18 12:12:57
+Zone America/Indiana/Tell_City -5:47:03 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1946
-6:00 Perry C%sT 1964 Apr 26 2:00
-5:00 - EST 1967 Oct 29 2:00
@@ -1002,7 +1007,7 @@ Rule Pike 1955 1960 - Sep lastSun 2:00 0 S
Rule Pike 1956 1964 - Apr lastSun 2:00 1:00 D
Rule Pike 1961 1964 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Petersburg -5:49:07 - LMT 1883 Nov 18 12:10:53
+Zone America/Indiana/Petersburg -5:49:07 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1955
-6:00 Pike C%sT 1965 Apr 25 2:00
-5:00 - EST 1966 Oct 30 2:00
@@ -1024,7 +1029,7 @@ Rule Starke 1955 1956 - Oct lastSun 2:00 0 S
Rule Starke 1957 1958 - Sep lastSun 2:00 0 S
Rule Starke 1959 1961 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Knox -5:46:30 - LMT 1883 Nov 18 12:13:30
+Zone America/Indiana/Knox -5:46:30 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1947
-6:00 Starke C%sT 1962 Apr 29 2:00
-5:00 - EST 1963 Oct 27 2:00
@@ -1040,7 +1045,7 @@ Rule Pulaski 1946 1954 - Sep lastSun 2:00 0 S
Rule Pulaski 1955 1956 - Oct lastSun 2:00 0 S
Rule Pulaski 1957 1960 - Sep lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Winamac -5:46:25 - LMT 1883 Nov 18 12:13:35
+Zone America/Indiana/Winamac -5:46:25 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1946
-6:00 Pulaski C%sT 1961 Apr 30 2:00
-5:00 - EST 1969
@@ -1051,7 +1056,7 @@ Zone America/Indiana/Winamac -5:46:25 - LMT 1883 Nov 18 12:13:35
#
# Switzerland County, Indiana, did not observe DST from 1973 through 2005.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Indiana/Vevay -5:40:16 - LMT 1883 Nov 18 12:19:44
+Zone America/Indiana/Vevay -5:40:16 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1954 Apr 25 2:00
-5:00 - EST 1969
-5:00 US E%sT 1973
@@ -1087,7 +1092,7 @@ Rule Louisville 1950 1961 - Apr lastSun 2:00 1:00 D
Rule Louisville 1950 1955 - Sep lastSun 2:00 0 S
Rule Louisville 1956 1961 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone America/Kentucky/Louisville -5:43:02 - LMT 1883 Nov 18 12:16:58
+Zone America/Kentucky/Louisville -5:43:02 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1921
-6:00 Louisville C%sT 1942
-6:00 US C%sT 1946
@@ -1121,7 +1126,7 @@ Zone America/Kentucky/Louisville -5:43:02 - LMT 1883 Nov 18 12:16:58
# Federal Register 65, 160 (2000-08-17), pp 50154-50158.
# https://www.gpo.gov/fdsys/pkg/FR-2000-08-17/html/00-20854.htm
#
-Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
+Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 18:00u
-6:00 US C%sT 1946
-6:00 - CST 1968
-6:00 US C%sT 2000 Oct 29 2:00
@@ -1596,7 +1601,9 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
# Quebec
# From Paul Eggert (2020-01-10):
+# See America/Toronto for most of Quebec, including Montreal.
# See America/Halifax for the Îles de la Madeleine and the Listuguj reserve.
+# See America/Puerto_Rico for east of Natashquan.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Blanc-Sablon -3:48:28 - LMT 1884
-4:00 Canada A%sT 1970
@@ -1604,23 +1611,6 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# Ontario
-# From Paul Eggert (2006-07-09):
-# Shanks & Pottenger write that since 1970 most of Ontario has been like
-# Toronto.
-# Thunder Bay skipped DST in 1973.
-# Many smaller locales did not observe peacetime DST until 1974;
-# Nipigon (EST) and Rainy River (CST) are the largest that we know of.
-# Far west Ontario is like Winnipeg; far east Quebec is like Halifax.
-
-# From Jeffery Nichols (2020-02-06):
-# According to the [Shanks] atlas, those western Ontario zones are huge,
-# covering most of Ontario northwest of Sault Ste Marie and Timmins.
-# The zones seem to include towns bigger than the ones they're named after,
-# like Dryden in America/Rainy_River and Wawa (and maybe Attawapiskat) in
-# America/Nipigon. I assume it's too much trouble to change the name of the
-# zone (like when you found out that America/Glace_Bay includes Sydney, Nova
-# Scotia)....
-
# From Mark Brader (2003-07-26):
# [According to the Toronto Star] Orillia, Ontario, adopted DST
# effective Saturday, 1912-06-22, 22:00; the article mentions that
@@ -1641,17 +1631,6 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# From Mark Brader (2010-03-06):
#
-# Currently the database has:
-#
-# # Ontario
-#
-# # From Paul Eggert (2006-07-09):
-# # Shanks & Pottenger write that since 1970 most of Ontario has been like
-# # Toronto.
-# # Thunder Bay skipped DST in 1973.
-# # Many smaller locales did not observe peacetime DST until 1974;
-# # Nipigon (EST) and Rainy River (CST) are the largest that we know of.
-#
# In the (Toronto) Globe and Mail for Saturday, 1955-09-24, in the bottom
# right corner of page 1, it says that Toronto will return to standard
# time at 2 am Sunday morning (which agrees with the database), and that:
@@ -1659,10 +1638,8 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# The one-hour setback will go into effect throughout most of Ontario,
# except in areas like Windsor which remains on standard time all year.
#
-# Windsor is, of course, a lot larger than Nipigon.
-#
-# I only came across this incidentally. I don't know if Windsor began
-# observing DST when Detroit did, or in 1974, or on some other date.
+# ... I don't know if Windsor began observing DST when Detroit did,
+# or in 1974, or on some other date.
#
# By the way, the article continues by noting that:
#
@@ -1744,23 +1721,6 @@ Rule Toronto 1951 1956 - Sep lastSun 2:00 0 S
# Toronto Star, which said that DST was ending 1971-10-31 as usual.
Rule Toronto 1957 1973 - Oct lastSun 2:00 0 S
-# From Paul Eggert (2003-07-27):
-# Willett (1914-03) writes (p. 17) "In the Cities of Fort William, and
-# Port Arthur, Ontario, the principle of the Bill has been in
-# operation for the past three years, and in the City of Moose Jaw,
-# Saskatchewan, for one year."
-
-# From David Bryan via Tory Tronrud, Director/Curator,
-# Thunder Bay Museum (2003-11-12):
-# There is some suggestion, however, that, by-law or not, daylight
-# savings time was being practiced in Fort William and Port Arthur
-# before 1909.... [I]n 1910, the line between the Eastern and Central
-# Time Zones was permanently moved about two hundred miles west to
-# include the Thunder Bay area.... When Canada adopted daylight
-# savings time in 1916, Fort William and Port Arthur, having done so
-# already, did not change their clocks.... During the Second World
-# War,... [t]he cities agreed to implement DST during the summer
-# months for the remainder of the war years.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Toronto -5:17:32 - LMT 1895
@@ -1769,27 +1729,13 @@ Zone America/Toronto -5:17:32 - LMT 1895
-5:00 Canada E%sT 1946
-5:00 Toronto E%sT 1974
-5:00 Canada E%sT
-Zone America/Thunder_Bay -5:57:00 - LMT 1895
- -6:00 - CST 1910
- -5:00 - EST 1942
- -5:00 Canada E%sT 1970
- -5:00 Toronto E%sT 1973
- -5:00 - EST 1974
- -5:00 Canada E%sT
-Zone America/Nipigon -5:53:04 - LMT 1895
- -5:00 Canada E%sT 1940 Sep 29
- -5:00 1:00 EDT 1942 Feb 9 2:00s
- -5:00 Canada E%sT
-Zone America/Rainy_River -6:18:16 - LMT 1895
- -6:00 Canada C%sT 1940 Sep 29
- -6:00 1:00 CDT 1942 Feb 9 2:00s
- -6:00 Canada C%sT
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Atikokan -6:06:28 - LMT 1895
-6:00 Canada C%sT 1940 Sep 29
-6:00 1:00 CDT 1942 Feb 9 2:00s
-6:00 Canada C%sT 1945 Sep 30 2:00
-5:00 - EST
+#PACKRATLIST zone.tab Link America/Atikokan America/Coral_Harbour
# Manitoba
@@ -2041,6 +1987,37 @@ Zone America/Creston -7:46:04 - LMT 1884
# Northwest Territories, Nunavut, Yukon
+# From Chris Walton (2022-11-06):
+# Whitehorse Star - Thursday April 22, 1965 - page 1
+# title: DST Starts Monday ...
+# https://www.newspapers.com/image/578587481/
+# The title of this first article is wrong and/or misleading.
+# Also, the start time shown in the article is vague; it simply says "after
+# midnight" when it probably should have stated 2:00a.m....
+#
+# Whitehorse Star - Monday October 25, 1965 - page 15 ...
+# https://www.newspapers.com/image/578589147/
+# The 1965 Yukon Council minutes can be found here:
+# http://assets.yukonarchives.ca/PER_YG_06_1965_C20_S02_v1.pdf
+# ... I do not currently believe that NWT touched any of its clocks in 1965....
+#
+# Whitehorse Star - Thursday Feb 24,1966 - page 2
+# title: It's Time for YDT ...
+# https://www.newspapers.com/image/578575979/ ...
+# America/Whitehorse as a permanent change from UTC-9(YST) to
+# UTC-8(PST) at 00:00 on Sunday February 27, 1966....
+#
+# Whitehorse Star - Friday April 28,1972 - page 6
+# title: Daylight Saving Time for N.W.T....
+# https://www.newspapers.com/image/578701610/ ...
+# Nunavut and NWT zones ... DST starting in 1972.... Start and End ...
+# should be the same as the rest of Canada
+#
+#
+# From Paul Eggert (2022-11-06):
+# For now, assume Yukon's 1965-04-22 spring forward was 00:00 -> 02:00, as this
+# seems likely than 02:00 -> 04:00 and matches "after midnight".
+
# From Paul Eggert (2006-03-22):
# Dawson switched to PST in 1973. Inuvik switched to MST in 1979.
# Mathew Englander (1996-10-07) gives the following refs:
@@ -2155,52 +2132,22 @@ Zone America/Creston -7:46:04 - LMT 1884
# * Interpretation Act, RSY 2002, c 125
# https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
+# From Chris Walton (2022-11-06):
+# The 5th edition of the Atlas of Canada contains a time zone map that
+# shows both legislated and observed time zone boundaries.
+# All communities on Baffin Island are shown to be observing Eastern time.
+# The date on the map is 1984.
+# https://ftp.maps.canada.ca/pub/nrcan_rncan/raster/atlas_5_ed/eng/other/referencemaps/mcr4056.pdf
+
# From Rives McDow (1999-09-04):
# Nunavut ... moved ... to incorporate the whole territory into one time zone.
# Nunavut moves to single time zone Oct. 31
# http://www.nunatsiaq.com/nunavut/nvt90903_13.html
-#
-# From Antoine Leca (1999-09-06):
-# We then need to create a new timezone for the Kitikmeot region of Nunavut
-# to differentiate it from the Yellowknife region.
# From Paul Eggert (1999-09-20):
# Basic Facts: The New Territory
# http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html
-# (1999) reports that Pangnirtung operates on eastern time,
-# and that Coral Harbour does not observe DST. We don't know when
-# Pangnirtung switched to eastern time; we'll guess 1995.
-
-# From Rives McDow (1999-11-08):
-# On October 31, when the rest of Nunavut went to Central time,
-# Pangnirtung wobbled. Here is the result of their wobble:
-#
-# The following businesses and organizations in Pangnirtung use Central Time:
-#
-# First Air, Power Corp, Nunavut Construction, Health Center, RCMP,
-# Eastern Arctic National Parks, A & D Specialist
-#
-# The following businesses and organizations in Pangnirtung use Eastern Time:
-#
-# Hamlet office, All other businesses, Both schools, Airport operator
-#
-# This has made for an interesting situation there, which warranted the news.
-# No one there that I spoke with seems concerned, or has plans to
-# change the local methods of keeping time, as it evidently does not
-# really interfere with any activities or make things difficult locally.
-# They plan to celebrate New Year's turn-over twice, one hour apart,
-# so it appears that the situation will last at least that long.
-# The Nunavut Intergovernmental Affairs hopes that they will "come to
-# their senses", but the locals evidently don't see any problem with
-# the current state of affairs.
-
-# From Michaela Rodrigue, writing in the
-# Nunatsiaq News (1999-11-19):
-# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html
-# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
-# central - or Nunavut time - for government offices, and eastern time
-# for municipal offices and schools.... Igloolik [was similar but then]
-# made the switch to central time on Saturday, Nov. 6.
+# (1999) reports that ... Coral Harbour does not observe DST.
# From Paul Eggert (2000-10-02):
# Matthews and Vincent (1998) say the following, but we lack histories
@@ -2359,18 +2306,12 @@ Rule NT_YK 1919 only - Nov 1 0:00 0 S
Rule NT_YK 1942 only - Feb 9 2:00 1:00 W # War
Rule NT_YK 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule NT_YK 1945 only - Sep 30 2:00 0 S
-Rule NT_YK 1965 only - Apr lastSun 0:00 2:00 DD
-Rule NT_YK 1965 only - Oct lastSun 2:00 0 S
-Rule NT_YK 1980 1986 - Apr lastSun 2:00 1:00 D
-Rule NT_YK 1980 2006 - Oct lastSun 2:00 0 S
+Rule NT_YK 1972 1986 - Apr lastSun 2:00 1:00 D
+Rule NT_YK 1972 2006 - Oct lastSun 2:00 0 S
Rule NT_YK 1987 2006 - Apr Sun>=1 2:00 1:00 D
+Rule Yukon 1965 only - Apr lastSun 0:00 2:00 DD
+Rule Yukon 1965 only - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-# aka Panniqtuuq
-Zone America/Pangnirtung 0 - -00 1921 # trading post est.
- -4:00 NT_YK A%sT 1995 Apr Sun>=1 2:00
- -5:00 Canada E%sT 1999 Oct 31 2:00
- -6:00 Canada C%sT 2000 Oct 29 2:00
- -5:00 Canada E%sT
# formerly Frobisher Bay
Zone America/Iqaluit 0 - -00 1942 Aug # Frobisher Bay est.
-5:00 NT_YK E%sT 1999 Oct 31 2:00
@@ -2395,21 +2336,20 @@ Zone America/Cambridge_Bay 0 - -00 1920 # trading post est.?
-5:00 - EST 2000 Nov 5 0:00
-6:00 - CST 2001 Apr 1 3:00
-7:00 Canada M%sT
-Zone America/Yellowknife 0 - -00 1935 # Yellowknife founded?
- -7:00 NT_YK M%sT 1980
- -7:00 Canada M%sT
Zone America/Inuvik 0 - -00 1953 # Inuvik founded
-8:00 NT_YK P%sT 1979 Apr lastSun 2:00
-7:00 NT_YK M%sT 1980
-7:00 Canada M%sT
Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20
- -9:00 NT_YK Y%sT 1967 May 28 0:00
- -8:00 NT_YK P%sT 1980
+ -9:00 NT_YK Y%sT 1965
+ -9:00 Yukon Y%sT 1966 Feb 27 0:00
+ -8:00 - PST 1980
-8:00 Canada P%sT 2020 Nov 1
-7:00 - MST
Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
- -9:00 NT_YK Y%sT 1973 Oct 28 0:00
- -8:00 NT_YK P%sT 1980
+ -9:00 NT_YK Y%sT 1965
+ -9:00 Yukon Y%sT 1973 Oct 28 0:00
+ -8:00 - PST 1980
-8:00 Canada P%sT 2020 Nov 1
-7:00 - MST
@@ -2625,7 +2565,23 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# 5- The islands, reefs and keys shall take their timezone from the
# longitude they are located at.
+# From Paul Eggert (2022-10-28):
+# The new Mexican law was published today:
+# https://www.dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022
+# This abolishes DST except where US DST rules are observed,
+# and in addition changes all of Chihuahua to -06 with no DST.
+
+# From Heitor David Pinto (2022-11-28):
+# Now the northern [municipios] want to have the same time zone as the
+# respective neighboring cities in the US, for example Juárez in UTC-7 with
+# DST, matching El Paso, and Ojinaga in UTC-6 with DST, matching Presidio....
+# the president authorized the publication of the decree for November 29,
+# so the time change would occur on November 30 at 0:00.
+# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
+Rule Mexico 1931 only - May 1 23:00 1:00 D
+Rule Mexico 1931 only - Oct 1 0:00 0 S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S
Rule Mexico 1940 only - Dec 9 0:00 1:00 D
@@ -2638,89 +2594,109 @@ Rule Mexico 1996 2000 - Apr Sun>=1 2:00 1:00 D
Rule Mexico 1996 2000 - Oct lastSun 2:00 0 S
Rule Mexico 2001 only - May Sun>=1 2:00 1:00 D
Rule Mexico 2001 only - Sep lastSun 2:00 0 S
-Rule Mexico 2002 max - Apr Sun>=1 2:00 1:00 D
-Rule Mexico 2002 max - Oct lastSun 2:00 0 S
+Rule Mexico 2002 2022 - Apr Sun>=1 2:00 1:00 D
+Rule Mexico 2002 2022 - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
# Quintana Roo; represented by Cancún
-Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56
+Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 6:00u
-6:00 - CST 1981 Dec 23
-5:00 Mexico E%sT 1998 Aug 2 2:00
-6:00 Mexico C%sT 2015 Feb 1 2:00
-5:00 - EST
# Campeche, Yucatán; represented by Mérida
-Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32
+Zone America/Merida -5:58:28 - LMT 1922 Jan 1 6:00u
-6:00 - CST 1981 Dec 23
-5:00 - EST 1982 Dec 2
-6:00 Mexico C%sT
# Coahuila, Nuevo León, Tamaulipas (near US border)
-# This includes the following municipalities:
-# in Coahuila: Ocampo, Acuña, Zaragoza, Jiménez, Piedras Negras, Nava,
-# Guerrero, Hidalgo.
-# in Nuevo León: Anáhuac, Los Aldama.
+# This includes the following municipios:
+# in Coahuila: Acuña, Allende, Guerrero, Hidalgo, Jiménez, Morelos, Nava,
+# Ocampo, Piedras Negras, Villa Unión, Zaragoza
+# in Nuevo León: Anáhuac
# in Tamaulipas: Nuevo Laredo, Guerrero, Mier, Miguel Alemán, Camargo,
# Gustavo Díaz Ordaz, Reynosa, Río Bravo, Valle Hermoso, Matamoros.
-# See: Inicia mañana Horario de Verano en zona fronteriza, El Universal,
-# 2016-03-12
-# http://www.eluniversal.com.mx/articulo/estados/2016/03/12/inicia-manana-horario-de-verano-en-zona-fronteriza
-Zone America/Matamoros -6:40:00 - LMT 1921 Dec 31 23:20:00
+# https://www.dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022
+Zone America/Matamoros -6:30:00 - LMT 1922 Jan 1 6:00u
-6:00 - CST 1988
-6:00 US C%sT 1989
-6:00 Mexico C%sT 2010
-6:00 US C%sT
# Durango; Coahuila, Nuevo León, Tamaulipas (away from US border)
-Zone America/Monterrey -6:41:16 - LMT 1921 Dec 31 23:18:44
+Zone America/Monterrey -6:41:16 - LMT 1922 Jan 1 6:00u
-6:00 - CST 1988
-6:00 US C%sT 1989
-6:00 Mexico C%sT
# Central Mexico
-Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24
+Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 Mexico C%sT 2001 Sep 30 2:00
-6:00 - CST 2002 Feb 20
-6:00 Mexico C%sT
-# Chihuahua (near US border)
-# This includes the municipalities of Janos, Ascensión, Juárez, Guadalupe,
-# Práxedis G Guerrero, Coyame del Sotol, Ojinaga, and Manuel Benavides.
-# (See the 2016-03-12 El Universal source mentioned above.)
-Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 0:02:20
+# Chihuahua (near US border - western side)
+# This includes the municipios of Janos, Ascensión, Juárez, Guadalupe, and
+# Práxedis G Guerrero.
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
+Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1996
-6:00 Mexico C%sT 1998
-6:00 - CST 1998 Apr Sun>=1 3:00
-7:00 Mexico M%sT 2010
+ -7:00 US M%sT 2022 Oct 30 2:00
+ -6:00 - CST 2022 Nov 30 0:00
-7:00 US M%sT
+# Chihuahua (near US border - eastern side)
+# This includes the municipios of Coyame del Sotol, Ojinaga, and Manuel
+# Benavides.
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
+Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
+ -7:00 - MST 1927 Jun 10 23:00
+ -6:00 - CST 1930 Nov 15
+ -7:00 Mexico M%sT 1932 Apr 1
+ -6:00 - CST 1996
+ -6:00 Mexico C%sT 1998
+ -6:00 - CST 1998 Apr Sun>=1 3:00
+ -7:00 Mexico M%sT 2010
+ -7:00 US M%sT 2022 Oct 30 2:00
+ -6:00 - CST 2022 Nov 30 0:00
+ -6:00 US C%sT
# Chihuahua (away from US border)
-Zone America/Chihuahua -7:04:20 - LMT 1921 Dec 31 23:55:40
+Zone America/Chihuahua -7:04:20 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1996
-6:00 Mexico C%sT 1998
-6:00 - CST 1998 Apr Sun>=1 3:00
- -7:00 Mexico M%sT
+ -7:00 Mexico M%sT 2022 Oct 30 2:00
+ -6:00 - CST
# Sonora
-Zone America/Hermosillo -7:23:52 - LMT 1921 Dec 31 23:36:08
+Zone America/Hermosillo -7:23:52 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1942 Apr 24
-7:00 - MST 1949 Jan 14
-8:00 - PST 1970
-7:00 Mexico M%sT 1999
-7:00 - MST
+# Baja California Sur, Nayarit (except Bahía de Banderas), Sinaloa
+Zone America/Mazatlan -7:05:40 - LMT 1922 Jan 1 7:00u
+ -7:00 - MST 1927 Jun 10 23:00
+ -6:00 - CST 1930 Nov 15
+ -7:00 Mexico M%sT 1932 Apr 1
+ -6:00 - CST 1942 Apr 24
+ -7:00 - MST 1949 Jan 14
+ -8:00 - PST 1970
+ -7:00 Mexico M%sT
+
+# Bahía de Banderas
+
# From Alexander Krivenyshev (2010-04-21):
# According to news, Bahía de Banderas (Mexican state of Nayarit)
# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
@@ -2748,25 +2724,10 @@ Zone America/Hermosillo -7:23:52 - LMT 1921 Dec 31 23:36:08
# From Arthur David Olson (2010-05-01):
# Use "Bahia_Banderas" to keep the name to fourteen characters.
-# Mazatlán
-Zone America/Mazatlan -7:05:40 - LMT 1921 Dec 31 23:54:20
- -7:00 - MST 1927 Jun 10 23:00
- -6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
- -6:00 - CST 1942 Apr 24
- -7:00 - MST 1949 Jan 14
- -8:00 - PST 1970
- -7:00 Mexico M%sT
-
-# Bahía de Banderas
-Zone America/Bahia_Banderas -7:01:00 - LMT 1921 Dec 31 23:59:00
+Zone America/Bahia_Banderas -7:01:00 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10 23:00
-6:00 - CST 1930 Nov 15
- -7:00 - MST 1931 May 1 23:00
- -6:00 - CST 1931 Oct
- -7:00 - MST 1932 Apr 1
+ -7:00 Mexico M%sT 1932 Apr 1
-6:00 - CST 1942 Apr 24
-7:00 - MST 1949 Jan 14
-8:00 - PST 1970
@@ -2774,7 +2735,7 @@ Zone America/Bahia_Banderas -7:01:00 - LMT 1921 Dec 31 23:59:00
-6:00 Mexico C%sT
# Baja California
-Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
+Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1924
-8:00 - PST 1927 Jun 10 23:00
-7:00 - MST 1930 Nov 15
@@ -2811,6 +2772,10 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010
# It has been moved to the 'backward' file.
#
+# From Paul Eggert (2022-10-28):
+# Today's new law states that the entire state of Baja California
+# follows US DST rules, which agrees with simplifications noted above.
+#
#
# Revillagigedo Is
# no information
@@ -2822,13 +2787,12 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56
Zone America/Anguilla -4:12:16 - LMT 1912 Mar 2
-4:00 - AST
-# Antigua and Barbuda
+# Antigua & Barbuda
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
-5:00 - EST 1951
-4:00 - AST
-
# The Bahamas
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Bahamas 1942 only - May 1 24:00 1:00 W
@@ -2846,7 +2810,7 @@ Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
# Barbados
-# For 1899 Milne gives -3:58:29.2; round that.
+# For 1899 Milne gives -3:58:29.2.
# From P Chan (2020-12-09 and 2020-12-11):
# Standard time of GMT-4 was adopted in 1911.
@@ -2890,6 +2854,7 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -3:58:29.2
Zone America/Barbados -3:58:29 - LMT 1911 Aug 28 # Bridgetown
-4:00 Barb A%sT 1944
-4:00 Barb AST/-0330 1945
@@ -2950,10 +2915,10 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr 1
# Bermuda
-# From Paul Eggert (2020-11-24):
+# From Paul Eggert (2022-07-27):
# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
# Bermuda dockyard, Ireland I. This agrees with standard offset given in the
-# Daylight Saving Act, 1917 cited below. Round that to the nearest second.
+# Daylight Saving Act, 1917 cited below.
# It is not known when this time became standard for Bermuda; guess 1890.
# The transition to -04 was specified by:
# 1930: The Time Zone Act, 1929 (1929: No. 39) [1929-11-08]
@@ -3048,6 +3013,7 @@ Rule Bermuda 1956 only - May Sun>=22 2:00 1:00 D
Rule Bermuda 1956 only - Oct lastSun 2:00 0 S
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -4:19:18.3
Zone Atlantic/Bermuda -4:19:18 - LMT 1890 # Hamilton
-4:19:18 Bermuda BMT/BST 1930 Jan 1 2:00
-4:00 Bermuda A%sT 1974 Apr 28 2:00
@@ -3065,7 +3031,7 @@ Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
# Costa Rica
-# Milne gives -5:36:13.3 as San José mean time; round to nearest.
+# Milne gives -5:36:13.3 as San José mean time.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
@@ -3077,6 +3043,7 @@ Rule CR 1991 only - Jul 1 0:00 0 S
Rule CR 1992 only - Mar 15 0:00 0 S
# There are too many San Josés elsewhere, so we'll use 'Costa Rica'.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -5:36:13.3
Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
-5:36:13 - SJMT 1921 Jan 15 # San José Mean Time
-6:00 CR C%sT
@@ -3140,7 +3107,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
#
# He supplied these references:
#
-# http://www.prensalatina.com.mx/article.asp?ID=%7B4CC32C1B-A9F7-42FB-8A07-8631AFC923AF%7D&language=ES
+# http://www.prensalatina.com.mx/article.asp?ID={4CC32C1B-A9F7-42FB-8A07-8631AFC923AF}&language=ES
# http://actualidad.terra.es/sociedad/articulo/cuba_llama_ahorrar_energia_cambio_1957044.htm
#
# From Alex Krivenyshev (2007-10-25):
@@ -3292,7 +3259,6 @@ Zone America/Havana -5:29:28 - LMT 1890
Zone America/Dominica -4:05:36 - LMT 1911 Jul 1 0:01 # Roseau
-4:00 - AST
-
# Dominican Republic
# From Steffen Thorsen (2000-10-30):
@@ -3351,6 +3317,7 @@ Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe-à-Pitre
# St Barthélemy
# See America/St_Barthelemy in southamerica.
+
# St Martin (French part)
# See America/Marigot in southamerica.
@@ -3511,7 +3478,7 @@ Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr
# Jamaica
# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
# unspecified official document, and says "This time is used throughout the
-# island". Go with Milne. Round to the nearest second as required by zic.
+# island". Go with Milne.
#
# Shanks & Pottenger give April 28 for the 1974 spring-forward transition, but
# Lance Neita writes that Prime Minister Michael Manley decreed it January 5.
@@ -3524,6 +3491,7 @@ Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr
# http://www.jamaicaobserver.com/columns/The-politician-in-all-of-us_17573647
#
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -5:07:10.41
Zone America/Jamaica -5:07:10 - LMT 1890 # Kingston
-5:07:10 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1974
@@ -3543,7 +3511,6 @@ Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France
Zone America/Montserrat -4:08:52 - LMT 1911 Jul 1 0:01 # Cork Hill
-4:00 - AST
-
# Nicaragua
#
# This uses Shanks & Pottenger for times before 2005.
@@ -3634,7 +3601,6 @@ Zone America/St_Lucia -4:04:00 - LMT 1890 # Castries
-4:04:00 - CMT 1912 # Castries Mean Time
-4:00 - AST
-
# St Pierre and Miquelon
# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -3643,13 +3609,12 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
-3:00 - -03 1987
-3:00 Canada -03/-02
-# St Vincent and the Grenadines
+# St Vincent & the Grenadines
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown
-4:04:56 - KMT 1912 # Kingstown Mean Time
-4:00 - AST
-
# Sint Maarten
# See America/Lower_Princes in southamerica.
@@ -3715,6 +3680,7 @@ Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
+ #STDOFF -5:07:10.41
-5:07:10 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 2015 Mar 8 2:00
@@ -3731,8 +3697,6 @@ Zone America/Tortola -4:18:28 - LMT 1911 Jul # Road Town
Zone America/St_Thomas -4:19:44 - LMT 1911 Jul # Charlotte Amalie
-4:00 - AST
-
-
# Local Variables:
# coding: utf-8
# End:
diff --git a/src/main/java/org/joda/time/tz/src/southamerica b/src/main/java/org/joda/time/tz/src/southamerica
index b656bbd9..d8c9aa6f 100644
--- a/src/main/java/org/joda/time/tz/src/southamerica
+++ b/src/main/java/org/joda/time/tz/src/southamerica
@@ -208,7 +208,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 -
# Hora de verano para la República Argentina
# http://buenasiembra.com.ar/esoterismo/astrologia/hora-de-verano-de-la-republica-argentina-27.html
# says that standard time in Argentina from 1894-10-31
-# to 1920-05-01 was -4:16:48.25. Go with this more-precise value
+# to 1920-05-01 was -4:16:48.25. Go with this more precise value
# over Shanks & Pottenger. It is upward compatible with Milne, who
# says Córdoba time was -4:16:48.2.
@@ -400,6 +400,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 -
#
# Buenos Aires (BA), Capital Federal (CF),
Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May # Córdoba Mean Time
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -417,6 +418,7 @@ Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
# - Santiago del Estero switched to -4:00 on 1991-04-01,
# then to -3:00 on 1991-04-26.
#
+ #STDOFF -4:16:48.25
Zone America/Argentina/Cordoba -4:16:48 - LMT 1894 Oct 31
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
@@ -429,6 +431,7 @@ Zone America/Argentina/Cordoba -4:16:48 - LMT 1894 Oct 31
#
# Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
Zone America/Argentina/Salta -4:21:40 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -441,6 +444,7 @@ Zone America/Argentina/Salta -4:21:40 - LMT 1894 Oct 31
#
# Tucumán (TM)
Zone America/Argentina/Tucuman -4:20:52 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -454,6 +458,7 @@ Zone America/Argentina/Tucuman -4:20:52 - LMT 1894 Oct 31
#
# La Rioja (LR)
Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -468,6 +473,7 @@ Zone America/Argentina/La_Rioja -4:27:24 - LMT 1894 Oct 31
#
# San Juan (SJ)
Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -482,6 +488,7 @@ Zone America/Argentina/San_Juan -4:34:04 - LMT 1894 Oct 31
#
# Jujuy (JY)
Zone America/Argentina/Jujuy -4:21:12 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -497,6 +504,7 @@ Zone America/Argentina/Jujuy -4:21:12 - LMT 1894 Oct 31
#
# Catamarca (CT), Chubut (CH)
Zone America/Argentina/Catamarca -4:23:08 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -511,6 +519,7 @@ Zone America/Argentina/Catamarca -4:23:08 - LMT 1894 Oct 31
#
# Mendoza (MZ)
Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -533,6 +542,7 @@ Rule SanLuis 2008 2009 - Mar Sun>=8 0:00 0 -
Rule SanLuis 2007 2008 - Oct Sun>=8 0:00 1:00 -
Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -551,6 +561,7 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -563,6 +574,7 @@ Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
#
# Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
+ #STDOFF -4:16:48.25
-4:16:48 - CMT 1920 May
-4:00 - -04 1930 Dec
-4:00 Arg -04/-03 1969 Oct 5
@@ -648,7 +660,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Rodrigo Severo (2004-10-04):
# It's just the biannual change made necessary by the much hyped, supposedly
-# modern Brazilian eletronic voting machines which, apparently, can't deal
+# modern Brazilian ... voting machines which, apparently, can't deal
# with a time change between the first and the second rounds of the elections.
# From Steffen Thorsen (2007-09-20):
@@ -1144,7 +1156,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# this is known to work for DST transitions starting in 2008 and
# may well be true for earlier transitions.
-# From Tim Parenti (2022-03-15):
+# From Tim Parenti (2022-07-06):
# For a brief period of roughly six weeks in 1946, DST was only observed on an
# emergency basis in specific regions of central Chile; namely, "the national
# territory between the provinces of Coquimbo and Concepción, inclusive".
@@ -1162,7 +1174,14 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Law Number 8,522, promulgated 1946-08-27, reunified Chilean clocks at their
# new "Summer Time" of -04, reckoned as that of "the meridian of the
# Astronomical Observatory of Lo Espejo, advanced by 42 minutes and 45
-# seconds".
+# seconds". Although this law specified the new Summer Time to start on 1
+# September each year, a special "transitional article" started it a few days
+# early, as soon as the law took effect. As the law was to take force "from
+# the date of its publication in the 'Diario Oficial', which happened the
+# following day, presume the change took place in Santiago and its environs
+# from 24:00 -03 to 23:00 -04 on Wednesday 1946-08-28. Although this was a
+# no-op for wall clocks in the north and south of the country, put their formal
+# start to DST an hour later when they reached 24:00 -04.
# https://www.diariooficial.interior.gob.cl/versiones-anteriores/do-h/19460828/#page/1
# After a brief "Winter Time" stint at -05 beginning 1947-04-01, Law Number
# 8,777, promulgated 1947-05-17, established year-round -04 "from 23:00 on the
@@ -1282,11 +1301,25 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# So we extend the new rules on Saturdays at 24:00 mainland time indefinitely.
# From Juan Correa (2019-02-04):
# http://www.diariooficial.interior.gob.cl/publicaciones/2018/11/23/42212/01/1498738.pdf
-# From Paul Eggert (2019-09-01):
-# The above says the Magallanes exception expires 2022-04-02 at 24:00,
-# so in theory, they will revert to -04/-03 after that.
-# For now, assume that they will not revert,
-# since they have extended the expiration date once already.
+
+# From Juan Correa (2022-04-02):
+# I found there was a decree published last Thursday that will keep
+# Magallanes region to UTC -3 "indefinitely". The decree is available at
+# https://www.diariooficial.interior.gob.cl/publicaciones/2022/03/31/43217-B/01/2108910.pdf
+
+# From Juan Correa (2022-08-09):
+# the Internal Affairs Ministry (Ministerio del Interior) informed DST
+# for America/Santiago will start on midnight of September 11th;
+# and will end on April 1st, 2023. Magallanes region (America/Punta_Arenas)
+# will keep UTC -3 "indefinitely"... This is because on September 4th
+# we will have a voting whether to approve a new Constitution.
+#
+# From Eduardo Romero Urra (2022-08-17):
+# https://www.diariooficial.interior.gob.cl/publicaciones/2022/08/13/43327/01/2172567.pdf
+#
+# From Paul Eggert (2022-08-17):
+# Although the presidential decree stops at fall 2026, assume that
+# similar DST rules will continue thereafter.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Chile 1927 1931 - Sep 1 0:00 1:00 -
@@ -1324,7 +1357,9 @@ Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 -
Rule Chile 2016 2018 - May Sun>=9 3:00u 0 -
Rule Chile 2016 2018 - Aug Sun>=9 4:00u 1:00 -
Rule Chile 2019 max - Apr Sun>=2 3:00u 0 -
-Rule Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
+Rule Chile 2019 2021 - Sep Sun>=2 4:00u 1:00 -
+Rule Chile 2022 only - Sep Sun>=9 4:00u 1:00 -
+Rule Chile 2023 max - Sep Sun>=2 4:00u 1:00 -
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
@@ -1337,9 +1372,9 @@ Zone America/Santiago -4:42:45 - LMT 1890
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
- -4:00 - -04 1946 Jul 15
- -4:00 1:00 -03 1946 Sep 1 # central Chile
- -4:00 - -04 1947 Apr 1
+ -4:00 - -04 1946 Jul 14 24:00
+ -4:00 1:00 -03 1946 Aug 28 24:00 # central CL
+ -5:00 1:00 -04 1947 Mar 31 24:00
-5:00 - -05 1947 May 21 23:00
-4:00 Chile -04/-03
Zone America/Punta_Arenas -4:43:40 - LMT 1890
@@ -1351,7 +1386,8 @@ Zone America/Punta_Arenas -4:43:40 - LMT 1890
-5:00 Chile -05/-04 1932 Sep 1
-4:00 - -04 1942 Jun 1
-5:00 - -05 1942 Aug 1
- -4:00 - -04 1947 Apr 1
+ -4:00 - -04 1946 Aug 28 24:00
+ -5:00 1:00 -04 1947 Mar 31 24:00
-5:00 - -05 1947 May 21 23:00
-4:00 Chile -04/-03 2016 Dec 4
-3:00 - -03
@@ -1385,13 +1421,19 @@ Zone Antarctica/Palmer 0 - -00 1965
# Colombia
-# Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest. He writes,
+# Milne gives 4:56:16.4 for Bogotá time in 1899. He writes,
# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
+# From Alois Treindl (2022-11-10):
+# End of time change in Colombia 1993 ... should be 6 February 24h ...
+# DECRETO 267 DE 1993
+# https://www.suin-juriscol.gov.co/viewDocument.asp?ruta=Decretos/1061335
+
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule CO 1992 only - May 3 0:00 1:00 -
-Rule CO 1993 only - Apr 4 0:00 0 -
+Rule CO 1992 only - May 3 0:00 1:00 -
+Rule CO 1993 only - Feb 6 24:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
+ #STDOFF -4:56:16.4
Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
-4:56:16 - BMT 1914 Nov 23 # Bogotá Mean Time
-5:00 CO -05/-04
@@ -1406,14 +1448,6 @@ Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
Link America/Curacao America/Kralendijk
Link America/Curacao America/Lower_Princes
-#
-# From Arthur David Olson (2011-06-15):
-# use links for places with new iso3166 codes.
-# The name "Lower Prince's Quarter" is both longer than fourteen characters
-# and contains an apostrophe; use "Lower_Princes"....
-# From Paul Eggert (2021-09-29):
-# These backward-compatibility links now are in the 'northamerica' file.
-
# Ecuador
#
# Milne says the Central and South American Telegraph Company used -5:24:15.
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index fb1c3285..126adc7f 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -131,7 +131,7 @@ Joda-Time is licenced under the business friendly <a href="licenses.html">Apache
## <i></i> Releases
-[Release 2.10.14](download.html) is the current latest release.
+[Release 2.12.5](download.html) is the current latest release.
This release is considered stable and worthy of the 2.x tag.
See the [change notes](changes-report.html) for full details.
@@ -145,7 +145,7 @@ Available in [Maven Central](https://search.maven.org/search?q=g:joda-time%20AND
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>2.10.14</version>
+ <version>2.12.5</version>
</dependency>
```
diff --git a/src/test/java/org/joda/time/MockNullZoneChronology.java b/src/test/java/org/joda/time/MockNullZoneChronology.java
index 34209aea..3f3d3a33 100644
--- a/src/test/java/org/joda/time/MockNullZoneChronology.java
+++ b/src/test/java/org/joda/time/MockNullZoneChronology.java
@@ -25,18 +25,23 @@ import org.joda.time.chrono.ISOChronology;
*/
class MockNullZoneChronology extends BaseChronology {
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return this;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
return this;
}
+ @Override
public DateTimeField dayOfMonth() { // for DateMidnight test
return ISOChronology.getInstance().dayOfMonth();
}
+ @Override
public String toString() {
return "";
}
diff --git a/src/test/java/org/joda/time/MockZone.java b/src/test/java/org/joda/time/MockZone.java
index 76601513..a901e7f0 100644
--- a/src/test/java/org/joda/time/MockZone.java
+++ b/src/test/java/org/joda/time/MockZone.java
@@ -28,26 +28,32 @@ public class MockZone extends DateTimeZone {
this.sizeMillis = sizeSecs * 1000;
}
+ @Override
public int getOffset(long instant) {
return (instant < transition ? winterOffset : winterOffset + sizeMillis);
}
+ @Override
public int getStandardOffset(long instant) {
return winterOffset;
}
+ @Override
public long nextTransition(long instant) {
return (instant < transition ? transition : transition + 180L * DateTimeConstants.MILLIS_PER_DAY);
}
+ @Override
public long previousTransition(long instant) {
return (instant > transition ? transition : transition - 180L * DateTimeConstants.MILLIS_PER_DAY);
}
+ @Override
public boolean isFixed() {
return false;
}
+ @Override
public String getNameKey(long instant) {
return null;
}
diff --git a/src/test/java/org/joda/time/TestAbstractPartial.java b/src/test/java/org/joda/time/TestAbstractPartial.java
index 6884c6c6..2a19adde 100644
--- a/src/test/java/org/joda/time/TestAbstractPartial.java
+++ b/src/test/java/org/joda/time/TestAbstractPartial.java
@@ -59,12 +59,14 @@ public class TestAbstractPartial extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -154,6 +156,7 @@ public class TestAbstractPartial extends TestCase {
super();
}
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case 0:
@@ -184,41 +187,51 @@ public class TestAbstractPartial extends TestCase {
static class MockProperty0 extends AbstractPartialFieldProperty {
MockPartial partial = new MockPartial();
+ @Override
public DateTimeField getField() {
return partial.getField(0);
}
+ @Override
public ReadablePartial getReadablePartial() {
return partial;
}
+ @Override
public int get() {
return partial.getValue(0);
}
}
static class MockProperty1 extends AbstractPartialFieldProperty {
MockPartial partial = new MockPartial();
+ @Override
public DateTimeField getField() {
return partial.getField(1);
}
+ @Override
public ReadablePartial getReadablePartial() {
return partial;
}
+ @Override
public int get() {
return partial.getValue(1);
}
}
static class MockProperty0Field extends MockProperty0 {
+ @Override
public DateTimeField getField() {
return BuddhistChronology.getInstanceUTC().hourOfDay();
}
}
static class MockProperty0Val extends MockProperty0 {
+ @Override
public int get() {
return 99;
}
}
static class MockProperty0Chrono extends MockProperty0 {
+ @Override
public ReadablePartial getReadablePartial() {
return new MockPartial() {
+ @Override
public Chronology getChronology() {
return ISOChronology.getInstanceUTC();
}
diff --git a/src/test/java/org/joda/time/TestBasePartial.java b/src/test/java/org/joda/time/TestBasePartial.java
index c6ea5b42..4c11e549 100644
--- a/src/test/java/org/joda/time/TestBasePartial.java
+++ b/src/test/java/org/joda/time/TestBasePartial.java
@@ -56,12 +56,14 @@ public class TestBasePartial extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -107,6 +109,7 @@ public class TestBasePartial extends TestCase {
super(new int[] {1970, 1}, null);
}
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case 0:
diff --git a/src/test/java/org/joda/time/TestBaseSingleFieldPeriod.java b/src/test/java/org/joda/time/TestBaseSingleFieldPeriod.java
index feb22c98..d62c4c24 100644
--- a/src/test/java/org/joda/time/TestBaseSingleFieldPeriod.java
+++ b/src/test/java/org/joda/time/TestBaseSingleFieldPeriod.java
@@ -42,9 +42,11 @@ public class TestBaseSingleFieldPeriod extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -314,18 +316,22 @@ public class TestBaseSingleFieldPeriod extends TestCase {
return BaseSingleFieldPeriod.standardPeriodIn(period, millisPerUnit);
}
+ @Override
public DurationFieldType getFieldType() {
return DurationFieldType.days();
}
+ @Override
public PeriodType getPeriodType() {
return PeriodType.days();
}
+ @Override
public int getValue() {
return super.getValue();
}
+ @Override
public void setValue(int value) {
super.setValue(value);
}
diff --git a/src/test/java/org/joda/time/TestChronology.java b/src/test/java/org/joda/time/TestChronology.java
index 509fb85a..3865837d 100644
--- a/src/test/java/org/joda/time/TestChronology.java
+++ b/src/test/java/org/joda/time/TestChronology.java
@@ -87,6 +87,7 @@ public class TestChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -97,6 +98,7 @@ public class TestChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestDateMidnight_Basics.java b/src/test/java/org/joda/time/TestDateMidnight_Basics.java
index 82982c9f..c4f6cdd7 100644
--- a/src/test/java/org/joda/time/TestDateMidnight_Basics.java
+++ b/src/test/java/org/joda/time/TestDateMidnight_Basics.java
@@ -121,6 +121,7 @@ public class TestDateMidnight_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW_UTC);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -131,6 +132,7 @@ public class TestDateMidnight_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
@@ -287,6 +289,7 @@ public class TestDateMidnight_Basics extends TestCase {
}
class MockInstant extends AbstractInstant {
+ @Override
public String toString() {
return null;
}
@@ -992,12 +995,15 @@ public class TestDateMidnight_Basics extends TestCase {
assertEquals(test.property(DateTimeFieldType.millisOfSecond()), test.property(DateTimeFieldType.millisOfSecond()));
DateTimeFieldType bad = new DateTimeFieldType("bad") {
private static final long serialVersionUID = 1L;
+ @Override
public DurationFieldType getDurationType() {
return DurationFieldType.weeks();
}
+ @Override
public DurationFieldType getRangeDurationType() {
return null;
}
+ @Override
public DateTimeField getField(Chronology chronology) {
return UnsupportedDateTimeField.getInstance(this, UnsupportedDurationField.getInstance(getDurationType()));
}
diff --git a/src/test/java/org/joda/time/TestDateMidnight_Constructors.java b/src/test/java/org/joda/time/TestDateMidnight_Constructors.java
index 2277c660..0446d2b6 100644
--- a/src/test/java/org/joda/time/TestDateMidnight_Constructors.java
+++ b/src/test/java/org/joda/time/TestDateMidnight_Constructors.java
@@ -96,6 +96,7 @@ public class TestDateMidnight_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW_UTC);
zone = DateTimeZone.getDefault();
@@ -104,6 +105,7 @@ public class TestDateMidnight_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestDateMidnight_Properties.java b/src/test/java/org/joda/time/TestDateMidnight_Properties.java
index b49a7908..32ec588d 100644
--- a/src/test/java/org/joda/time/TestDateMidnight_Properties.java
+++ b/src/test/java/org/joda/time/TestDateMidnight_Properties.java
@@ -17,13 +17,13 @@ package org.joda.time;
import java.util.Locale;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.LenientChronology;
import org.joda.time.chrono.StrictChronology;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
/**
* This class is a Junit unit test for DateTime.
*
@@ -81,6 +81,7 @@ public class TestDateMidnight_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -89,6 +90,7 @@ public class TestDateMidnight_Properties extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -233,7 +235,8 @@ public class TestDateMidnight_Properties extends TestCase {
assertEquals(test.getChronology().months(), test.monthOfYear().getDurationField());
assertEquals(test.getChronology().years(), test.monthOfYear().getRangeDurationField());
assertEquals(9, test.monthOfYear().getMaximumTextLength(null));
- assertEquals(3, test.monthOfYear().getMaximumShortTextLength(null));
+ int max = test.monthOfYear().getMaximumShortTextLength(null);
+ assertTrue(max == 3 || max == 4); // for JDK17+
test = new DateMidnight(2004, 7, 9);
assertEquals("juillet", test.monthOfYear().getAsText(Locale.FRENCH));
assertEquals("juil.", test.monthOfYear().getAsShortText(Locale.FRENCH));
diff --git a/src/test/java/org/joda/time/TestDateTimeComparator.java b/src/test/java/org/joda/time/TestDateTimeComparator.java
index 0371be3e..0a209771 100644
--- a/src/test/java/org/joda/time/TestDateTimeComparator.java
+++ b/src/test/java/org/joda/time/TestDateTimeComparator.java
@@ -131,6 +131,7 @@ public class TestDateTimeComparator extends TestCase {
/**
* Junit <code>setUp()</code> method.
*/
+ @Override
public void setUp() /* throws Exception */ {
Chronology chrono = ISOChronology.getInstanceUTC();
@@ -154,6 +155,7 @@ public class TestDateTimeComparator extends TestCase {
/**
* Junit <code>tearDown()</code> method.
*/
+ @Override
protected void tearDown() /* throws Exception */ {
// super.tearDown();
aDateTime = null;
diff --git a/src/test/java/org/joda/time/TestDateTimeFieldType.java b/src/test/java/org/joda/time/TestDateTimeFieldType.java
index 29aaceef..17754945 100644
--- a/src/test/java/org/joda/time/TestDateTimeFieldType.java
+++ b/src/test/java/org/joda/time/TestDateTimeFieldType.java
@@ -45,9 +45,11 @@ public class TestDateTimeFieldType extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestDateTimeUtils.java b/src/test/java/org/joda/time/TestDateTimeUtils.java
index f2acbdec..ab610814 100644
--- a/src/test/java/org/joda/time/TestDateTimeUtils.java
+++ b/src/test/java/org/joda/time/TestDateTimeUtils.java
@@ -91,13 +91,16 @@ public class TestDateTimeUtils extends TestCase {
static {
// don't call Policy.getPolicy()
RESTRICT = new Policy() {
+ @Override
public PermissionCollection getPermissions(CodeSource codesource) {
Permissions p = new Permissions();
p.add(new AllPermission()); // enable everything
return p;
}
+ @Override
public void refresh() {
}
+ @Override
public boolean implies(ProtectionDomain domain, Permission permission) {
if (permission instanceof JodaTimePermission) {
return false;
@@ -107,11 +110,13 @@ public class TestDateTimeUtils extends TestCase {
}
};
ALLOW = new Policy() {
+ @Override
public PermissionCollection getPermissions(CodeSource codesource) {
Permissions p = new Permissions();
p.add(new AllPermission()); // enable everything
return p;
}
+ @Override
public void refresh() {
}
};
@@ -129,9 +134,11 @@ public class TestDateTimeUtils extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -369,6 +376,7 @@ public class TestDateTimeUtils extends TestCase {
MutableInterval ai = new MutableInterval() {
private static final long serialVersionUID = 1L;
+ @Override
public Chronology getChronology() {
return null; // testing for this
}
diff --git a/src/test/java/org/joda/time/TestDateTimeZone.java b/src/test/java/org/joda/time/TestDateTimeZone.java
index 43649e46..642018ad 100644
--- a/src/test/java/org/joda/time/TestDateTimeZone.java
+++ b/src/test/java/org/joda/time/TestDateTimeZone.java
@@ -780,7 +780,8 @@ public class TestDateTimeZone extends TestCase {
boolean jdk9 = true;
try {
String str = System.getProperty("java.version");
- jdk9 = str.startsWith("9");
+ str = str.indexOf('.') > 0 ? str.substring(0, str.indexOf('.')) : str;
+ jdk9 = Integer.parseInt(str) >= 9;
} catch (Exception ex) {
jdk9 = false;
}
@@ -1322,4 +1323,13 @@ public class TestDateTimeZone extends TestCase {
assertEquals(false, str1.equals(str2));
}
+ //-----------------------------------------------------------------------
+ public void testIdNotAutoMapped_Asia_Yangon() throws Exception {
+ DateTimeZone zoneOld = DateTimeZone.forID("Asia/Rangoon");
+ assertEquals(zoneOld.getID(), "Asia/Yangon");
+
+ DateTimeZone zoneNew = DateTimeZone.forID("Asia/Yangon");
+ assertEquals(zoneNew.getID(), "Asia/Yangon");
+ }
+
}
diff --git a/src/test/java/org/joda/time/TestDateTimeZoneCutover.java b/src/test/java/org/joda/time/TestDateTimeZoneCutover.java
index 695ad6c7..87227e2d 100644
--- a/src/test/java/org/joda/time/TestDateTimeZoneCutover.java
+++ b/src/test/java/org/joda/time/TestDateTimeZoneCutover.java
@@ -40,9 +40,11 @@ public class TestDateTimeZoneCutover extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestDateTime_Basics.java b/src/test/java/org/joda/time/TestDateTime_Basics.java
index 1172ef98..89779e77 100644
--- a/src/test/java/org/joda/time/TestDateTime_Basics.java
+++ b/src/test/java/org/joda/time/TestDateTime_Basics.java
@@ -106,6 +106,7 @@ public class TestDateTime_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -116,6 +117,7 @@ public class TestDateTime_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
@@ -306,6 +308,7 @@ public class TestDateTime_Basics extends TestCase {
}
class MockInstant extends AbstractInstant {
+ @Override
public String toString() {
return null;
}
@@ -319,18 +322,23 @@ public class TestDateTime_Basics extends TestCase {
class MockEqualsChronology extends BaseChronology {
private static final long serialVersionUID = 1L;
+ @Override
public boolean equals(Object obj) {
return obj instanceof MockEqualsChronology;
}
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return this;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
return this;
}
+ @Override
public String toString() {
return "";
}
@@ -1301,12 +1309,15 @@ public class TestDateTime_Basics extends TestCase {
assertEquals(test.millisOfSecond(), test.property(DateTimeFieldType.millisOfSecond()));
DateTimeFieldType bad = new DateTimeFieldType("bad") {
private static final long serialVersionUID = 1L;
+ @Override
public DurationFieldType getDurationType() {
return DurationFieldType.weeks();
}
+ @Override
public DurationFieldType getRangeDurationType() {
return null;
}
+ @Override
public DateTimeField getField(Chronology chronology) {
return UnsupportedDateTimeField.getInstance(this, UnsupportedDurationField.getInstance(getDurationType()));
}
diff --git a/src/test/java/org/joda/time/TestDateTime_Constructors.java b/src/test/java/org/joda/time/TestDateTime_Constructors.java
index 7c617bfc..1843f290 100644
--- a/src/test/java/org/joda/time/TestDateTime_Constructors.java
+++ b/src/test/java/org/joda/time/TestDateTime_Constructors.java
@@ -80,6 +80,7 @@ public class TestDateTime_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -89,6 +90,7 @@ public class TestDateTime_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestDateTime_Properties.java b/src/test/java/org/joda/time/TestDateTime_Properties.java
index 7370ec1d..7fe086f0 100644
--- a/src/test/java/org/joda/time/TestDateTime_Properties.java
+++ b/src/test/java/org/joda/time/TestDateTime_Properties.java
@@ -17,13 +17,13 @@ package org.joda.time;
import java.util.Locale;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.LenientChronology;
import org.joda.time.chrono.StrictChronology;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
/**
* This class is a Junit unit test for DateTime.
*
@@ -80,6 +80,7 @@ public class TestDateTime_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -88,6 +89,7 @@ public class TestDateTime_Properties extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -356,7 +358,8 @@ public class TestDateTime_Properties extends TestCase {
assertEquals(test.getChronology().months(), test.monthOfYear().getDurationField());
assertEquals(test.getChronology().years(), test.monthOfYear().getRangeDurationField());
assertEquals(9, test.monthOfYear().getMaximumTextLength(null));
- assertEquals(3, test.monthOfYear().getMaximumShortTextLength(null));
+ int max = test.monthOfYear().getMaximumShortTextLength(null);
+ assertTrue(max == 3 || max == 4); // for JDK17+
test = new DateTime(2004, 7, 9, 0, 0, 0, 0);
assertEquals("juillet", test.monthOfYear().getAsText(Locale.FRENCH));
assertEquals("juillet", test.monthOfYear().getField().getAsText(7, Locale.FRENCH));
diff --git a/src/test/java/org/joda/time/TestDays.java b/src/test/java/org/joda/time/TestDays.java
index ccbad3be..77440de6 100644
--- a/src/test/java/org/joda/time/TestDays.java
+++ b/src/test/java/org/joda/time/TestDays.java
@@ -45,9 +45,11 @@ public class TestDays extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestDurationField.java b/src/test/java/org/joda/time/TestDurationField.java
index d5c3ed2a..ee43431b 100644
--- a/src/test/java/org/joda/time/TestDurationField.java
+++ b/src/test/java/org/joda/time/TestDurationField.java
@@ -39,9 +39,11 @@ public class TestDurationField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestDurationFieldType.java b/src/test/java/org/joda/time/TestDurationFieldType.java
index 9f2bfb76..aef6f085 100644
--- a/src/test/java/org/joda/time/TestDurationFieldType.java
+++ b/src/test/java/org/joda/time/TestDurationFieldType.java
@@ -45,9 +45,11 @@ public class TestDurationFieldType extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestDuration_Basics.java b/src/test/java/org/joda/time/TestDuration_Basics.java
index 3f0e3b4c..1e32e392 100644
--- a/src/test/java/org/joda/time/TestDuration_Basics.java
+++ b/src/test/java/org/joda/time/TestDuration_Basics.java
@@ -82,6 +82,7 @@ public class TestDuration_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -92,6 +93,7 @@ public class TestDuration_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
@@ -849,6 +851,7 @@ public class TestDuration_Basics extends TestCase {
public MockMutableDuration(long duration) {
super(duration);
}
+ @Override
public void setMillis(long duration) {
super.setMillis(duration);
}
diff --git a/src/test/java/org/joda/time/TestDuration_Constructors.java b/src/test/java/org/joda/time/TestDuration_Constructors.java
index 9501f1e4..9bf4c776 100644
--- a/src/test/java/org/joda/time/TestDuration_Constructors.java
+++ b/src/test/java/org/joda/time/TestDuration_Constructors.java
@@ -74,6 +74,7 @@ public class TestDuration_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -84,6 +85,7 @@ public class TestDuration_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestHours.java b/src/test/java/org/joda/time/TestHours.java
index fe8791d0..7c597205 100644
--- a/src/test/java/org/joda/time/TestHours.java
+++ b/src/test/java/org/joda/time/TestHours.java
@@ -45,9 +45,11 @@ public class TestHours extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestInstant_Basics.java b/src/test/java/org/joda/time/TestInstant_Basics.java
index 97a177e9..6a5ca472 100644
--- a/src/test/java/org/joda/time/TestInstant_Basics.java
+++ b/src/test/java/org/joda/time/TestInstant_Basics.java
@@ -84,6 +84,7 @@ public class TestInstant_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -94,6 +95,7 @@ public class TestInstant_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
@@ -205,6 +207,7 @@ public class TestInstant_Basics extends TestCase {
}
class MockInstant extends AbstractInstant {
+ @Override
public String toString() {
return null;
}
diff --git a/src/test/java/org/joda/time/TestInstant_Constructors.java b/src/test/java/org/joda/time/TestInstant_Constructors.java
index 221b691c..08c2732d 100644
--- a/src/test/java/org/joda/time/TestInstant_Constructors.java
+++ b/src/test/java/org/joda/time/TestInstant_Constructors.java
@@ -68,6 +68,7 @@ public class TestInstant_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -77,6 +78,7 @@ public class TestInstant_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestInterval_Basics.java b/src/test/java/org/joda/time/TestInterval_Basics.java
index 1d933472..a3a80ce7 100644
--- a/src/test/java/org/joda/time/TestInterval_Basics.java
+++ b/src/test/java/org/joda/time/TestInterval_Basics.java
@@ -89,6 +89,7 @@ public class TestInterval_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -101,6 +102,7 @@ public class TestInterval_Basics extends TestCase {
interval33 = new Interval(3, 3);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestInterval_Constructors.java b/src/test/java/org/joda/time/TestInterval_Constructors.java
index 5e36cdb4..430e7096 100644
--- a/src/test/java/org/joda/time/TestInterval_Constructors.java
+++ b/src/test/java/org/joda/time/TestInterval_Constructors.java
@@ -82,6 +82,7 @@ public class TestInterval_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -92,6 +93,7 @@ public class TestInterval_Constructors extends TestCase {
Locale.setDefault(Locale.FRANCE);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestLocalDateTime_Basics.java b/src/test/java/org/joda/time/TestLocalDateTime_Basics.java
index b3f19036..5fedb665 100644
--- a/src/test/java/org/joda/time/TestLocalDateTime_Basics.java
+++ b/src/test/java/org/joda/time/TestLocalDateTime_Basics.java
@@ -96,6 +96,7 @@ public class TestLocalDateTime_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW_UTC);
zone = DateTimeZone.getDefault();
@@ -104,6 +105,7 @@ public class TestLocalDateTime_Basics extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -311,9 +313,11 @@ public class TestLocalDateTime_Basics extends TestCase {
}
class MockInstant extends MockPartial {
+ @Override
public Chronology getChronology() {
return COPTIC_UTC;
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.year(),
@@ -322,6 +326,7 @@ public class TestLocalDateTime_Basics extends TestCase {
COPTIC_UTC.millisOfDay(),
};
}
+ @Override
public int[] getValues() {
return new int[] {1970, 6, 9, MILLIS_OF_DAY_UTC};
}
diff --git a/src/test/java/org/joda/time/TestLocalDateTime_Constructors.java b/src/test/java/org/joda/time/TestLocalDateTime_Constructors.java
index 55d49210..a2b04acc 100644
--- a/src/test/java/org/joda/time/TestLocalDateTime_Constructors.java
+++ b/src/test/java/org/joda/time/TestLocalDateTime_Constructors.java
@@ -78,12 +78,14 @@ public class TestLocalDateTime_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(MOSCOW);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestLocalDateTime_Properties.java b/src/test/java/org/joda/time/TestLocalDateTime_Properties.java
index 6667a961..3f581d7d 100644
--- a/src/test/java/org/joda/time/TestLocalDateTime_Properties.java
+++ b/src/test/java/org/joda/time/TestLocalDateTime_Properties.java
@@ -68,6 +68,7 @@ public class TestLocalDateTime_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -76,6 +77,7 @@ public class TestLocalDateTime_Properties extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestLocalDate_Basics.java b/src/test/java/org/joda/time/TestLocalDate_Basics.java
index 7fc7cef6..379b6bb1 100644
--- a/src/test/java/org/joda/time/TestLocalDate_Basics.java
+++ b/src/test/java/org/joda/time/TestLocalDate_Basics.java
@@ -101,6 +101,7 @@ public class TestLocalDate_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -109,6 +110,7 @@ public class TestLocalDate_Basics extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -268,9 +270,11 @@ public class TestLocalDate_Basics extends TestCase {
}
class MockInstant extends MockPartial {
+ @Override
public Chronology getChronology() {
return COPTIC_UTC;
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.year(),
@@ -278,6 +282,7 @@ public class TestLocalDate_Basics extends TestCase {
COPTIC_UTC.dayOfMonth(),
};
}
+ @Override
public int[] getValues() {
return new int[] {1970, 6, 9};
}
diff --git a/src/test/java/org/joda/time/TestLocalDate_Constructors.java b/src/test/java/org/joda/time/TestLocalDate_Constructors.java
index 87b240ce..6393366a 100644
--- a/src/test/java/org/joda/time/TestLocalDate_Constructors.java
+++ b/src/test/java/org/joda/time/TestLocalDate_Constructors.java
@@ -70,12 +70,14 @@ public class TestLocalDate_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestLocalDate_Properties.java b/src/test/java/org/joda/time/TestLocalDate_Properties.java
index 8742c445..726174a3 100644
--- a/src/test/java/org/joda/time/TestLocalDate_Properties.java
+++ b/src/test/java/org/joda/time/TestLocalDate_Properties.java
@@ -63,6 +63,7 @@ public class TestLocalDate_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -71,6 +72,7 @@ public class TestLocalDate_Properties extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestLocalTime_Basics.java b/src/test/java/org/joda/time/TestLocalTime_Basics.java
index 5f0fd1e3..1996298e 100644
--- a/src/test/java/org/joda/time/TestLocalTime_Basics.java
+++ b/src/test/java/org/joda/time/TestLocalTime_Basics.java
@@ -80,12 +80,14 @@ public class TestLocalTime_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -226,12 +228,15 @@ public class TestLocalTime_Basics extends TestCase {
DateTimeFieldType d = new DateTimeFieldType("hours") {
private static final long serialVersionUID = 1L;
+ @Override
public DurationFieldType getDurationType() {
return DurationFieldType.hours();
}
+ @Override
public DurationFieldType getRangeDurationType() {
return null;
}
+ @Override
public DateTimeField getField(Chronology chronology) {
return chronology.hourOfDay();
}
@@ -240,12 +245,15 @@ public class TestLocalTime_Basics extends TestCase {
d = new DateTimeFieldType("hourOfYear") {
private static final long serialVersionUID = 1L;
+ @Override
public DurationFieldType getDurationType() {
return DurationFieldType.hours();
}
+ @Override
public DurationFieldType getRangeDurationType() {
return DurationFieldType.years();
}
+ @Override
public DateTimeField getField(Chronology chronology) {
return chronology.hourOfDay();
}
@@ -293,9 +301,11 @@ public class TestLocalTime_Basics extends TestCase {
}
class MockInstant extends MockPartial {
+ @Override
public Chronology getChronology() {
return COPTIC_UTC;
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.hourOfDay(),
@@ -304,6 +314,7 @@ public class TestLocalTime_Basics extends TestCase {
COPTIC_UTC.millisOfSecond(),
};
}
+ @Override
public int[] getValues() {
return new int[] {10, 20, 30, 40};
}
diff --git a/src/test/java/org/joda/time/TestLocalTime_Constructors.java b/src/test/java/org/joda/time/TestLocalTime_Constructors.java
index 68c5bfc0..0b3a0452 100644
--- a/src/test/java/org/joda/time/TestLocalTime_Constructors.java
+++ b/src/test/java/org/joda/time/TestLocalTime_Constructors.java
@@ -81,6 +81,7 @@ public class TestLocalTime_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -88,6 +89,7 @@ public class TestLocalTime_Constructors extends TestCase {
java.util.TimeZone.setDefault(LONDON.toTimeZone());
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestLocalTime_Properties.java b/src/test/java/org/joda/time/TestLocalTime_Properties.java
index 4cec9aa0..9a4b95e8 100644
--- a/src/test/java/org/joda/time/TestLocalTime_Properties.java
+++ b/src/test/java/org/joda/time/TestLocalTime_Properties.java
@@ -62,12 +62,14 @@ public class TestLocalTime_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestMinMaxLong.java b/src/test/java/org/joda/time/TestMinMaxLong.java
index 992b064f..255c47b0 100644
--- a/src/test/java/org/joda/time/TestMinMaxLong.java
+++ b/src/test/java/org/joda/time/TestMinMaxLong.java
@@ -48,6 +48,7 @@ public class TestMinMaxLong extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
zone = DateTimeZone.getDefault();
locale = Locale.getDefault();
@@ -56,6 +57,7 @@ public class TestMinMaxLong extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(zone);
java.util.TimeZone.setDefault(zone.toTimeZone());
diff --git a/src/test/java/org/joda/time/TestMinutes.java b/src/test/java/org/joda/time/TestMinutes.java
index 53c5202d..3cc1a7d3 100644
--- a/src/test/java/org/joda/time/TestMinutes.java
+++ b/src/test/java/org/joda/time/TestMinutes.java
@@ -45,9 +45,11 @@ public class TestMinutes extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestMonthDay_Basics.java b/src/test/java/org/joda/time/TestMonthDay_Basics.java
index 9cd923d9..92c44cf2 100644
--- a/src/test/java/org/joda/time/TestMonthDay_Basics.java
+++ b/src/test/java/org/joda/time/TestMonthDay_Basics.java
@@ -70,12 +70,14 @@ public class TestMonthDay_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestMonthDay_Constructors.java b/src/test/java/org/joda/time/TestMonthDay_Constructors.java
index 7080d83c..47103abd 100644
--- a/src/test/java/org/joda/time/TestMonthDay_Constructors.java
+++ b/src/test/java/org/joda/time/TestMonthDay_Constructors.java
@@ -65,12 +65,14 @@ public class TestMonthDay_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestMonthDay_Properties.java b/src/test/java/org/joda/time/TestMonthDay_Properties.java
index 9e6ba086..69d80664 100644
--- a/src/test/java/org/joda/time/TestMonthDay_Properties.java
+++ b/src/test/java/org/joda/time/TestMonthDay_Properties.java
@@ -17,13 +17,13 @@ package org.joda.time;
import java.util.Locale;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.LenientChronology;
import org.joda.time.chrono.StrictChronology;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
/**
* This class is a Junit unit test for MonthDay. Based on {@link TestYearMonth_Propeties}
*/
@@ -60,6 +60,7 @@ public class TestMonthDay_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -68,6 +69,7 @@ public class TestMonthDay_Properties extends TestCase {
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -88,12 +90,14 @@ public class TestMonthDay_Properties extends TestCase {
assertEquals("9", test.monthOfYear().getAsString());
assertEquals("September", test.monthOfYear().getAsText());
assertEquals("septembre", test.monthOfYear().getAsText(Locale.FRENCH));
- assertEquals("Sep", test.monthOfYear().getAsShortText());
+ String text = test.monthOfYear().getAsShortText();
+ assertTrue(text.equals("Sep") || text.equals("Sept"));
assertEquals("sept.", test.monthOfYear().getAsShortText(Locale.FRENCH));
assertEquals(test.getChronology().months(), test.monthOfYear().getDurationField());
// assertEquals(test.getChronology().days(), test.dayOfMonth().getRangeDurationField());
assertEquals(9, test.monthOfYear().getMaximumTextLength(null));
- assertEquals(3, test.monthOfYear().getMaximumShortTextLength(null));
+ int max = test.monthOfYear().getMaximumShortTextLength(null);
+ assertTrue(max == 3 || max == 4); // for JDK17+
}
public void testPropertyGetMaxMinValuesMonthOfYear() {
diff --git a/src/test/java/org/joda/time/TestMonths.java b/src/test/java/org/joda/time/TestMonths.java
index 22e7a2c9..e3805691 100644
--- a/src/test/java/org/joda/time/TestMonths.java
+++ b/src/test/java/org/joda/time/TestMonths.java
@@ -45,9 +45,11 @@ public class TestMonths extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestMutableDateTime_Adds.java b/src/test/java/org/joda/time/TestMutableDateTime_Adds.java
index 97228fc6..83962376 100644
--- a/src/test/java/org/joda/time/TestMutableDateTime_Adds.java
+++ b/src/test/java/org/joda/time/TestMutableDateTime_Adds.java
@@ -75,6 +75,7 @@ public class TestMutableDateTime_Adds extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -85,6 +86,7 @@ public class TestMutableDateTime_Adds extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutableDateTime_Basics.java b/src/test/java/org/joda/time/TestMutableDateTime_Basics.java
index f81f59b9..ae6a24b3 100644
--- a/src/test/java/org/joda/time/TestMutableDateTime_Basics.java
+++ b/src/test/java/org/joda/time/TestMutableDateTime_Basics.java
@@ -90,6 +90,7 @@ public class TestMutableDateTime_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -100,6 +101,7 @@ public class TestMutableDateTime_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
@@ -249,6 +251,7 @@ public class TestMutableDateTime_Basics extends TestCase {
}
class MockInstant extends AbstractInstant {
+ @Override
public String toString() {
return null;
}
@@ -262,18 +265,23 @@ public class TestMutableDateTime_Basics extends TestCase {
class MockEqualsChronology extends BaseChronology {
private static final long serialVersionUID = 1L;
+ @Override
public boolean equals(Object obj) {
return obj instanceof MockEqualsChronology;
}
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return this;
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
return this;
}
+ @Override
public String toString() {
return "";
}
@@ -732,12 +740,15 @@ public class TestMutableDateTime_Basics extends TestCase {
assertEquals(test.millisOfSecond(), test.property(DateTimeFieldType.millisOfSecond()));
DateTimeFieldType bad = new DateTimeFieldType("bad") {
private static final long serialVersionUID = 1L;
+ @Override
public DurationFieldType getDurationType() {
return DurationFieldType.weeks();
}
+ @Override
public DurationFieldType getRangeDurationType() {
return null;
}
+ @Override
public DateTimeField getField(Chronology chronology) {
return UnsupportedDateTimeField.getInstance(this, UnsupportedDurationField.getInstance(getDurationType()));
}
diff --git a/src/test/java/org/joda/time/TestMutableDateTime_Constructors.java b/src/test/java/org/joda/time/TestMutableDateTime_Constructors.java
index bd5f189d..373e0af4 100644
--- a/src/test/java/org/joda/time/TestMutableDateTime_Constructors.java
+++ b/src/test/java/org/joda/time/TestMutableDateTime_Constructors.java
@@ -80,6 +80,7 @@ public class TestMutableDateTime_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -89,6 +90,7 @@ public class TestMutableDateTime_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestMutableDateTime_Properties.java b/src/test/java/org/joda/time/TestMutableDateTime_Properties.java
index 37d62352..70cd889d 100644
--- a/src/test/java/org/joda/time/TestMutableDateTime_Properties.java
+++ b/src/test/java/org/joda/time/TestMutableDateTime_Properties.java
@@ -73,6 +73,7 @@ public class TestMutableDateTime_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -81,6 +82,7 @@ public class TestMutableDateTime_Properties extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -242,7 +244,8 @@ public class TestMutableDateTime_Properties extends TestCase {
assertEquals(test.getChronology().months(), test.monthOfYear().getDurationField());
assertEquals(test.getChronology().years(), test.monthOfYear().getRangeDurationField());
assertEquals(9, test.monthOfYear().getMaximumTextLength(null));
- assertEquals(3, test.monthOfYear().getMaximumShortTextLength(null));
+ int max = test.monthOfYear().getMaximumShortTextLength(null);
+ assertTrue(max == 3 || max == 4); // for JDK17+
test = new MutableDateTime(2004, 7, 9, 0, 0, 0, 0);
assertEquals("juillet", test.monthOfYear().getAsText(Locale.FRENCH));
assertEquals("juil.", test.monthOfYear().getAsShortText(Locale.FRENCH));
diff --git a/src/test/java/org/joda/time/TestMutableDateTime_Sets.java b/src/test/java/org/joda/time/TestMutableDateTime_Sets.java
index aab5bf38..d0294d9a 100644
--- a/src/test/java/org/joda/time/TestMutableDateTime_Sets.java
+++ b/src/test/java/org/joda/time/TestMutableDateTime_Sets.java
@@ -78,6 +78,7 @@ public class TestMutableDateTime_Sets extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -88,6 +89,7 @@ public class TestMutableDateTime_Sets extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutableInterval_Basics.java b/src/test/java/org/joda/time/TestMutableInterval_Basics.java
index 091d7a4b..a8a30faf 100644
--- a/src/test/java/org/joda/time/TestMutableInterval_Basics.java
+++ b/src/test/java/org/joda/time/TestMutableInterval_Basics.java
@@ -84,6 +84,7 @@ public class TestMutableInterval_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -94,6 +95,7 @@ public class TestMutableInterval_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutableInterval_Constructors.java b/src/test/java/org/joda/time/TestMutableInterval_Constructors.java
index 99c4ec93..ff9c3c1e 100644
--- a/src/test/java/org/joda/time/TestMutableInterval_Constructors.java
+++ b/src/test/java/org/joda/time/TestMutableInterval_Constructors.java
@@ -80,6 +80,7 @@ public class TestMutableInterval_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -90,6 +91,7 @@ public class TestMutableInterval_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutableInterval_Updates.java b/src/test/java/org/joda/time/TestMutableInterval_Updates.java
index 2ea700f9..f78b0839 100644
--- a/src/test/java/org/joda/time/TestMutableInterval_Updates.java
+++ b/src/test/java/org/joda/time/TestMutableInterval_Updates.java
@@ -77,6 +77,7 @@ public class TestMutableInterval_Updates extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -87,6 +88,7 @@ public class TestMutableInterval_Updates extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutablePeriod_Basics.java b/src/test/java/org/joda/time/TestMutablePeriod_Basics.java
index 176338ca..806d183b 100644
--- a/src/test/java/org/joda/time/TestMutablePeriod_Basics.java
+++ b/src/test/java/org/joda/time/TestMutablePeriod_Basics.java
@@ -80,6 +80,7 @@ public class TestMutablePeriod_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -90,6 +91,7 @@ public class TestMutablePeriod_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutablePeriod_Constructors.java b/src/test/java/org/joda/time/TestMutablePeriod_Constructors.java
index 5f0098d9..8f216fa6 100644
--- a/src/test/java/org/joda/time/TestMutablePeriod_Constructors.java
+++ b/src/test/java/org/joda/time/TestMutablePeriod_Constructors.java
@@ -77,6 +77,7 @@ public class TestMutablePeriod_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -87,6 +88,7 @@ public class TestMutablePeriod_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestMutablePeriod_Updates.java b/src/test/java/org/joda/time/TestMutablePeriod_Updates.java
index 5c42f501..24066626 100644
--- a/src/test/java/org/joda/time/TestMutablePeriod_Updates.java
+++ b/src/test/java/org/joda/time/TestMutablePeriod_Updates.java
@@ -76,6 +76,7 @@ public class TestMutablePeriod_Updates extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -86,6 +87,7 @@ public class TestMutablePeriod_Updates extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestPartial_Basics.java b/src/test/java/org/joda/time/TestPartial_Basics.java
index d49cb288..6f75fa34 100644
--- a/src/test/java/org/joda/time/TestPartial_Basics.java
+++ b/src/test/java/org/joda/time/TestPartial_Basics.java
@@ -75,12 +75,14 @@ public class TestPartial_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestPartial_Constructors.java b/src/test/java/org/joda/time/TestPartial_Constructors.java
index 8d5e2027..f5a892e8 100644
--- a/src/test/java/org/joda/time/TestPartial_Constructors.java
+++ b/src/test/java/org/joda/time/TestPartial_Constructors.java
@@ -56,12 +56,14 @@ public class TestPartial_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestPartial_Match.java b/src/test/java/org/joda/time/TestPartial_Match.java
index 60e5c206..f593c287 100644
--- a/src/test/java/org/joda/time/TestPartial_Match.java
+++ b/src/test/java/org/joda/time/TestPartial_Match.java
@@ -79,12 +79,14 @@ public class TestPartial_Match extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestPartial_Properties.java b/src/test/java/org/joda/time/TestPartial_Properties.java
index d26298ab..a1e1ee7e 100644
--- a/src/test/java/org/joda/time/TestPartial_Properties.java
+++ b/src/test/java/org/joda/time/TestPartial_Properties.java
@@ -71,11 +71,13 @@ public class TestPartial_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(zone);
zone = null;
diff --git a/src/test/java/org/joda/time/TestPeriodType.java b/src/test/java/org/joda/time/TestPeriodType.java
index 17497d38..0369ac3d 100644
--- a/src/test/java/org/joda/time/TestPeriodType.java
+++ b/src/test/java/org/joda/time/TestPeriodType.java
@@ -78,6 +78,7 @@ public class TestPeriodType extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -88,6 +89,7 @@ public class TestPeriodType extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestPeriod_Basics.java b/src/test/java/org/joda/time/TestPeriod_Basics.java
index 46c6871f..22f44dcd 100644
--- a/src/test/java/org/joda/time/TestPeriod_Basics.java
+++ b/src/test/java/org/joda/time/TestPeriod_Basics.java
@@ -84,6 +84,7 @@ public class TestPeriod_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -94,6 +95,7 @@ public class TestPeriod_Basics extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestPeriod_Constructors.java b/src/test/java/org/joda/time/TestPeriod_Constructors.java
index 1ebf258e..372b044e 100644
--- a/src/test/java/org/joda/time/TestPeriod_Constructors.java
+++ b/src/test/java/org/joda/time/TestPeriod_Constructors.java
@@ -65,6 +65,7 @@ public class TestPeriod_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -75,6 +76,7 @@ public class TestPeriod_Constructors extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestSeconds.java b/src/test/java/org/joda/time/TestSeconds.java
index 63a8426d..e18a8f27 100644
--- a/src/test/java/org/joda/time/TestSeconds.java
+++ b/src/test/java/org/joda/time/TestSeconds.java
@@ -45,9 +45,11 @@ public class TestSeconds extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestSerialization.java b/src/test/java/org/joda/time/TestSerialization.java
index 434d4e87..5f5da0a7 100644
--- a/src/test/java/org/joda/time/TestSerialization.java
+++ b/src/test/java/org/joda/time/TestSerialization.java
@@ -97,6 +97,7 @@ public class TestSerialization extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -107,6 +108,7 @@ public class TestSerialization extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/TestStringConvert.java b/src/test/java/org/joda/time/TestStringConvert.java
index e4fce081..d571e046 100644
--- a/src/test/java/org/joda/time/TestStringConvert.java
+++ b/src/test/java/org/joda/time/TestStringConvert.java
@@ -42,9 +42,11 @@ public class TestStringConvert extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestTimeOfDay_Basics.java b/src/test/java/org/joda/time/TestTimeOfDay_Basics.java
index 671740ba..528920d1 100644
--- a/src/test/java/org/joda/time/TestTimeOfDay_Basics.java
+++ b/src/test/java/org/joda/time/TestTimeOfDay_Basics.java
@@ -79,12 +79,14 @@ public class TestTimeOfDay_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -219,9 +221,11 @@ public class TestTimeOfDay_Basics extends TestCase {
}
class MockInstant extends MockPartial {
+ @Override
public Chronology getChronology() {
return CopticChronology.getInstanceUTC();
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
CopticChronology.getInstanceUTC().hourOfDay(),
@@ -230,6 +234,7 @@ public class TestTimeOfDay_Basics extends TestCase {
CopticChronology.getInstanceUTC().millisOfSecond(),
};
}
+ @Override
public int[] getValues() {
return new int[] {10, 20, 30, 40};
}
diff --git a/src/test/java/org/joda/time/TestTimeOfDay_Constructors.java b/src/test/java/org/joda/time/TestTimeOfDay_Constructors.java
index 4ea820be..83a9d2c4 100644
--- a/src/test/java/org/joda/time/TestTimeOfDay_Constructors.java
+++ b/src/test/java/org/joda/time/TestTimeOfDay_Constructors.java
@@ -73,6 +73,7 @@ public class TestTimeOfDay_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -80,6 +81,7 @@ public class TestTimeOfDay_Constructors extends TestCase {
java.util.TimeZone.setDefault(LONDON.toTimeZone());
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestTimeOfDay_Properties.java b/src/test/java/org/joda/time/TestTimeOfDay_Properties.java
index ef893e1c..40ef2ba2 100644
--- a/src/test/java/org/joda/time/TestTimeOfDay_Properties.java
+++ b/src/test/java/org/joda/time/TestTimeOfDay_Properties.java
@@ -63,12 +63,14 @@ public class TestTimeOfDay_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestWeeks.java b/src/test/java/org/joda/time/TestWeeks.java
index 3ad7746f..407d0e63 100644
--- a/src/test/java/org/joda/time/TestWeeks.java
+++ b/src/test/java/org/joda/time/TestWeeks.java
@@ -45,9 +45,11 @@ public class TestWeeks extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/TestYearMonthDay_Basics.java b/src/test/java/org/joda/time/TestYearMonthDay_Basics.java
index a9c47d12..61d8e641 100644
--- a/src/test/java/org/joda/time/TestYearMonthDay_Basics.java
+++ b/src/test/java/org/joda/time/TestYearMonthDay_Basics.java
@@ -68,12 +68,14 @@ public class TestYearMonthDay_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -200,9 +202,11 @@ public class TestYearMonthDay_Basics extends TestCase {
}
class MockInstant extends MockPartial {
+ @Override
public Chronology getChronology() {
return COPTIC_UTC;
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.year(),
@@ -210,6 +214,7 @@ public class TestYearMonthDay_Basics extends TestCase {
COPTIC_UTC.dayOfMonth(),
};
}
+ @Override
public int[] getValues() {
return new int[] {1970, 6, 9};
}
diff --git a/src/test/java/org/joda/time/TestYearMonthDay_Constructors.java b/src/test/java/org/joda/time/TestYearMonthDay_Constructors.java
index e1dd8017..731fad71 100644
--- a/src/test/java/org/joda/time/TestYearMonthDay_Constructors.java
+++ b/src/test/java/org/joda/time/TestYearMonthDay_Constructors.java
@@ -66,12 +66,14 @@ public class TestYearMonthDay_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestYearMonthDay_Properties.java b/src/test/java/org/joda/time/TestYearMonthDay_Properties.java
index e16a6036..8653050e 100644
--- a/src/test/java/org/joda/time/TestYearMonthDay_Properties.java
+++ b/src/test/java/org/joda/time/TestYearMonthDay_Properties.java
@@ -64,6 +64,7 @@ public class TestYearMonthDay_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -72,6 +73,7 @@ public class TestYearMonthDay_Properties extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestYearMonth_Basics.java b/src/test/java/org/joda/time/TestYearMonth_Basics.java
index 98afd564..bc4be14b 100644
--- a/src/test/java/org/joda/time/TestYearMonth_Basics.java
+++ b/src/test/java/org/joda/time/TestYearMonth_Basics.java
@@ -72,12 +72,14 @@ public class TestYearMonth_Basics extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
@@ -200,15 +202,18 @@ public class TestYearMonth_Basics extends TestCase {
}
class MockYM extends MockPartial {
+ @Override
public Chronology getChronology() {
return COPTIC_UTC;
}
+ @Override
public DateTimeField[] getFields() {
return new DateTimeField[] {
COPTIC_UTC.year(),
COPTIC_UTC.monthOfYear(),
};
}
+ @Override
public int[] getValues() {
return new int[] {1970, 6};
}
diff --git a/src/test/java/org/joda/time/TestYearMonth_Constructors.java b/src/test/java/org/joda/time/TestYearMonth_Constructors.java
index 34364fb4..7c918022 100644
--- a/src/test/java/org/joda/time/TestYearMonth_Constructors.java
+++ b/src/test/java/org/joda/time/TestYearMonth_Constructors.java
@@ -67,12 +67,14 @@ public class TestYearMonth_Constructors extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
DateTimeZone.setDefault(LONDON);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestYearMonth_Properties.java b/src/test/java/org/joda/time/TestYearMonth_Properties.java
index bed43a6e..13bc945b 100644
--- a/src/test/java/org/joda/time/TestYearMonth_Properties.java
+++ b/src/test/java/org/joda/time/TestYearMonth_Properties.java
@@ -63,6 +63,7 @@ public class TestYearMonth_Properties extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
zone = DateTimeZone.getDefault();
@@ -71,6 +72,7 @@ public class TestYearMonth_Properties extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(zone);
diff --git a/src/test/java/org/joda/time/TestYears.java b/src/test/java/org/joda/time/TestYears.java
index 5ba7c2f8..25839c6b 100644
--- a/src/test/java/org/joda/time/TestYears.java
+++ b/src/test/java/org/joda/time/TestYears.java
@@ -45,9 +45,11 @@ public class TestYears extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/chrono/TestBuddhistChronology.java b/src/test/java/org/joda/time/chrono/TestBuddhistChronology.java
index 665d6784..e294f9d7 100644
--- a/src/test/java/org/joda/time/chrono/TestBuddhistChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestBuddhistChronology.java
@@ -71,6 +71,7 @@ public class TestBuddhistChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -81,6 +82,7 @@ public class TestBuddhistChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestCopticChronology.java b/src/test/java/org/joda/time/chrono/TestCopticChronology.java
index 008393a0..0152efb2 100644
--- a/src/test/java/org/joda/time/chrono/TestCopticChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestCopticChronology.java
@@ -74,6 +74,7 @@ public class TestCopticChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -84,6 +85,7 @@ public class TestCopticChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestEthiopicChronology.java b/src/test/java/org/joda/time/chrono/TestEthiopicChronology.java
index f7ee2b2e..3c736060 100644
--- a/src/test/java/org/joda/time/chrono/TestEthiopicChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestEthiopicChronology.java
@@ -74,6 +74,7 @@ public class TestEthiopicChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -84,6 +85,7 @@ public class TestEthiopicChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestGJChronology.java b/src/test/java/org/joda/time/chrono/TestGJChronology.java
index 9892af6f..32999ae3 100644
--- a/src/test/java/org/joda/time/chrono/TestGJChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestGJChronology.java
@@ -71,6 +71,7 @@ public class TestGJChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -81,6 +82,7 @@ public class TestGJChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestGJDate.java b/src/test/java/org/joda/time/chrono/TestGJDate.java
index ba2a1fbc..541d1815 100644
--- a/src/test/java/org/joda/time/chrono/TestGJDate.java
+++ b/src/test/java/org/joda/time/chrono/TestGJDate.java
@@ -39,9 +39,11 @@ public class TestGJDate extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/chrono/TestGregorianChronology.java b/src/test/java/org/joda/time/chrono/TestGregorianChronology.java
index 31fd5043..ea040d3c 100644
--- a/src/test/java/org/joda/time/chrono/TestGregorianChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestGregorianChronology.java
@@ -65,6 +65,7 @@ public class TestGregorianChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -75,6 +76,7 @@ public class TestGregorianChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestISOChronology.java b/src/test/java/org/joda/time/chrono/TestISOChronology.java
index 886c0ce7..0fdb4ae5 100644
--- a/src/test/java/org/joda/time/chrono/TestISOChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestISOChronology.java
@@ -71,6 +71,7 @@ public class TestISOChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -81,6 +82,7 @@ public class TestISOChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestIslamicChronology.java b/src/test/java/org/joda/time/chrono/TestIslamicChronology.java
index f2a2bfbd..74fe6c30 100644
--- a/src/test/java/org/joda/time/chrono/TestIslamicChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestIslamicChronology.java
@@ -71,6 +71,7 @@ public class TestIslamicChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -81,6 +82,7 @@ public class TestIslamicChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestJulianChronology.java b/src/test/java/org/joda/time/chrono/TestJulianChronology.java
index 97f78a07..5a318299 100644
--- a/src/test/java/org/joda/time/chrono/TestJulianChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestJulianChronology.java
@@ -62,6 +62,7 @@ public class TestJulianChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -72,6 +73,7 @@ public class TestJulianChronology extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/chrono/TestLenientChronology.java b/src/test/java/org/joda/time/chrono/TestLenientChronology.java
index ae121244..deb8e32a 100644
--- a/src/test/java/org/joda/time/chrono/TestLenientChronology.java
+++ b/src/test/java/org/joda/time/chrono/TestLenientChronology.java
@@ -41,9 +41,11 @@ public class TestLenientChronology extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJChronology.java b/src/test/java/org/joda/time/chrono/gj/TestGJChronology.java
index ee7330c9..281acad5 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJChronology.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJChronology.java
@@ -91,10 +91,12 @@ abstract class TestGJChronology extends BaseChronology {
iEpochMillis = fixedFromGJ(epochYear, epochMonth, epochDay) * MILLIS_PER_DAY;
}
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return this;
}
@@ -102,6 +104,7 @@ abstract class TestGJChronology extends BaseChronology {
/**
* Unsupported.
*/
+ @Override
public Chronology withZone(DateTimeZone zone) {
throw new UnsupportedOperationException();
}
@@ -114,50 +117,62 @@ abstract class TestGJChronology extends BaseChronology {
return millis - mod(millis, MILLIS_PER_DAY);
}
+ @Override
public DurationField days() {
return dayOfWeek().getDurationField();
}
+ @Override
public DateTimeField dayOfWeek() {
return new TestGJDayOfWeekField(this);
}
+ @Override
public DateTimeField dayOfMonth() {
return new TestGJDayOfMonthField(this);
}
+ @Override
public DateTimeField dayOfYear() {
return new TestGJDayOfYearField(this);
}
+ @Override
public DurationField weeks() {
return weekOfWeekyear().getDurationField();
}
+ @Override
public DateTimeField weekOfWeekyear() {
return new TestGJWeekOfWeekyearField(this);
}
+ @Override
public DurationField weekyears() {
return weekyear().getDurationField();
}
+ @Override
public DateTimeField weekyear() {
return new TestGJWeekyearField(this);
}
+ @Override
public DurationField months() {
return monthOfYear().getDurationField();
}
+ @Override
public DateTimeField monthOfYear() {
return new TestGJMonthOfYearField(this);
}
+ @Override
public DurationField years() {
return year().getDurationField();
}
+ @Override
public DateTimeField year() {
return new TestGJYearField(this);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJDateTimeField.java b/src/test/java/org/joda/time/chrono/gj/TestGJDateTimeField.java
index 3688d4bc..a86d07cd 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJDateTimeField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJDateTimeField.java
@@ -30,14 +30,17 @@ abstract class TestGJDateTimeField extends ImpreciseDateTimeField {
iChronology = chrono;
}
+ @Override
public boolean isLenient() {
return false;
}
+ @Override
public long add(long instant, int value) {
return add(instant, (long)value);
}
+ @Override
public abstract long add(long instant, long value);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfMonthField.java b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfMonthField.java
index 36c347e7..424b5b2c 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfMonthField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfMonthField.java
@@ -27,32 +27,39 @@ class TestGJDayOfMonthField extends TestGJDateTimeField {
super(DateTimeFieldType.dayOfMonth(), TestGJChronology.MILLIS_PER_DAY, chrono);
}
+ @Override
public int get(long millis) {
return iChronology.gjFromMillis(millis)[2];
}
+ @Override
public long set(long millis, int value) {
int[] ymd = iChronology.gjFromMillis(millis);
return iChronology.getTimeOnlyMillis(millis)
+ iChronology.millisFromGJ(ymd[0], ymd[1], value);
}
+ @Override
public long add(long millis, long value) {
return millis + value * TestGJChronology.MILLIS_PER_DAY;
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.months();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 31;
}
+ @Override
public int getMaximumValue(long millis) {
int[] lengths = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if (iChronology.year().isLeap(millis)) {
@@ -61,6 +68,7 @@ class TestGJDayOfMonthField extends TestGJDateTimeField {
return lengths[iChronology.monthOfYear().get(millis)];
}
+ @Override
public long roundFloor(long millis) {
return iChronology.getDateOnlyMillis(millis);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfWeekField.java b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfWeekField.java
index 53660ac9..0011cde6 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfWeekField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfWeekField.java
@@ -27,6 +27,7 @@ class TestGJDayOfWeekField extends TestGJDateTimeField {
super(DateTimeFieldType.dayOfWeek(), TestGJChronology.MILLIS_PER_DAY, chrono);
}
+ @Override
public int get(long millis) {
int dayOfWeek = (int) TestGJChronology.mod(iChronology.fixedFromMillis(millis), 7);
if (dayOfWeek == 0) {
@@ -35,26 +36,32 @@ class TestGJDayOfWeekField extends TestGJDateTimeField {
return dayOfWeek;
}
+ @Override
public long set(long millis, int value) {
return add(millis, (long) value - get(millis));
}
+ @Override
public long add(long millis, long value) {
return millis + value * TestGJChronology.MILLIS_PER_DAY;
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.weeks();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 7;
}
+ @Override
public long roundFloor(long millis) {
return iChronology.getDateOnlyMillis(millis);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfYearField.java b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfYearField.java
index 8fa93163..c7e354ed 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJDayOfYearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJDayOfYearField.java
@@ -27,36 +27,44 @@ class TestGJDayOfYearField extends TestGJDateTimeField {
super(DateTimeFieldType.dayOfYear(), TestGJChronology.MILLIS_PER_DAY, chrono);
}
+ @Override
public int get(long millis) {
int year = iChronology.gjYearFromMillis(millis);
return (int)(iChronology.fixedFromMillis(millis)
- iChronology.fixedFromGJ(year, 1, 1)) + 1;
}
+ @Override
public long set(long millis, int value) {
return add(millis, (long) value - get(millis));
}
+ @Override
public long add(long millis, long value) {
return millis + value * TestGJChronology.MILLIS_PER_DAY;
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.years();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 366;
}
+ @Override
public int getMaximumValue(long millis) {
return iChronology.year().isLeap(millis) ? 366 : 365;
}
+ @Override
public long roundFloor(long millis) {
return iChronology.getDateOnlyMillis(millis);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJMonthOfYearField.java b/src/test/java/org/joda/time/chrono/gj/TestGJMonthOfYearField.java
index 42219073..01087931 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJMonthOfYearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJMonthOfYearField.java
@@ -27,10 +27,12 @@ class TestGJMonthOfYearField extends TestGJDateTimeField {
super(DateTimeFieldType.monthOfYear(), chrono.millisPerMonth(), chrono);
}
+ @Override
public int get(long millis) {
return iChronology.gjFromMillis(millis)[1];
}
+ @Override
public long set(long millis, int value) {
long timeOnlyMillis = iChronology.getTimeOnlyMillis(millis);
int[] ymd = iChronology.gjFromMillis(millis);
@@ -44,6 +46,7 @@ class TestGJMonthOfYearField extends TestGJDateTimeField {
return timeOnlyMillis + iChronology.millisFromGJ(ymd[0], value, ymd[2]);
}
+ @Override
public long add(long millis, long value) {
int newYear = iChronology.year().get(millis)
+ (int)TestGJChronology.div(value, 12);
@@ -61,31 +64,38 @@ class TestGJMonthOfYearField extends TestGJDateTimeField {
return millis;
}
+ @Override
public boolean isLeap(long millis) {
int[] ymd = iChronology.gjFromMillis(millis);
return ymd[1] == 2 && iChronology.isLeapYear(ymd[0]);
}
+ @Override
public int getLeapAmount(long millis) {
return isLeap(millis) ? 1 : 0;
}
+ @Override
public DurationField getLeapDurationField() {
return iChronology.days();
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.years();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 12;
}
+ @Override
public long roundFloor(long millis) {
int[] ymd = iChronology.gjFromMillis(millis);
return iChronology.millisFromGJ(ymd[0], ymd[1], 1);
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJWeekOfWeekyearField.java b/src/test/java/org/joda/time/chrono/gj/TestGJWeekOfWeekyearField.java
index b9830e90..8061e37c 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJWeekOfWeekyearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJWeekOfWeekyearField.java
@@ -28,32 +28,39 @@ class TestGJWeekOfWeekyearField extends TestGJDateTimeField {
(long)(TestGJChronology.MILLIS_PER_DAY * 7), chrono);
}
+ @Override
public int get(long millis) {
return iChronology.isoFromMillis(millis)[1];
}
+ @Override
public long set(long millis, int value) {
int[] wwd = iChronology.isoFromMillis(millis);
return iChronology.getTimeOnlyMillis(millis)
+ iChronology.millisFromISO(wwd[0], value, wwd[2]);
}
+ @Override
public long add(long millis, long value) {
return iChronology.dayOfYear().add(millis, value * 7);
}
+ @Override
public DurationField getRangeDurationField() {
return iChronology.weeks();
}
+ @Override
public int getMinimumValue() {
return 1;
}
+ @Override
public int getMaximumValue() {
return 53;
}
+ @Override
public int getMaximumValue(long millis) {
// Move millis to end of weekyear.
millis = iChronology.weekyear().roundFloor(millis);
@@ -62,6 +69,7 @@ class TestGJWeekOfWeekyearField extends TestGJDateTimeField {
return get(millis);
}
+ @Override
public long roundFloor(long millis) {
int[] wwd = iChronology.isoFromMillis(millis);
return iChronology.millisFromISO(wwd[0], wwd[1], 1);
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJWeekyearField.java b/src/test/java/org/joda/time/chrono/gj/TestGJWeekyearField.java
index 39e3503c..518730fd 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJWeekyearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJWeekyearField.java
@@ -27,10 +27,12 @@ class TestGJWeekyearField extends TestGJDateTimeField {
super(DateTimeFieldType.weekyear(), chrono.millisPerYear(), chrono);
}
+ @Override
public int get(long millis) {
return iChronology.isoFromMillis(millis)[0];
}
+ @Override
public long set(long millis, int value) {
int[] wwd = iChronology.isoFromMillis(millis);
millis = iChronology.getTimeOnlyMillis(millis)
@@ -45,34 +47,42 @@ class TestGJWeekyearField extends TestGJDateTimeField {
return millis;
}
+ @Override
public long add(long millis, long value) {
return set(millis, (int)(get(millis) + value));
}
+ @Override
public boolean isLeap(long millis) {
return iChronology.weekOfWeekyear().getMaximumValue(millis) > 52;
}
+ @Override
public int getLeapAmount(long millis) {
return iChronology.weekOfWeekyear().getMaximumValue(millis) - 52;
}
+ @Override
public DurationField getLeapDurationField() {
return iChronology.weeks();
}
+ @Override
public DurationField getRangeDurationField() {
return null;
}
+ @Override
public int getMinimumValue() {
return -100000000;
}
+ @Override
public int getMaximumValue() {
return 100000000;
}
+ @Override
public long roundFloor(long millis) {
return iChronology.millisFromISO(get(millis), 1, 1);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGJYearField.java b/src/test/java/org/joda/time/chrono/gj/TestGJYearField.java
index d01e3721..9672538b 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGJYearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGJYearField.java
@@ -27,10 +27,12 @@ class TestGJYearField extends TestGJDateTimeField {
super(DateTimeFieldType.year(), chrono.millisPerYear(), chrono);
}
+ @Override
public int get(long millis) {
return iChronology.gjYearFromMillis(millis);
}
+ @Override
public long set(long millis, int value) {
int[] ymd = iChronology.gjFromMillis(millis);
millis = iChronology.getTimeOnlyMillis(millis)
@@ -41,34 +43,42 @@ class TestGJYearField extends TestGJDateTimeField {
return millis;
}
+ @Override
public long add(long millis, long value) {
return set(millis, (int)(get(millis) + value));
}
+ @Override
public boolean isLeap(long millis) {
return iChronology.isLeapYear(get(millis));
}
+ @Override
public int getLeapAmount(long millis) {
return isLeap(millis) ? 1 : 0;
}
+ @Override
public DurationField getLeapDurationField() {
return iChronology.days();
}
+ @Override
public DurationField getRangeDurationField() {
return null;
}
+ @Override
public int getMinimumValue() {
return -100000000;
}
+ @Override
public int getMaximumValue() {
return 100000000;
}
+ @Override
public long roundFloor(long millis) {
return iChronology.millisFromGJ(get(millis), 1, 1);
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestGregorianChronology.java b/src/test/java/org/joda/time/chrono/gj/TestGregorianChronology.java
index a871f935..6e7c4127 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestGregorianChronology.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestGregorianChronology.java
@@ -35,18 +35,22 @@ public final class TestGregorianChronology extends TestGJChronology {
super(epochYear, epochMonth, epochDay);
}
+ @Override
public String toString() {
return "TestGregorianChronology";
}
+ @Override
long millisPerYear() {
return (long)(365.2425 * MILLIS_PER_DAY);
}
+ @Override
long millisPerMonth() {
return (long)(365.2425 * MILLIS_PER_DAY / 12);
}
+ @Override
boolean isLeapYear(int year) {
if (mod(year, 4) == 0) {
int t = (int)mod(year, 400);
@@ -60,6 +64,7 @@ public final class TestGregorianChronology extends TestGJChronology {
/**
* @return days from 0001-01-01
*/
+ @Override
long fixedFromGJ(int year, int monthOfYear, int dayOfMonth) {
long year_m1 = year - 1;
long f = 365 * year_m1 + div(year_m1, 4) - div(year_m1, 100)
@@ -74,6 +79,7 @@ public final class TestGregorianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return gj year
*/
+ @Override
int gjYearFromFixed(long date) {
long d0 = date - 1;
long n400 = div(d0, 146097);
@@ -100,6 +106,7 @@ public final class TestGregorianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return gj year, monthOfYear, dayOfMonth
*/
+ @Override
int[] gjFromFixed(long date) {
int year = gjYearFromFixed(date);
long priorDays = date - fixedFromGJ(year, 1, 1);
@@ -117,6 +124,7 @@ public final class TestGregorianChronology extends TestGJChronology {
return new int[]{year, monthOfYear, day};
}
+ @Override
long fixedFromISO(int weekyear, int weekOfWeekyear, int dayOfWeek) {
return nthWeekday(weekOfWeekyear, 0, weekyear - 1, 12, 28) + dayOfWeek;
}
@@ -125,6 +133,7 @@ public final class TestGregorianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return iso weekyear, weekOfWeekyear, dayOfWeek (1=Monday to 7)
*/
+ @Override
int[] isoFromFixed(long date) {
int weekyear = gjYearFromFixed(date - 3);
if (date >= fixedFromISO(weekyear + 1, 1, 1)) {
diff --git a/src/test/java/org/joda/time/chrono/gj/TestJulianChronology.java b/src/test/java/org/joda/time/chrono/gj/TestJulianChronology.java
index 14ca7f2a..6c8e4fda 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestJulianChronology.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestJulianChronology.java
@@ -45,34 +45,42 @@ public final class TestJulianChronology extends TestGJChronology {
super(epochYear, epochMonth, epochDay);
}
+ @Override
public DateTimeField dayOfMonth() {
return new TestJulianDayOfMonthField(this);
}
+ @Override
public DateTimeField weekyear() {
return new TestJulianWeekyearField(this);
}
+ @Override
public DateTimeField monthOfYear() {
return new TestJulianMonthOfYearField(this);
}
+ @Override
public DateTimeField year() {
return new TestJulianYearField(this);
}
+ @Override
public String toString() {
return "TestJulianChronology";
}
+ @Override
long millisPerYear() {
return (long)(365.25 * MILLIS_PER_DAY);
}
+ @Override
long millisPerMonth() {
return (long)(365.25 * MILLIS_PER_DAY / 12);
}
+ @Override
boolean isLeapYear(int year) {
if (year == 0) {
throw new IllegalArgumentException("Illegal year: " + year);
@@ -83,6 +91,7 @@ public final class TestJulianChronology extends TestGJChronology {
/**
* @return days from 0001-01-01
*/
+ @Override
long fixedFromGJ(int year, int monthOfYear, int dayOfMonth) {
if (year == 0) {
throw new IllegalArgumentException("Illegal year: " + year);
@@ -101,6 +110,7 @@ public final class TestJulianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return gj year
*/
+ @Override
int gjYearFromFixed(long date) {
return gjFromFixed(date)[0];
}
@@ -109,6 +119,7 @@ public final class TestJulianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return gj year, monthOfYear, dayOfMonth
*/
+ @Override
int[] gjFromFixed(long date) {
long approx = div(4 * (date - JULIAN_EPOCH) + 1464, 1461);
long year = (approx <= 0) ? approx - 1 : approx;
@@ -131,6 +142,7 @@ public final class TestJulianChronology extends TestGJChronology {
return new int[]{year_i, monthOfYear, day};
}
+ @Override
long fixedFromISO(int weekyear, int weekOfWeekyear, int dayOfWeek) {
if (weekyear == 0) {
throw new IllegalArgumentException("Illegal weekyear: " + weekyear);
@@ -147,6 +159,7 @@ public final class TestJulianChronology extends TestGJChronology {
* @param date days from 0001-01-01
* @return iso weekyear, weekOfWeekyear, dayOfWeek (1=Monday to 7)
*/
+ @Override
int[] isoFromFixed(long date) {
int weekyear = gjYearFromFixed(date - 3);
int nextWeekyear;
diff --git a/src/test/java/org/joda/time/chrono/gj/TestJulianMonthOfYearField.java b/src/test/java/org/joda/time/chrono/gj/TestJulianMonthOfYearField.java
index 275fa088..f2830a6b 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestJulianMonthOfYearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestJulianMonthOfYearField.java
@@ -24,10 +24,12 @@ class TestJulianMonthOfYearField extends TestGJMonthOfYearField {
super(chrono);
}
+ @Override
public int get(long millis) {
return iChronology.gjFromMillis(millis)[1];
}
+ @Override
public long add(long millis, long value) {
int year = iChronology.year().get(millis);
int newYear = year + (int)TestGJChronology.div(value, 12);
diff --git a/src/test/java/org/joda/time/chrono/gj/TestJulianWeekyearField.java b/src/test/java/org/joda/time/chrono/gj/TestJulianWeekyearField.java
index 487cb320..003b2d43 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestJulianWeekyearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestJulianWeekyearField.java
@@ -26,6 +26,7 @@ class TestJulianWeekyearField extends TestGJWeekyearField {
super(chrono);
}
+ @Override
public long addWrapField(long millis, int value) {
int weekyear = get(millis);
int wrapped = FieldUtils.getWrappedValue
@@ -33,6 +34,7 @@ class TestJulianWeekyearField extends TestGJWeekyearField {
return add(millis, (long) wrapped - weekyear);
}
+ @Override
public long add(long millis, long value) {
int weekyear = get(millis);
int newWeekyear = weekyear + FieldUtils.safeToInt(value);
@@ -48,10 +50,12 @@ class TestJulianWeekyearField extends TestGJWeekyearField {
return set(millis, newWeekyear);
}
+ @Override
public int getMinimumValue() {
return -100000000;
}
+ @Override
public int getMaximumValue() {
return 100000000;
}
diff --git a/src/test/java/org/joda/time/chrono/gj/TestJulianYearField.java b/src/test/java/org/joda/time/chrono/gj/TestJulianYearField.java
index e1d658f5..2079f33d 100644
--- a/src/test/java/org/joda/time/chrono/gj/TestJulianYearField.java
+++ b/src/test/java/org/joda/time/chrono/gj/TestJulianYearField.java
@@ -26,6 +26,7 @@ class TestJulianYearField extends TestGJYearField {
super(chrono);
}
+ @Override
public long addWrapField(long millis, int value) {
int year = get(millis);
int wrapped = FieldUtils.getWrappedValue
@@ -33,6 +34,7 @@ class TestJulianYearField extends TestGJYearField {
return add(millis, (long) wrapped - year);
}
+ @Override
public long add(long millis, long value) {
int year = get(millis);
int newYear = year + FieldUtils.safeToInt(value);
@@ -48,10 +50,12 @@ class TestJulianYearField extends TestGJYearField {
return set(millis, newYear);
}
+ @Override
public int getMinimumValue() {
return -100000000;
}
+ @Override
public int getMaximumValue() {
return 100000000;
}
diff --git a/src/test/java/org/joda/time/convert/MockBadChronology.java b/src/test/java/org/joda/time/convert/MockBadChronology.java
index dcff2a9b..f2be871b 100644
--- a/src/test/java/org/joda/time/convert/MockBadChronology.java
+++ b/src/test/java/org/joda/time/convert/MockBadChronology.java
@@ -30,16 +30,20 @@ class MockBadChronology extends BaseChronology {
super();
}
+ @Override
public Chronology withZone(DateTimeZone zone) {
return null;
}
+ @Override
public DateTimeZone getZone() {
return null;
}
+ @Override
public Chronology withUTC() {
return null;
}
+ @Override
public String toString() {
return null;
}
diff --git a/src/test/java/org/joda/time/convert/MockUnknownCalendar.java b/src/test/java/org/joda/time/convert/MockUnknownCalendar.java
index c3f96620..439f86e3 100644
--- a/src/test/java/org/joda/time/convert/MockUnknownCalendar.java
+++ b/src/test/java/org/joda/time/convert/MockUnknownCalendar.java
@@ -35,30 +35,40 @@ class MockUnknownCalendar extends Calendar {
this.zone = zone;
}
+ @Override
public long getTimeInMillis() {
return millis;
}
+ @Override
public TimeZone getTimeZone() {
return zone;
}
+ @Override
protected void computeTime() {
}
+ @Override
protected void computeFields() {
}
+ @Override
public void add(int field, int amount) {
}
+ @Override
public void roll(int field, boolean up) {
}
+ @Override
public int getMinimum(int field) {
return 0;
}
+ @Override
public int getMaximum(int field) {
return 0;
}
+ @Override
public int getGreatestMinimum(int field) {
return 0;
}
+ @Override
public int getLeastMaximum(int field) {
return 0;
}
diff --git a/src/test/java/org/joda/time/convert/MockUnknownTimeZone.java b/src/test/java/org/joda/time/convert/MockUnknownTimeZone.java
index 73a0bd91..081dd072 100644
--- a/src/test/java/org/joda/time/convert/MockUnknownTimeZone.java
+++ b/src/test/java/org/joda/time/convert/MockUnknownTimeZone.java
@@ -30,24 +30,31 @@ class MockUnknownTimeZone extends TimeZone {
super();
}
+ @Override
public String getID() {
return "!!!";
}
+ @Override
public String getDisplayName(boolean daylight, int style, Locale locale) {
return "!!!";
}
+ @Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {
return 0;
}
+ @Override
public void setRawOffset(int offsetMillis) {
}
+ @Override
public int getRawOffset() {
return 0;
}
+ @Override
public boolean useDaylightTime() {
return false;
}
+ @Override
public boolean inDaylightTime(Date date) {
return false;
}
diff --git a/src/test/java/org/joda/time/convert/TestCalendarConverter.java b/src/test/java/org/joda/time/convert/TestCalendarConverter.java
index 3f76db13..3d01f851 100644
--- a/src/test/java/org/joda/time/convert/TestCalendarConverter.java
+++ b/src/test/java/org/joda/time/convert/TestCalendarConverter.java
@@ -60,6 +60,7 @@ public class TestCalendarConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
diff --git a/src/test/java/org/joda/time/convert/TestConverterManager.java b/src/test/java/org/joda/time/convert/TestConverterManager.java
index d72ae807..06926f64 100644
--- a/src/test/java/org/joda/time/convert/TestConverterManager.java
+++ b/src/test/java/org/joda/time/convert/TestConverterManager.java
@@ -76,13 +76,16 @@ public class TestConverterManager extends TestCase {
static {
// don't call Policy.getPolicy()
RESTRICT = new Policy() {
+ @Override
public PermissionCollection getPermissions(CodeSource codesource) {
Permissions p = new Permissions();
p.add(new AllPermission()); // enable everything
return p;
}
+ @Override
public void refresh() {
}
+ @Override
public boolean implies(ProtectionDomain domain, Permission permission) {
if (permission instanceof JodaTimePermission) {
return false;
@@ -92,11 +95,13 @@ public class TestConverterManager extends TestCase {
}
};
ALLOW = new Policy() {
+ @Override
public PermissionCollection getPermissions(CodeSource codesource) {
Permissions p = new Permissions();
p.add(new AllPermission()); // enable everything
return p;
}
+ @Override
public void refresh() {
}
};
diff --git a/src/test/java/org/joda/time/convert/TestDateConverter.java b/src/test/java/org/joda/time/convert/TestDateConverter.java
index ba4d1b5e..a928abd6 100644
--- a/src/test/java/org/joda/time/convert/TestDateConverter.java
+++ b/src/test/java/org/joda/time/convert/TestDateConverter.java
@@ -56,6 +56,7 @@ public class TestDateConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
COPTIC = CopticChronology.getInstance();
diff --git a/src/test/java/org/joda/time/convert/TestLongConverter.java b/src/test/java/org/joda/time/convert/TestLongConverter.java
index e7cbe49c..f2c67e7c 100644
--- a/src/test/java/org/joda/time/convert/TestLongConverter.java
+++ b/src/test/java/org/joda/time/convert/TestLongConverter.java
@@ -56,6 +56,7 @@ public class TestLongConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
diff --git a/src/test/java/org/joda/time/convert/TestNullConverter.java b/src/test/java/org/joda/time/convert/TestNullConverter.java
index 2319fe0f..2881930d 100644
--- a/src/test/java/org/joda/time/convert/TestNullConverter.java
+++ b/src/test/java/org/joda/time/convert/TestNullConverter.java
@@ -75,6 +75,7 @@ public class TestNullConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -88,6 +89,7 @@ public class TestNullConverter extends TestCase {
JULIAN = JulianChronology.getInstance();
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/convert/TestReadableInstantConverter.java b/src/test/java/org/joda/time/convert/TestReadableInstantConverter.java
index 8b73241c..097960a7 100644
--- a/src/test/java/org/joda/time/convert/TestReadableInstantConverter.java
+++ b/src/test/java/org/joda/time/convert/TestReadableInstantConverter.java
@@ -60,6 +60,7 @@ public class TestReadableInstantConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
@@ -107,6 +108,7 @@ public class TestReadableInstantConverter extends TestCase {
assertEquals(ISO_PARIS, ReadableInstantConverter.INSTANCE.getChronology(new DateTime(123L, new MockBadChronology()), PARIS));
MutableDateTime mdt = new MutableDateTime() {
+ @Override
public Chronology getChronology() {
return null; // bad
}
@@ -119,6 +121,7 @@ public class TestReadableInstantConverter extends TestCase {
assertEquals(ISO, ReadableInstantConverter.INSTANCE.getChronology(new DateTime(123L), (Chronology) null));
MutableDateTime mdt = new MutableDateTime() {
+ @Override
public Chronology getChronology() {
return null; // bad
}
diff --git a/src/test/java/org/joda/time/convert/TestReadableIntervalConverter.java b/src/test/java/org/joda/time/convert/TestReadableIntervalConverter.java
index 709d6a90..4b7b40e3 100644
--- a/src/test/java/org/joda/time/convert/TestReadableIntervalConverter.java
+++ b/src/test/java/org/joda/time/convert/TestReadableIntervalConverter.java
@@ -62,6 +62,7 @@ public class TestReadableIntervalConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
@@ -156,6 +157,7 @@ public class TestReadableIntervalConverter extends TestCase {
public void testSetIntoInterval_Object3() throws Exception {
MutableInterval i = new MutableInterval(0L, 123L) {
+ @Override
public Chronology getChronology() {
return null; // bad
}
@@ -169,6 +171,7 @@ public class TestReadableIntervalConverter extends TestCase {
public void testSetIntoInterval_Object4() throws Exception {
MutableInterval i = new MutableInterval(0L, 123L) {
+ @Override
public Chronology getChronology() {
return null; // bad
}
diff --git a/src/test/java/org/joda/time/convert/TestReadablePartialConverter.java b/src/test/java/org/joda/time/convert/TestReadablePartialConverter.java
index 285099b1..3650be2d 100644
--- a/src/test/java/org/joda/time/convert/TestReadablePartialConverter.java
+++ b/src/test/java/org/joda/time/convert/TestReadablePartialConverter.java
@@ -62,6 +62,7 @@ public class TestReadablePartialConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
@@ -121,6 +122,7 @@ public class TestReadablePartialConverter extends TestCase {
}
static class MockTOD extends BasePartial {
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case 0:
diff --git a/src/test/java/org/joda/time/convert/TestReadablePeriodConverter.java b/src/test/java/org/joda/time/convert/TestReadablePeriodConverter.java
index 8ec08185..2c4ef632 100644
--- a/src/test/java/org/joda/time/convert/TestReadablePeriodConverter.java
+++ b/src/test/java/org/joda/time/convert/TestReadablePeriodConverter.java
@@ -58,6 +58,7 @@ public class TestReadablePeriodConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
diff --git a/src/test/java/org/joda/time/convert/TestStringConverter.java b/src/test/java/org/joda/time/convert/TestStringConverter.java
index 826c1137..3f569769 100644
--- a/src/test/java/org/joda/time/convert/TestStringConverter.java
+++ b/src/test/java/org/joda/time/convert/TestStringConverter.java
@@ -70,6 +70,7 @@ public class TestStringConverter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
zone = DateTimeZone.getDefault();
locale = Locale.getDefault();
@@ -80,6 +81,7 @@ public class TestStringConverter extends TestCase {
ISO = ISOChronology.getInstance();
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(zone);
Locale.setDefault(locale);
diff --git a/src/test/java/org/joda/time/field/TestBaseDateTimeField.java b/src/test/java/org/joda/time/field/TestBaseDateTimeField.java
index 26965a93..b7f1d093 100644
--- a/src/test/java/org/joda/time/field/TestBaseDateTimeField.java
+++ b/src/test/java/org/joda/time/field/TestBaseDateTimeField.java
@@ -49,9 +49,11 @@ public class TestBaseDateTimeField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -423,6 +425,7 @@ public class TestBaseDateTimeField extends TestCase {
assertEquals(2, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockBaseDateTimeField() {
+ @Override
public int getMaximumValue() {
return 5;
}
@@ -430,6 +433,7 @@ public class TestBaseDateTimeField extends TestCase {
assertEquals(1, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockBaseDateTimeField() {
+ @Override
public int getMaximumValue() {
return 555;
}
@@ -437,6 +441,7 @@ public class TestBaseDateTimeField extends TestCase {
assertEquals(3, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockBaseDateTimeField() {
+ @Override
public int getMaximumValue() {
return 5555;
}
@@ -444,6 +449,7 @@ public class TestBaseDateTimeField extends TestCase {
assertEquals(4, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockBaseDateTimeField() {
+ @Override
public int getMaximumValue() {
return -1;
}
@@ -522,27 +528,35 @@ public class TestBaseDateTimeField extends TestCase {
protected MockBaseDateTimeField(DateTimeFieldType type) {
super(type);
}
+ @Override
public int get(long instant) {
return (int) (instant / 60L);
}
+ @Override
public long set(long instant, int value) {
return 1000 + value;
}
+ @Override
public DurationField getDurationField() {
return new MockCountingDurationField(DurationFieldType.seconds());
}
+ @Override
public DurationField getRangeDurationField() {
return new MockCountingDurationField(DurationFieldType.minutes());
}
+ @Override
public int getMinimumValue() {
return 0;
}
+ @Override
public int getMaximumValue() {
return 59;
}
+ @Override
public long roundFloor(long instant) {
return (instant / 60L) * 60L;
}
+ @Override
public boolean isLenient() {
return false;
}
@@ -552,9 +566,11 @@ public class TestBaseDateTimeField extends TestCase {
protected MockStandardBaseDateTimeField() {
super();
}
+ @Override
public DurationField getDurationField() {
return ISOChronology.getInstanceUTC().seconds();
}
+ @Override
public DurationField getRangeDurationField() {
return ISOChronology.getInstanceUTC().minutes();
}
@@ -569,29 +585,37 @@ public class TestBaseDateTimeField extends TestCase {
protected MockCountingDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return false;
}
+ @Override
public long getUnitMillis() {
return 0;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
add_int++;
return instant + (value * 60L);
}
+ @Override
public long add(long instant, long value) {
add_long++;
return instant + (value * 60L);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
difference_long++;
return 30;
@@ -599,6 +623,7 @@ public class TestBaseDateTimeField extends TestCase {
}
static class MockPartial extends BasePartial {
+ @Override
protected DateTimeField getField(int index, Chronology chrono) {
if (index == 0) {
return ISOChronology.getInstanceUTC().minuteOfHour();
diff --git a/src/test/java/org/joda/time/field/TestMillisDurationField.java b/src/test/java/org/joda/time/field/TestMillisDurationField.java
index 293a3d47..874d2461 100644
--- a/src/test/java/org/joda/time/field/TestMillisDurationField.java
+++ b/src/test/java/org/joda/time/field/TestMillisDurationField.java
@@ -46,9 +46,11 @@ public class TestMillisDurationField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/field/TestOffsetDateTimeField.java b/src/test/java/org/joda/time/field/TestOffsetDateTimeField.java
index 339d49f3..14e4703c 100644
--- a/src/test/java/org/joda/time/field/TestOffsetDateTimeField.java
+++ b/src/test/java/org/joda/time/field/TestOffsetDateTimeField.java
@@ -46,9 +46,11 @@ public class TestOffsetDateTimeField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -540,9 +542,11 @@ public class TestOffsetDateTimeField extends TestCase {
protected MockStandardDateTimeField() {
super();
}
+ @Override
public DurationField getDurationField() {
return ISOChronology.getInstanceUTC().seconds();
}
+ @Override
public DurationField getRangeDurationField() {
return ISOChronology.getInstanceUTC().minutes();
}
diff --git a/src/test/java/org/joda/time/field/TestPreciseDateTimeField.java b/src/test/java/org/joda/time/field/TestPreciseDateTimeField.java
index 2dd51703..e3ffa288 100644
--- a/src/test/java/org/joda/time/field/TestPreciseDateTimeField.java
+++ b/src/test/java/org/joda/time/field/TestPreciseDateTimeField.java
@@ -46,9 +46,11 @@ public class TestPreciseDateTimeField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -547,9 +549,11 @@ public class TestPreciseDateTimeField extends TestCase {
protected MockStandardDateTimeField() {
super();
}
+ @Override
public DurationField getDurationField() {
return ISOChronology.getInstanceUTC().seconds();
}
+ @Override
public DurationField getRangeDurationField() {
return ISOChronology.getInstanceUTC().minutes();
}
@@ -566,29 +570,37 @@ public class TestPreciseDateTimeField extends TestCase {
super(type);
this.unit = unit;
}
+ @Override
public boolean isPrecise() {
return true;
}
+ @Override
public long getUnitMillis() {
return unit;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
add_int++;
return instant + (value * 60L);
}
+ @Override
public long add(long instant, long value) {
add_long++;
return instant + (value * 60L);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
difference_long++;
return 30;
@@ -600,27 +612,35 @@ public class TestPreciseDateTimeField extends TestCase {
protected MockZeroDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return true;
}
+ @Override
public long getUnitMillis() {
return 0; // this is zero
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
return 0;
}
+ @Override
public long add(long instant, long value) {
return 0;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return 0;
}
@@ -631,27 +651,35 @@ public class TestPreciseDateTimeField extends TestCase {
protected MockImpreciseDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return false; // this is false
}
+ @Override
public long getUnitMillis() {
return 0;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
return 0;
}
+ @Override
public long add(long instant, long value) {
return 0;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return 0;
}
diff --git a/src/test/java/org/joda/time/field/TestPreciseDurationDateTimeField.java b/src/test/java/org/joda/time/field/TestPreciseDurationDateTimeField.java
index 29e24557..2a6e047a 100644
--- a/src/test/java/org/joda/time/field/TestPreciseDurationDateTimeField.java
+++ b/src/test/java/org/joda/time/field/TestPreciseDurationDateTimeField.java
@@ -46,9 +46,11 @@ public class TestPreciseDurationDateTimeField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
@@ -428,6 +430,7 @@ public class TestPreciseDurationDateTimeField extends TestCase {
assertEquals(2, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockPreciseDurationDateTimeField() {
+ @Override
public int getMaximumValue() {
return 5;
}
@@ -435,6 +438,7 @@ public class TestPreciseDurationDateTimeField extends TestCase {
assertEquals(1, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockPreciseDurationDateTimeField() {
+ @Override
public int getMaximumValue() {
return 555;
}
@@ -442,6 +446,7 @@ public class TestPreciseDurationDateTimeField extends TestCase {
assertEquals(3, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockPreciseDurationDateTimeField() {
+ @Override
public int getMaximumValue() {
return 5555;
}
@@ -449,6 +454,7 @@ public class TestPreciseDurationDateTimeField extends TestCase {
assertEquals(4, field.getMaximumTextLength(Locale.ENGLISH));
field = new MockPreciseDurationDateTimeField() {
+ @Override
public int getMaximumValue() {
return -1;
}
@@ -538,12 +544,15 @@ public class TestPreciseDurationDateTimeField extends TestCase {
protected MockPreciseDurationDateTimeField(DateTimeFieldType type, DurationField dur) {
super(type, dur);
}
+ @Override
public int get(long instant) {
return (int) (instant / 60L);
}
+ @Override
public DurationField getRangeDurationField() {
return new MockCountingDurationField(DurationFieldType.minutes());
}
+ @Override
public int getMaximumValue() {
return 59;
}
@@ -553,9 +562,11 @@ public class TestPreciseDurationDateTimeField extends TestCase {
protected MockStandardBaseDateTimeField() {
super();
}
+ @Override
public DurationField getDurationField() {
return ISOChronology.getInstanceUTC().seconds();
}
+ @Override
public DurationField getRangeDurationField() {
return ISOChronology.getInstanceUTC().minutes();
}
@@ -570,29 +581,37 @@ public class TestPreciseDurationDateTimeField extends TestCase {
protected MockCountingDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return true;
}
+ @Override
public long getUnitMillis() {
return 60;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
add_int++;
return instant + (value * 60L);
}
+ @Override
public long add(long instant, long value) {
add_long++;
return instant + (value * 60L);
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
difference_long++;
return 30;
@@ -604,27 +623,35 @@ public class TestPreciseDurationDateTimeField extends TestCase {
protected MockZeroDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return true;
}
+ @Override
public long getUnitMillis() {
return 0; // this is zero
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
return 0;
}
+ @Override
public long add(long instant, long value) {
return 0;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return 0;
}
@@ -635,27 +662,35 @@ public class TestPreciseDurationDateTimeField extends TestCase {
protected MockImpreciseDurationField(DurationFieldType type) {
super(type);
}
+ @Override
public boolean isPrecise() {
return false; // this is false
}
+ @Override
public long getUnitMillis() {
return 0;
}
+ @Override
public long getValueAsLong(long duration, long instant) {
return 0;
}
+ @Override
public long getMillis(int value, long instant) {
return 0;
}
+ @Override
public long getMillis(long value, long instant) {
return 0;
}
+ @Override
public long add(long instant, int value) {
return 0;
}
+ @Override
public long add(long instant, long value) {
return 0;
}
+ @Override
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return 0;
}
diff --git a/src/test/java/org/joda/time/field/TestPreciseDurationField.java b/src/test/java/org/joda/time/field/TestPreciseDurationField.java
index 1154d059..b3c152d2 100644
--- a/src/test/java/org/joda/time/field/TestPreciseDurationField.java
+++ b/src/test/java/org/joda/time/field/TestPreciseDurationField.java
@@ -52,10 +52,12 @@ public class TestPreciseDurationField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
iField = new PreciseDurationField(DurationFieldType.seconds(), 1000);
}
+ @Override
protected void tearDown() throws Exception {
iField = null;
}
diff --git a/src/test/java/org/joda/time/field/TestScaledDurationField.java b/src/test/java/org/joda/time/field/TestScaledDurationField.java
index 4bfd65eb..7fbfc60f 100644
--- a/src/test/java/org/joda/time/field/TestScaledDurationField.java
+++ b/src/test/java/org/joda/time/field/TestScaledDurationField.java
@@ -52,11 +52,13 @@ public class TestScaledDurationField extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DurationField base = MillisDurationField.INSTANCE;
iField = new ScaledDurationField(base, DurationFieldType.minutes(), 90);
}
+ @Override
protected void tearDown() throws Exception {
iField = null;
}
diff --git a/src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java b/src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java
index 12161d33..8b9f46d7 100644
--- a/src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java
+++ b/src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java
@@ -44,6 +44,7 @@ public class TestUnsupportedDateTimeField extends TestCase {
return new TestSuite(TestUnsupportedDateTimeField.class);
}
+ @Override
protected void setUp() throws Exception {
weeks = DurationFieldType.weeks();
months = DurationFieldType.months();
diff --git a/src/test/java/org/joda/time/format/TestDateTimeFormat.java b/src/test/java/org/joda/time/format/TestDateTimeFormat.java
index 8f71b4a2..2a29cc3d 100644
--- a/src/test/java/org/joda/time/format/TestDateTimeFormat.java
+++ b/src/test/java/org/joda/time/format/TestDateTimeFormat.java
@@ -69,6 +69,7 @@ public class TestDateTimeFormat extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -79,6 +80,7 @@ public class TestDateTimeFormat extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestDateTimeFormatStyle.java b/src/test/java/org/joda/time/format/TestDateTimeFormatStyle.java
index 5b143f97..dedb030b 100644
--- a/src/test/java/org/joda/time/format/TestDateTimeFormatStyle.java
+++ b/src/test/java/org/joda/time/format/TestDateTimeFormatStyle.java
@@ -68,6 +68,7 @@ public class TestDateTimeFormatStyle extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -78,6 +79,7 @@ public class TestDateTimeFormatStyle extends TestCase {
Locale.setDefault(UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestDateTimeFormatter.java b/src/test/java/org/joda/time/format/TestDateTimeFormatter.java
index bb42309b..41000447 100644
--- a/src/test/java/org/joda/time/format/TestDateTimeFormatter.java
+++ b/src/test/java/org/joda/time/format/TestDateTimeFormatter.java
@@ -80,6 +80,7 @@ public class TestDateTimeFormatter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -96,6 +97,7 @@ public class TestDateTimeFormatter extends TestCase {
g = ISODateTimeFormat.dateTimeNoMillis();
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java b/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java
index d9f6f58a..102760d6 100644
--- a/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java
+++ b/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java
@@ -58,9 +58,11 @@ public class TestDateTimeFormatterBuilder extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/format/TestISODateTimeFormat.java b/src/test/java/org/joda/time/format/TestISODateTimeFormat.java
index 044733b1..5c724ea2 100644
--- a/src/test/java/org/joda/time/format/TestISODateTimeFormat.java
+++ b/src/test/java/org/joda/time/format/TestISODateTimeFormat.java
@@ -64,6 +64,7 @@ public class TestISODateTimeFormat extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -74,6 +75,7 @@ public class TestISODateTimeFormat extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestISODateTimeFormatParsing.java b/src/test/java/org/joda/time/format/TestISODateTimeFormatParsing.java
index 1b7b06b9..c0aef80c 100644
--- a/src/test/java/org/joda/time/format/TestISODateTimeFormatParsing.java
+++ b/src/test/java/org/joda/time/format/TestISODateTimeFormatParsing.java
@@ -47,6 +47,7 @@ public class TestISODateTimeFormatParsing extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
originalTimeZone = TimeZone.getDefault();
@@ -56,6 +57,7 @@ public class TestISODateTimeFormatParsing extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
TimeZone.setDefault(originalTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestISODateTimeFormat_Fields.java b/src/test/java/org/joda/time/format/TestISODateTimeFormat_Fields.java
index 0d3b1708..a18e4155 100644
--- a/src/test/java/org/joda/time/format/TestISODateTimeFormat_Fields.java
+++ b/src/test/java/org/joda/time/format/TestISODateTimeFormat_Fields.java
@@ -46,9 +46,11 @@ public class TestISODateTimeFormat_Fields extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
}
+ @Override
protected void tearDown() throws Exception {
}
diff --git a/src/test/java/org/joda/time/format/TestISOPeriodFormat.java b/src/test/java/org/joda/time/format/TestISOPeriodFormat.java
index bef0d425..ed6e58ca 100644
--- a/src/test/java/org/joda/time/format/TestISOPeriodFormat.java
+++ b/src/test/java/org/joda/time/format/TestISOPeriodFormat.java
@@ -69,6 +69,7 @@ public class TestISOPeriodFormat extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -79,6 +80,7 @@ public class TestISOPeriodFormat extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestISOPeriodFormatParsing.java b/src/test/java/org/joda/time/format/TestISOPeriodFormatParsing.java
index da600443..2c448039 100644
--- a/src/test/java/org/joda/time/format/TestISOPeriodFormatParsing.java
+++ b/src/test/java/org/joda/time/format/TestISOPeriodFormatParsing.java
@@ -68,6 +68,7 @@ public class TestISOPeriodFormatParsing extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -78,6 +79,7 @@ public class TestISOPeriodFormatParsing extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestPeriodFormat.java b/src/test/java/org/joda/time/format/TestPeriodFormat.java
index 5814f4e4..25709acc 100644
--- a/src/test/java/org/joda/time/format/TestPeriodFormat.java
+++ b/src/test/java/org/joda/time/format/TestPeriodFormat.java
@@ -17,11 +17,11 @@ package org.joda.time.format;
import java.util.Locale;
+import org.joda.time.Period;
+
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.joda.time.Period;
-
/**
* This class is a Junit unit test for PeriodFormat.
*
@@ -29,18 +29,37 @@ import org.joda.time.Period;
*/
public class TestPeriodFormat extends TestCase {
+ private static final Locale BG = new Locale("bg");
+ private static final Locale CA = new Locale("ca");
+ private static final Locale ZH = new Locale("zh");
+ private static final Locale CS = new Locale("cs");
+ private static final Locale DA = new Locale("da");
+ private static final Locale DE = new Locale("de");
+ private static final Locale EL = new Locale("el");
private static final Locale EN = new Locale("en");
- private static final Locale FR = new Locale("fr");
- private static final Locale PT = new Locale("pt");
private static final Locale ES = new Locale("es");
- private static final Locale DE = new Locale("de");
- private static final Locale NL = new Locale("nl");
- private static final Locale DA = new Locale("da");
+ private static final Locale EU = new Locale("eu");
+ private static final Locale FI = new Locale("fi");
+ private static final Locale FR = new Locale("fr");
+ private static final Locale GA = new Locale("ga");
+ private static final Locale HI = new Locale("hi");
+ private static final Locale HU = new Locale("hu");
+ private static final Locale IN = new Locale("in");
+ private static final Locale IW = new Locale("iw");
private static final Locale JA = new Locale("ja");
+ private static final Locale MS = new Locale("ms");
+ private static final Locale NL = new Locale("nl");
+ private static final Locale NN = new Locale("nn");
+ private static final Locale NO = new Locale("no");
private static final Locale PL = new Locale("pl");
- private static final Locale BG = new Locale("bg");
- private static final Locale CS = new Locale("cs");
+ private static final Locale PT = new Locale("pt");
+ private static final Locale RO = new Locale("ro");
private static final Locale RU = new Locale("ru");
+ private static final Locale SQ = new Locale("sq");
+ private static final Locale SK = new Locale("sk");
+ private static final Locale SV = new Locale("sv");
+ private static final Locale TR = new Locale("tr");
+ private static final Locale UK = new Locale("uk");
private Locale originalLocale = null;
@@ -56,11 +75,13 @@ public class TestPeriodFormat extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalLocale = Locale.getDefault();
Locale.setDefault(DE);
}
+ @Override
protected void tearDown() throws Exception {
Locale.setDefault(originalLocale);
originalLocale = null;
@@ -129,14 +150,58 @@ public class TestPeriodFormat extends TestCase {
assertEquals("1 Tag, 5 Stunden, 6 Minuten, 7 Sekunden und 8 Millisekunden", PeriodFormat.wordBased().print(p));
}
- //-----------------------------------------------------------------------
- // wordBased(Locale.FRENCH)
- //-----------------------------------------------------------------------
- public void test_wordBased_fr_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6 ,7, 8);
- assertEquals("1 jour, 5 heures, 6 minutes, 7 secondes et 8 millisecondes", PeriodFormat.wordBased(FR).print(p));
+ // -----------------------------------------------------------------------
+ // wordBased - minimal test for locales
+ // -----------------------------------------------------------------------
+ private static Object[][] data_formatStandard() {
+ return new Object[][] {
+ {BG, "2 години, 1 месец, 1 ден, 5 часа, 6 минути, 7 секунди и 8 милисекунди"},
+ {CA, "2 anys, 1 mes, 1 dia, 5 hores, 6 minuts, 7 segons i 8 milisegons"},
+ {ZH, "2年1个月1天5小时6分7秒8毫秒"},
+ {CS, "2 roky, 1 měsíc, 1 den, 5 hodin, 6 minut, 7 sekund a 8 milisekund"},
+ {DA, "2 år, 1 måned, 1 dag, 5 timer, 6 minutter, 7 sekunder og 8 millisekunder"},
+ {DE, "2 Jahre, 1 Monat, 1 Tag, 5 Stunden, 6 Minuten, 7 Sekunden und 8 Millisekunden"},
+ {EN, "2 years, 1 month, 1 day, 5 hours, 6 minutes, 7 seconds and 8 milliseconds"},
+ {EL, "2 χρόνια, 1 μήνας, 1 μέρα, 5 ώρες, 6 λεπτά, 7 δευτερόλεπτα και 8 χιλιοστά του δευτερολέπτου"},
+ {ES, "2 años, 1 mes, 1 día, 5 horas, 6 minutos, 7 segundos y 8 milisegundos"},
+ {EU, "2 urte, 1 hilabete, 1 egun, 5 ordu, 6 minuto, 7 segundo eta 8 milisegundo"},
+ {FR, "2 années, 1 mois, 1 jour, 5 heures, 6 minutes, 7 secondes et 8 millisecondes"},
+ {FI, "2 vuotta, 1 kuukausi, 1 päivä, 5 tuntia, 6 minuuttia, 7 sekuntia ja 8 millisekuntia"},
+ {GA, "2 blianta, 1 mí, 1 lá, 5 uair, 6 miontuairiscí, 7 soicind agus 8 milleasoicind"},
+ {HI, "2 साल, 1 महीना, 1 दिन, 5 घंटे, 6 मिनट, 7 सेकंड और 8 मिलीसेकंड"},
+ {HU, "2 év, 1 hónap, 1 nap, 5 óra, 6 perc, 7 másodperc és 8 miliszekundum"},
+ {IN, "2 tahun, 1 bulan, 1 hari, 5 jam, 6 menit, 7 detik dan8 millidetik"},
+ {IW, "2 שנים, 1 חודש, 1 יום, 5 שעות, 6 דקות, 7 שניות ו-8 אלפיות שנייה"},
+ {JA, "2年1か月1日5時間6分7秒8ミリ秒"},
+ {MS, "2 tahun, 1 bulan, 1 hari, 5 jam, 6 minit, 7 saat dan 8 milisaat"},
+ {NL, "2 jaar, 1 maand, 1 dag, 5 uur, 6 minuten, 7 seconden en 8 milliseconden"},
+ {NN, "2 år, 1 månad, 1 dag, 5 timar, 6 minutt, 7 sekund og 8 millisekund"},
+ {NO, "2 år, 1 måned, 1 dag, 5 timer, 6 minutter, 7 sekunder og 8 millisekunder"},
+ {PL, "2 lata, 1 miesiąc, 1 dzie\u0144, 5 godzin, 6 minut, 7 sekund i 8 milisekund"},
+ {PT, "2 anos, 1 mês, 1 dia, 5 horas, 6 minutos, 7 segundos e 8 milissegundos"},
+ {RO, "2 ani, 1 lună, 1 zi, 5 ore, 6 minute, 7 secunde și 8 milisecunde"},
+ {RU, "2 года, 1 месяц, 1 день, 5 часов, 6 минут, 7 секунд и 8 миллисекунд"},
+ {SK, "2 roky, 1 mesiac, 1 deň, 5 hodín, 6 minút, 7 sekúnd a 8 milisekúnd"},
+ {SQ, "2 vjet, 1 muaj, 1 ditë, 5 orë, 6 minuta, 7 sekonda dhe 8 milisekonda"},
+ {SV, "2 år, 1 månad, 1 dag, 5 timmar, 6 minuter, 7 sekunder och 8 millisekunder"},
+ {TR, "2 yıl, 1 ay, 1 gün, 5 saat, 6 dakika, 7 saniye ve 8 milisaniye"},
+ {UK, "2 року, 1 місяць, 1 день, 5 годин, 6 хвилин, 7 секунд и 8 мілісекунд"},
+ };
+ }
+
+ public void test_wordBased_formatStandard() {
+ Period p = new Period(2, 1, 0, 1, 5, 6, 7, 8);
+ Object[][] data = data_formatStandard();
+ for (int i = 0; i < data.length; i++) {
+ Locale locale = (Locale) data[i][0];
+ String actual = PeriodFormat.wordBased(locale).print(p);
+ String expected = data[i][1].toString();
+ assertEquals(locale.toString(), expected, actual);
+ }
}
+ //-----------------------------------------------------------------------
+ // wordBased(Locale.FRENCH)
//-----------------------------------------------------------------------
public void test_wordBased_fr_FormatOneField() {
Period p = Period.days(2);
@@ -168,12 +233,6 @@ public class TestPeriodFormat extends TestCase {
//-----------------------------------------------------------------------
// wordBased(Locale pt)
- //-----------------------------------------------------------------------
- public void test_wordBased_pt_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6 ,7, 8);
- assertEquals("1 dia, 5 horas, 6 minutos, 7 segundos e 8 milissegundos", PeriodFormat.wordBased(PT).print(p));
- }
-
//-----------------------------------------------------------------------
public void test_wordBased_pt_FormatOneField() {
Period p = Period.days(2);
@@ -205,12 +264,6 @@ public class TestPeriodFormat extends TestCase {
//-----------------------------------------------------------------------
// wordBased(Locale es)
- //-----------------------------------------------------------------------
- public void test_wordBased_es_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6 ,7, 8);
- assertEquals("1 d\u00EDa, 5 horas, 6 minutos, 7 segundos y 8 milisegundos", PeriodFormat.wordBased(ES).print(p));
- }
-
//-----------------------------------------------------------------------
public void test_wordBased_es_FormatOneField() {
Period p = Period.days(2);
@@ -242,12 +295,6 @@ public class TestPeriodFormat extends TestCase {
//-----------------------------------------------------------------------
// wordBased(Locale de)
- //-----------------------------------------------------------------------
- public void test_wordBased_de_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6 ,7, 8);
- assertEquals("1 Tag, 5 Stunden, 6 Minuten, 7 Sekunden und 8 Millisekunden", PeriodFormat.wordBased(DE).print(p));
- }
-
//-----------------------------------------------------------------------
public void test_wordBased_de_FormatOneField() {
Period p = Period.days(2);
@@ -279,12 +326,6 @@ public class TestPeriodFormat extends TestCase {
//-----------------------------------------------------------------------
// wordBased(Locale nl)
- //-----------------------------------------------------------------------
- public void test_wordBased_nl_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6 ,7, 8);
- assertEquals("1 dag, 5 uur, 6 minuten, 7 seconden en 8 milliseconden", PeriodFormat.wordBased(NL).print(p));
- }
-
//-----------------------------------------------------------------------
public void test_wordBased_nl_FormatOneField() {
Period p = Period.days(2);
@@ -377,12 +418,6 @@ public class TestPeriodFormat extends TestCase {
// -----------------------------------------------------------------------
// wordBased(new Locale("pl")
- // -----------------------------------------------------------------------
- public void test_wordBased_pl_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6, 7, 8);
- assertEquals("1 dzie\u0144, 5 godzin, 6 minut, 7 sekund i 8 milisekund", PeriodFormat.wordBased(PL).print(p));
- }
-
// -----------------------------------------------------------------------
public void test_wordBased_pl_FormatOneField() {
Period p = Period.days(2);
@@ -574,30 +609,8 @@ public class TestPeriodFormat extends TestCase {
assertEquals("2225 milisekund", pf.print(Period.millis(2225)));
}
- // -----------------------------------------------------------------------
- // wordBased(new Locale("bg")
- // -----------------------------------------------------------------------
- public void test_wordBased_bg_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6, 7, 8);
- assertEquals("1 ден, 5 часа, 6 минути, 7 секунди и 8 милисекунди", PeriodFormat.wordBased(BG).print(p));
- }
-
- // -----------------------------------------------------------------------
- // wordBased(new Locale("cs")
- // -----------------------------------------------------------------------
- public void test_wordBased_cs_formatStandard() {
- Period p = new Period(0, 0, 0, 1, 5, 6, 7, 8);
- assertEquals("1 den, 5 hodin, 6 minut, 7 sekund a 8 milisekund", PeriodFormat.wordBased(CS).print(p));
- }
-
// -----------------------------------------------------------------------
// wordBased(new Locale("ru")
- // -----------------------------------------------------------------------
- public void test_wordBased_ru_formatStandard() {
- Period p = new Period(1, 2, 3, 4, 5, 6, 7, 8);
- assertEquals("1 год, 2 месяца, 3 недели, 4 дня, 5 часов, 6 минут, 7 секунд и 8 миллисекунд", PeriodFormat.wordBased(RU).print(p));
- }
-
// -----------------------------------------------------------------------
public void test_wordBased_ru_FormatOneField() {
Period p = Period.days(2);
diff --git a/src/test/java/org/joda/time/format/TestPeriodFormatParsing.java b/src/test/java/org/joda/time/format/TestPeriodFormatParsing.java
index 38c02239..c7de4063 100644
--- a/src/test/java/org/joda/time/format/TestPeriodFormatParsing.java
+++ b/src/test/java/org/joda/time/format/TestPeriodFormatParsing.java
@@ -68,6 +68,7 @@ public class TestPeriodFormatParsing extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -78,6 +79,7 @@ public class TestPeriodFormatParsing extends TestCase {
Locale.setDefault(Locale.UK);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestPeriodFormatter.java b/src/test/java/org/joda/time/format/TestPeriodFormatter.java
index 9717ed8e..65ab456c 100644
--- a/src/test/java/org/joda/time/format/TestPeriodFormatter.java
+++ b/src/test/java/org/joda/time/format/TestPeriodFormatter.java
@@ -73,6 +73,7 @@ public class TestPeriodFormatter extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
originalDateTimeZone = DateTimeZone.getDefault();
@@ -84,6 +85,7 @@ public class TestPeriodFormatter extends TestCase {
f = ISOPeriodFormat.standard();
}
+ @Override
protected void tearDown() throws Exception {
DateTimeUtils.setCurrentMillisSystem();
DateTimeZone.setDefault(originalDateTimeZone);
diff --git a/src/test/java/org/joda/time/format/TestTextFields.java b/src/test/java/org/joda/time/format/TestTextFields.java
index 310890aa..5e58461b 100644
--- a/src/test/java/org/joda/time/format/TestTextFields.java
+++ b/src/test/java/org/joda/time/format/TestTextFields.java
@@ -71,6 +71,7 @@ public class TestTextFields extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
originalLocale = Locale.getDefault();
@@ -78,6 +79,7 @@ public class TestTextFields extends TestCase {
Locale.setDefault(Locale.ENGLISH);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
Locale.setDefault(originalLocale);
diff --git a/src/test/java/org/joda/time/tz/TestBuilder.java b/src/test/java/org/joda/time/tz/TestBuilder.java
index e5b9270d..5e6b01c8 100644
--- a/src/test/java/org/joda/time/tz/TestBuilder.java
+++ b/src/test/java/org/joda/time/tz/TestBuilder.java
@@ -197,11 +197,13 @@ public class TestBuilder extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
}
diff --git a/src/test/java/org/joda/time/tz/TestCachedDateTimeZone.java b/src/test/java/org/joda/time/tz/TestCachedDateTimeZone.java
index 56b73c75..eb763900 100644
--- a/src/test/java/org/joda/time/tz/TestCachedDateTimeZone.java
+++ b/src/test/java/org/joda/time/tz/TestCachedDateTimeZone.java
@@ -46,11 +46,13 @@ public class TestCachedDateTimeZone extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
}
diff --git a/src/test/java/org/joda/time/tz/TestCompiler.java b/src/test/java/org/joda/time/tz/TestCompiler.java
index 51ee2b9c..9199eb3e 100644
--- a/src/test/java/org/joda/time/tz/TestCompiler.java
+++ b/src/test/java/org/joda/time/tz/TestCompiler.java
@@ -91,11 +91,13 @@ public class TestCompiler extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
}
diff --git a/src/test/java/org/joda/time/tz/TestFixedDateTimeZone.java b/src/test/java/org/joda/time/tz/TestFixedDateTimeZone.java
index da2c414e..6f6b03ae 100644
--- a/src/test/java/org/joda/time/tz/TestFixedDateTimeZone.java
+++ b/src/test/java/org/joda/time/tz/TestFixedDateTimeZone.java
@@ -44,11 +44,13 @@ public class TestFixedDateTimeZone extends TestCase {
super(name);
}
+ @Override
protected void setUp() throws Exception {
originalDateTimeZone = DateTimeZone.getDefault();
DateTimeZone.setDefault(DateTimeZone.UTC);
}
+ @Override
protected void tearDown() throws Exception {
DateTimeZone.setDefault(originalDateTimeZone);
}
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/share/maven-repo/joda-time/joda-time/2.12.5/joda-time-2.12.5.pom lrwxrwxrwx root/root /usr/share/java/joda-time-2.12.5.jar -> joda-time.jar lrwxrwxrwx root/root /usr/share/maven-repo/joda-time/joda-time/2.12.5/joda-time-2.12.5.jar -> ../../../../java/joda-time.jar
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/maven-repo/joda-time/joda-time/2.10.14/joda-time-2.10.14.pom lrwxrwxrwx root/root /usr/share/java/joda-time-2.10.14.jar -> joda-time.jar lrwxrwxrwx root/root /usr/share/maven-repo/joda-time/joda-time/2.10.14/joda-time-2.10.14.jar -> ../../../../java/joda-time.jar
No differences were encountered in the control files