1
0
mirror of https://github.com/google/nomulus synced 2026-05-13 11:21:46 +00:00

Migrate TMCH, SMD, and Fee models to java.time (#3019)

Continues the project-wide migration from Joda-Time's DateTime to java.time.Instant, focusing on Trademark Clearinghouse (TMCH), Signed Mark Data (SMD), and Fee extension models.

Key updates:
- TMCH & SMD: Updated SmdRevocationList and domain check/create flows to use Instant for sunrise validations and revocation checks.
- Fee Extension Ecosystem: Refactored FeeCheckRequest, FeeCreateCommandExtension, and BaseFee to use Instant for effective dates and period calculations.
- EPP Objects: Updated DomainInfoData, TransferResponse, and PollMessage objects to use Instant for event timestamps.
- Pricing Logic: DomainPricingLogic methods now accept Instant for cost calculations.

Additionally, DateTimeUtils was enhanced with Instant compatibility methods for plusMonths and minusMonths to safely handle leap years.

Redundant conversions between DateTime and Instant were eliminated throughout the flows and tests. DomainFlowUtils leverages Instant natively to avoid inline casting, and test assertions now utilize Truth's Instant subjects for cleaner validation.
This commit is contained in:
Ben McIlwain
2026-04-22 12:44:47 -04:00
committed by GitHub
parent 653704811b
commit 925482ea58
108 changed files with 1561 additions and 1383 deletions

View File

@@ -44,6 +44,7 @@ import io.netty.util.concurrent.Future;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.JdkLoggerFactory;
import jakarta.inject.Provider;
import java.time.Duration;
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.Queue;
@@ -314,7 +315,7 @@ public class ProxyServer implements Runnable {
if (proxyModule.provideEnvironment() != Environment.LOCAL) {
MetricReporter metricReporter = proxyComponent.metricReporter();
try {
metricReporter.startAsync().awaitRunning(java.time.Duration.ofSeconds(10));
metricReporter.startAsync().awaitRunning(Duration.ofSeconds(10));
logger.atInfo().log("Started up MetricReporter.");
} catch (TimeoutException timeoutException) {
logger.atSevere().withCause(timeoutException).log(
@@ -325,7 +326,7 @@ public class ProxyServer implements Runnable {
new Thread(
() -> {
try {
metricReporter.stopAsync().awaitTerminated(java.time.Duration.ofSeconds(10));
metricReporter.stopAsync().awaitTerminated(Duration.ofSeconds(10));
logger.atInfo().log("Shut down MetricReporter.");
} catch (TimeoutException timeoutException) {
logger.atWarning().withCause(timeoutException).log(