Skip to content

Commit

Permalink
Merge branch 'master' into GWT29
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Spiridonov committed May 18, 2024
2 parents 984053a + 567c48b commit 31daa34
Show file tree
Hide file tree
Showing 29 changed files with 908 additions and 612 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/BuildSnapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
cache: maven
- uses: s4u/maven-settings-action@v2.7.0
- uses: s4u/maven-settings-action@v3.0.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
Expand All @@ -45,23 +45,23 @@ jobs:
name: Run Sonar analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
cache: maven
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: s4u/maven-settings-action@v2.7.0
- uses: s4u/maven-settings-action@v3.0.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
cache: maven
gpg-private-key: ${{ secrets.GPG_KEY }}
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: |
[
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/UpdateDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
updateGWT28:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: 'master'
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
cache: maven
- uses: s4u/maven-settings-action@v2.7.0
- uses: s4u/maven-settings-action@v3.0.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
Expand All @@ -32,7 +32,7 @@ jobs:
run: mvn -B versions:resolve-ranges versions:update-properties -Dincludes=com.jresearchsoft*:*,org.jresearch*:* -DallowSnapshots --builder singlethreaded
working-directory: pom
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
branch: gwt28/dep-update
commit-message: Update shapshot dependencies
Expand All @@ -41,16 +41,16 @@ jobs:
updateGWT29:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: 'GWT29'
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
cache: maven
- uses: s4u/maven-settings-action@v2.7.0
- uses: s4u/maven-settings-action@v3.0.0
with:
sonatypeSnapshots: true
apacheSnapshots: true
Expand All @@ -64,7 +64,7 @@ jobs:
run: mvn -B versions:resolve-ranges versions:update-properties -Dincludes=com.jresearchsoft*:*,org.jresearch*:* -DallowSnapshots --builder singlethreaded
working-directory: pom
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
branch: gwt29/dep-update
commit-message: Update shapshot dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
**/TempTest.java
/.idea/
/threetenbp.iml
time/gwt-unitCache/*
time/war/*
time/www-test/*
24 changes: 12 additions & 12 deletions pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,26 +352,26 @@
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
<maven-dependency-plugin.version>3.4.0</maven-dependency-plugin.version>
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<maven-install-plugin.version>3.0.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
<maven-jxr-plugin.version>3.2.0</maven-jxr-plugin.version>
<maven-plugin-plugin.version>3.6.4</maven-plugin-plugin.version>
<maven-pmd-plugin.version>3.17.0</maven-pmd-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.4.1</maven-javadoc-plugin.version>
<maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
<maven-plugin-plugin.version>3.7.0</maven-plugin-plugin.version>
<maven-pmd-plugin.version>3.19.0</maven-pmd-plugin.version>
<maven-project-info-reports-plugin.version>3.4.0</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.3.0</maven-resources-plugin.version>
<maven-site-plugin.version>3.12.0</maven-site-plugin.version>
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
<maven-surefire-report-plugin.version>3.0.0-M7</maven-surefire-report-plugin.version>
<maven-toolchains-plugin.version>3.1.0</maven-toolchains-plugin.version> -->
<!-- Other plugins -->
<!-- <github-api.version>1.307</github-api.version>
<!-- <github-api.version>1.314</github-api.version>
<github-release-plugin.version>1.4.0</github-release-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<reflow-velocity-tools.version>1.2</reflow-velocity-tools.version> -->
Expand All @@ -388,20 +388,20 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<linkXRef>false</linkXRef>
<tz.database.version>2023dgtz</tz.database.version>
<tz.database.version>2024agtz</tz.database.version>
-->
<gwt29-regexp.ver>1.0.0-RC1</gwt29-regexp.ver>
<gwt29-typedarrays.ver>1.0.0-RC2</gwt29-typedarrays.ver>
<gwt29-nio.ver>1.1</gwt29-nio.ver>
<gwt-slf4j.ver>1.0.2-gwt2.8.2</gwt-slf4j.ver>
<time.apt.ver>2.0.14</time.apt.ver>
<time.apt.ver>2.0.15</time.apt.ver>
<gwt.version>2.9.0</gwt.version>
<elemental.ver>1.1.0</elemental.ver>
<jsinterop-annotations.ver>2.0.0</jsinterop-annotations.ver>
<jsinterop-base.ver>1.0.0</jsinterop-base.ver>
<gwt29-core.ver>1.0.0-RC1</gwt29-core.ver>
<gwt-locale.ver>1.0.5</gwt-locale.ver>
<gwt-locale-cldr.ver>1.0.6</gwt-locale-cldr.ver>
<gwt-locale-cldr.ver>1.0.7</gwt-locale-cldr.ver>
<gwt-tool-jre-apt.ver>1.0.3</gwt-tool-jre-apt.ver>

<java.version>11</java.version>
Expand Down
5 changes: 5 additions & 0 deletions time/src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<body>

<!-- types are add, fix, remove, update -->
<release version="1.6.9" date="2024-03-25" description="v1.6.9">
<action dev="jodastephen" type="update" >
Update to time-zone data 2024agtz.
</action>
</release>
<release version="1.6.8" date="2023-03-30" description="v1.6.8">
<action dev="jodastephen" type="update" >
Update to time-zone data 2023cgtz.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
*/
package org.jresearch.threetenbp.gwt.emu.java.time;

import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.NANOS_PER_MINUTE;
import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.NANOS_PER_SECOND;
import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.*;

import java.io.Serializable;
import org.jresearch.threetenbp.gwt.emu.java.time.Clock;
import org.jresearch.threetenbp.gwt.emu.java.time.DateTimeException;
import org.jresearch.threetenbp.gwt.emu.java.time.Duration;
import org.jresearch.threetenbp.gwt.emu.java.time.Instant;
import org.jresearch.threetenbp.gwt.emu.java.time.ZoneId;
import org.jresearch.threetenbp.gwt.emu.java.time.ZoneOffset;
import java.util.Objects;
import java.util.TimeZone;

Expand Down Expand Up @@ -116,7 +109,7 @@ public abstract class Clock {
* @return a clock that uses the best available system clock in the UTC zone, not null
*/
public static Clock systemUTC() {
return new SystemClock(ZoneOffset.UTC);
return SystemClock.CLOCK_UTC;
}

/**
Expand Down Expand Up @@ -159,9 +152,19 @@ public static Clock systemDefaultZone() {
*/
public static Clock system(ZoneId zone) {
Objects.requireNonNull(zone, "zone");
if (zone == ZoneOffset.UTC) {
return SystemClock.CLOCK_UTC;
}
return new SystemClock(zone);
}

//-------------------------------------------------------------------------
/**
* @since 9
*/
public static Clock tickMillis(ZoneId zone) {
return new TickClock(system(zone), NANOS_PER_MILLI);
}
//-------------------------------------------------------------------------
/**
* Obtains a clock that returns the current instant ticking in whole seconds
Expand Down Expand Up @@ -403,6 +406,7 @@ public int hashCode() {
*/
static final class SystemClock extends Clock implements Serializable {
private static final long serialVersionUID = 6740630888130243051L;
static final SystemClock CLOCK_UTC = new SystemClock(ZoneOffset.UTC);
private final ZoneId zone;

SystemClock(ZoneId zone) {
Expand All @@ -414,8 +418,8 @@ public ZoneId getZone() {
}
@Override
public Clock withZone(ZoneId zone) {
//GWT specific
Objects.requireNonNull(zone);
//GWT specific
Objects.requireNonNull(zone);
if (zone.equals(this.zone)) { // intentional NPE
return this;
}
Expand Down Expand Up @@ -452,7 +456,7 @@ public String toString() {
* This is typically used for testing.
*/
static final class FixedClock extends Clock implements Serializable {
private static final long serialVersionUID = 7430389292664866958L;
private static final long serialVersionUID = 7430389292664866958L;
private final Instant instant;
private final ZoneId zone;

Expand All @@ -466,8 +470,8 @@ public ZoneId getZone() {
}
@Override
public Clock withZone(ZoneId zone) {
//GWT specific
Objects.requireNonNull(zone);
//GWT specific
Objects.requireNonNull(zone);
if (zone.equals(this.zone)) { // intentional NPE
return this;
}
Expand Down Expand Up @@ -504,7 +508,7 @@ public String toString() {
* Implementation of a clock that adds an offset to an underlying clock.
*/
static final class OffsetClock extends Clock implements Serializable {
private static final long serialVersionUID = 2007484719125426256L;
private static final long serialVersionUID = 2007484719125426256L;
private final Clock baseClock;
private final Duration offset;

Expand All @@ -518,8 +522,8 @@ public ZoneId getZone() {
}
@Override
public Clock withZone(ZoneId zone) {
//GWT specific
Objects.requireNonNull(zone);
//GWT specific
Objects.requireNonNull(zone);
if (zone.equals(baseClock.getZone())) { // intentional NPE
return this;
}
Expand Down Expand Up @@ -570,8 +574,8 @@ public ZoneId getZone() {
}
@Override
public Clock withZone(ZoneId zone) {
//GWT specific
Objects.requireNonNull(zone);
//GWT specific
Objects.requireNonNull(zone);
if (zone.equals(baseClock.getZone())) { // intentional NPE
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public boolean isSupported(TemporalField field) {
* <p>
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
* range of the day-of-week, from 1 to 7, will be returned.
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
* <p>
* If the field is not a {@code ChronoField}, then the result of this method
* is obtained by invoking {@code TemporalField.rangeRefinedBy(TemporalAccessor)}
Expand All @@ -247,6 +247,7 @@ public boolean isSupported(TemporalField field) {
* @param field the field to query the range for, not null
* @return the range of valid values for the field, not null
* @throws DateTimeException if the range for the field cannot be obtained
* @throws UnsupportedTemporalTypeException if the type of field is not supported (since 9)
*/
@Override
public ValueRange range(TemporalField field) {
Expand All @@ -266,7 +267,7 @@ public ValueRange range(TemporalField field) {
* <p>
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
* value of the day-of-week, from 1 to 7, will be returned.
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
* <p>
* If the field is not a {@code ChronoField}, then the result of this method
* is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}
Expand All @@ -276,8 +277,9 @@ public ValueRange range(TemporalField field) {
* @param field the field to get, not null
* @return the value for the field, within the valid range of values
* @throws DateTimeException if a value for the field cannot be obtained
* @throws DateTimeException if the range of valid values for the field exceeds an {@code int}
* @throws DateTimeException if the value is outside the range of valid values for the field
* @throws UnsupportedTemporalTypeException if the type of field is not supported or
* the range of values exceeds an {@code int} (since 9)
* @throws ArithmeticException if numeric overflow occurs
*/
@Override
Expand All @@ -297,7 +299,7 @@ public int get(TemporalField field) {
* <p>
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
* value of the day-of-week, from 1 to 7, will be returned.
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
* <p>
* If the field is not a {@code ChronoField}, then the result of this method
* is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}
Expand All @@ -307,6 +309,7 @@ public int get(TemporalField field) {
* @param field the field to get, not null
* @return the value for the field
* @throws DateTimeException if a value for the field cannot be obtained
* @throws UnsupportedTemporalTypeException if the type of field is not supported (since 9)
* @throws ArithmeticException if numeric overflow occurs
*/
@Override
Expand Down
Loading

0 comments on commit 31daa34

Please sign in to comment.