Skip to content

Commit 31daa34

Browse files
author
Stanislav Spiridonov
committed
Merge branch 'master' into GWT29
2 parents 984053a + 567c48b commit 31daa34

29 files changed

+908
-612
lines changed

.github/workflows/BuildSnapshot.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Set up JDK
17-
uses: actions/setup-java@v3
17+
uses: actions/setup-java@v4
1818
with:
1919
java-version: '11'
2020
distribution: 'zulu'
2121
cache: maven
22-
- uses: s4u/maven-settings-action@v2.7.0
22+
- uses: s4u/maven-settings-action@v3.0.0
2323
with:
2424
sonatypeSnapshots: true
2525
apacheSnapshots: true
@@ -45,23 +45,23 @@ jobs:
4545
name: Run Sonar analysis
4646
runs-on: ubuntu-latest
4747
steps:
48-
- uses: actions/checkout@v3
48+
- uses: actions/checkout@v4
4949
with:
5050
# Shallow clones should be disabled for a better relevancy of analysis
5151
fetch-depth: 0
5252
- name: Set up JDK
53-
uses: actions/setup-java@v3
53+
uses: actions/setup-java@v4
5454
with:
55-
java-version: '11'
55+
java-version: '17'
5656
distribution: 'zulu'
5757
cache: maven
5858
- name: Cache SonarCloud packages
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
with:
6161
path: ~/.sonar/cache
6262
key: ${{ runner.os }}-sonar
6363
restore-keys: ${{ runner.os }}-sonar
64-
- uses: s4u/maven-settings-action@v2.7.0
64+
- uses: s4u/maven-settings-action@v3.0.0
6565
with:
6666
sonatypeSnapshots: true
6767
apacheSnapshots: true

.github/workflows/Release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Set up JDK
14-
uses: actions/setup-java@v3
14+
uses: actions/setup-java@v4
1515
with:
1616
java-version: '11'
1717
distribution: 'zulu'
1818
cache: maven
1919
gpg-private-key: ${{ secrets.GPG_KEY }}
2020
- name: maven-settings-xml-action
21-
uses: whelk-io/maven-settings-xml-action@v21
21+
uses: whelk-io/maven-settings-xml-action@v22
2222
with:
2323
repositories: |
2424
[

.github/workflows/UpdateDependencies.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
updateGWT28:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
ref: 'master'
1515
- name: Set up JDK
16-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@v4
1717
with:
1818
java-version: '11'
1919
distribution: 'zulu'
2020
cache: maven
21-
- uses: s4u/maven-settings-action@v2.7.0
21+
- uses: s4u/maven-settings-action@v3.0.0
2222
with:
2323
sonatypeSnapshots: true
2424
apacheSnapshots: true
@@ -32,7 +32,7 @@ jobs:
3232
run: mvn -B versions:resolve-ranges versions:update-properties -Dincludes=com.jresearchsoft*:*,org.jresearch*:* -DallowSnapshots --builder singlethreaded
3333
working-directory: pom
3434
- name: Create Pull Request
35-
uses: peter-evans/create-pull-request@v4
35+
uses: peter-evans/create-pull-request@v6
3636
with:
3737
branch: gwt28/dep-update
3838
commit-message: Update shapshot dependencies
@@ -41,16 +41,16 @@ jobs:
4141
updateGWT29:
4242
runs-on: ubuntu-latest
4343
steps:
44-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4545
with:
4646
ref: 'GWT29'
4747
- name: Set up JDK
48-
uses: actions/setup-java@v3
48+
uses: actions/setup-java@v4
4949
with:
5050
java-version: '11'
5151
distribution: 'zulu'
5252
cache: maven
53-
- uses: s4u/maven-settings-action@v2.7.0
53+
- uses: s4u/maven-settings-action@v3.0.0
5454
with:
5555
sonatypeSnapshots: true
5656
apacheSnapshots: true
@@ -64,7 +64,7 @@ jobs:
6464
run: mvn -B versions:resolve-ranges versions:update-properties -Dincludes=com.jresearchsoft*:*,org.jresearch*:* -DallowSnapshots --builder singlethreaded
6565
working-directory: pom
6666
- name: Create Pull Request
67-
uses: peter-evans/create-pull-request@v4
67+
uses: peter-evans/create-pull-request@v6
6868
with:
6969
branch: gwt29/dep-update
7070
commit-message: Update shapshot dependencies

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
**/TempTest.java
2222
/.idea/
2323
/threetenbp.iml
24+
time/gwt-unitCache/*
25+
time/war/*
26+
time/www-test/*

pom/pom.xml

+12-12
Original file line numberDiff line numberDiff line change
@@ -352,26 +352,26 @@
352352
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
353353
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
354354
<maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
355-
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
355+
<maven-dependency-plugin.version>3.4.0</maven-dependency-plugin.version>
356356
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
357357
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
358-
<maven-install-plugin.version>3.0.1</maven-install-plugin.version>
359-
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
360-
<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
361-
<maven-jxr-plugin.version>3.2.0</maven-jxr-plugin.version>
362-
<maven-plugin-plugin.version>3.6.4</maven-plugin-plugin.version>
363-
<maven-pmd-plugin.version>3.17.0</maven-pmd-plugin.version>
358+
<maven-install-plugin.version>3.1.0</maven-install-plugin.version>
359+
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
360+
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
361+
<maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
362+
<maven-plugin-plugin.version>3.7.0</maven-plugin-plugin.version>
363+
<maven-pmd-plugin.version>3.19.0</maven-pmd-plugin.version>
364364
<maven-project-info-reports-plugin.version>3.4.0</maven-project-info-reports-plugin.version>
365365
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
366366
<maven-repository-plugin.version>2.4</maven-repository-plugin.version>
367367
<maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
368-
<maven-site-plugin.version>3.12.0</maven-site-plugin.version>
368+
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
369369
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
370370
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
371371
<maven-surefire-report-plugin.version>3.0.0-M7</maven-surefire-report-plugin.version>
372372
<maven-toolchains-plugin.version>3.1.0</maven-toolchains-plugin.version> -->
373373
<!-- Other plugins -->
374-
<!-- <github-api.version>1.307</github-api.version>
374+
<!-- <github-api.version>1.314</github-api.version>
375375
<github-release-plugin.version>1.4.0</github-release-plugin.version>
376376
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
377377
<reflow-velocity-tools.version>1.2</reflow-velocity-tools.version> -->
@@ -388,20 +388,20 @@
388388
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
389389
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
390390
<linkXRef>false</linkXRef>
391-
<tz.database.version>2023dgtz</tz.database.version>
391+
<tz.database.version>2024agtz</tz.database.version>
392392
-->
393393
<gwt29-regexp.ver>1.0.0-RC1</gwt29-regexp.ver>
394394
<gwt29-typedarrays.ver>1.0.0-RC2</gwt29-typedarrays.ver>
395395
<gwt29-nio.ver>1.1</gwt29-nio.ver>
396396
<gwt-slf4j.ver>1.0.2-gwt2.8.2</gwt-slf4j.ver>
397-
<time.apt.ver>2.0.14</time.apt.ver>
397+
<time.apt.ver>2.0.15</time.apt.ver>
398398
<gwt.version>2.9.0</gwt.version>
399399
<elemental.ver>1.1.0</elemental.ver>
400400
<jsinterop-annotations.ver>2.0.0</jsinterop-annotations.ver>
401401
<jsinterop-base.ver>1.0.0</jsinterop-base.ver>
402402
<gwt29-core.ver>1.0.0-RC1</gwt29-core.ver>
403403
<gwt-locale.ver>1.0.5</gwt-locale.ver>
404-
<gwt-locale-cldr.ver>1.0.6</gwt-locale-cldr.ver>
404+
<gwt-locale-cldr.ver>1.0.7</gwt-locale-cldr.ver>
405405
<gwt-tool-jre-apt.ver>1.0.3</gwt-tool-jre-apt.ver>
406406

407407
<java.version>11</java.version>

time/src/changes/changes.xml

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<body>
99

1010
<!-- types are add, fix, remove, update -->
11+
<release version="1.6.9" date="2024-03-25" description="v1.6.9">
12+
<action dev="jodastephen" type="update" >
13+
Update to time-zone data 2024agtz.
14+
</action>
15+
</release>
1116
<release version="1.6.8" date="2023-03-30" description="v1.6.8">
1217
<action dev="jodastephen" type="update" >
1318
Update to time-zone data 2023cgtz.

time/src/main/java/org/jresearch/threetenbp/gwt/emu/java/time/Clock.java

+23-19
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
*/
3232
package org.jresearch.threetenbp.gwt.emu.java.time;
3333

34-
import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.NANOS_PER_MINUTE;
35-
import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.NANOS_PER_SECOND;
34+
import static org.jresearch.threetenbp.gwt.emu.java.time.LocalTime.*;
3635

3736
import java.io.Serializable;
38-
import org.jresearch.threetenbp.gwt.emu.java.time.Clock;
39-
import org.jresearch.threetenbp.gwt.emu.java.time.DateTimeException;
40-
import org.jresearch.threetenbp.gwt.emu.java.time.Duration;
41-
import org.jresearch.threetenbp.gwt.emu.java.time.Instant;
42-
import org.jresearch.threetenbp.gwt.emu.java.time.ZoneId;
43-
import org.jresearch.threetenbp.gwt.emu.java.time.ZoneOffset;
4437
import java.util.Objects;
4538
import java.util.TimeZone;
4639

@@ -116,7 +109,7 @@ public abstract class Clock {
116109
* @return a clock that uses the best available system clock in the UTC zone, not null
117110
*/
118111
public static Clock systemUTC() {
119-
return new SystemClock(ZoneOffset.UTC);
112+
return SystemClock.CLOCK_UTC;
120113
}
121114

122115
/**
@@ -159,9 +152,19 @@ public static Clock systemDefaultZone() {
159152
*/
160153
public static Clock system(ZoneId zone) {
161154
Objects.requireNonNull(zone, "zone");
155+
if (zone == ZoneOffset.UTC) {
156+
return SystemClock.CLOCK_UTC;
157+
}
162158
return new SystemClock(zone);
163159
}
164160

161+
//-------------------------------------------------------------------------
162+
/**
163+
* @since 9
164+
*/
165+
public static Clock tickMillis(ZoneId zone) {
166+
return new TickClock(system(zone), NANOS_PER_MILLI);
167+
}
165168
//-------------------------------------------------------------------------
166169
/**
167170
* Obtains a clock that returns the current instant ticking in whole seconds
@@ -403,6 +406,7 @@ public int hashCode() {
403406
*/
404407
static final class SystemClock extends Clock implements Serializable {
405408
private static final long serialVersionUID = 6740630888130243051L;
409+
static final SystemClock CLOCK_UTC = new SystemClock(ZoneOffset.UTC);
406410
private final ZoneId zone;
407411

408412
SystemClock(ZoneId zone) {
@@ -414,8 +418,8 @@ public ZoneId getZone() {
414418
}
415419
@Override
416420
public Clock withZone(ZoneId zone) {
417-
//GWT specific
418-
Objects.requireNonNull(zone);
421+
//GWT specific
422+
Objects.requireNonNull(zone);
419423
if (zone.equals(this.zone)) { // intentional NPE
420424
return this;
421425
}
@@ -452,7 +456,7 @@ public String toString() {
452456
* This is typically used for testing.
453457
*/
454458
static final class FixedClock extends Clock implements Serializable {
455-
private static final long serialVersionUID = 7430389292664866958L;
459+
private static final long serialVersionUID = 7430389292664866958L;
456460
private final Instant instant;
457461
private final ZoneId zone;
458462

@@ -466,8 +470,8 @@ public ZoneId getZone() {
466470
}
467471
@Override
468472
public Clock withZone(ZoneId zone) {
469-
//GWT specific
470-
Objects.requireNonNull(zone);
473+
//GWT specific
474+
Objects.requireNonNull(zone);
471475
if (zone.equals(this.zone)) { // intentional NPE
472476
return this;
473477
}
@@ -504,7 +508,7 @@ public String toString() {
504508
* Implementation of a clock that adds an offset to an underlying clock.
505509
*/
506510
static final class OffsetClock extends Clock implements Serializable {
507-
private static final long serialVersionUID = 2007484719125426256L;
511+
private static final long serialVersionUID = 2007484719125426256L;
508512
private final Clock baseClock;
509513
private final Duration offset;
510514

@@ -518,8 +522,8 @@ public ZoneId getZone() {
518522
}
519523
@Override
520524
public Clock withZone(ZoneId zone) {
521-
//GWT specific
522-
Objects.requireNonNull(zone);
525+
//GWT specific
526+
Objects.requireNonNull(zone);
523527
if (zone.equals(baseClock.getZone())) { // intentional NPE
524528
return this;
525529
}
@@ -570,8 +574,8 @@ public ZoneId getZone() {
570574
}
571575
@Override
572576
public Clock withZone(ZoneId zone) {
573-
//GWT specific
574-
Objects.requireNonNull(zone);
577+
//GWT specific
578+
Objects.requireNonNull(zone);
575579
if (zone.equals(baseClock.getZone())) { // intentional NPE
576580
return this;
577581
}

time/src/main/java/org/jresearch/threetenbp/gwt/emu/java/time/DayOfWeek.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public boolean isSupported(TemporalField field) {
237237
* <p>
238238
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
239239
* range of the day-of-week, from 1 to 7, will be returned.
240-
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
240+
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
241241
* <p>
242242
* If the field is not a {@code ChronoField}, then the result of this method
243243
* is obtained by invoking {@code TemporalField.rangeRefinedBy(TemporalAccessor)}
@@ -247,6 +247,7 @@ public boolean isSupported(TemporalField field) {
247247
* @param field the field to query the range for, not null
248248
* @return the range of valid values for the field, not null
249249
* @throws DateTimeException if the range for the field cannot be obtained
250+
* @throws UnsupportedTemporalTypeException if the type of field is not supported (since 9)
250251
*/
251252
@Override
252253
public ValueRange range(TemporalField field) {
@@ -266,7 +267,7 @@ public ValueRange range(TemporalField field) {
266267
* <p>
267268
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
268269
* value of the day-of-week, from 1 to 7, will be returned.
269-
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
270+
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
270271
* <p>
271272
* If the field is not a {@code ChronoField}, then the result of this method
272273
* is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}
@@ -276,8 +277,9 @@ public ValueRange range(TemporalField field) {
276277
* @param field the field to get, not null
277278
* @return the value for the field, within the valid range of values
278279
* @throws DateTimeException if a value for the field cannot be obtained
279-
* @throws DateTimeException if the range of valid values for the field exceeds an {@code int}
280280
* @throws DateTimeException if the value is outside the range of valid values for the field
281+
* @throws UnsupportedTemporalTypeException if the type of field is not supported or
282+
* the range of values exceeds an {@code int} (since 9)
281283
* @throws ArithmeticException if numeric overflow occurs
282284
*/
283285
@Override
@@ -297,7 +299,7 @@ public int get(TemporalField field) {
297299
* <p>
298300
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then the
299301
* value of the day-of-week, from 1 to 7, will be returned.
300-
* All other {@code ChronoField} instances will throw a {@code DateTimeException}.
302+
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
301303
* <p>
302304
* If the field is not a {@code ChronoField}, then the result of this method
303305
* is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}
@@ -307,6 +309,7 @@ public int get(TemporalField field) {
307309
* @param field the field to get, not null
308310
* @return the value for the field
309311
* @throws DateTimeException if a value for the field cannot be obtained
312+
* @throws UnsupportedTemporalTypeException if the type of field is not supported (since 9)
310313
* @throws ArithmeticException if numeric overflow occurs
311314
*/
312315
@Override

0 commit comments

Comments
 (0)