mirror of
https://github.com/google/nomulus
synced 2026-08-18 13:16:20 +00:00
Complete Joda-Time to java.time migration (#3039)
This completes the exhaustive refactoring of foundational temporal types from Joda-Time to the native java.time API across the entire codebase. - Replaced org.joda.time.DateTime, Instant, LocalDate, and Duration with java.time equivalents. - Audited and updated Clock implementations (FakeClock, SystemClock). Added nowMillis(), nowDate(), and nowDateTime() to eliminate repetitive conversions and maintain parallel naming. - Replaced ZonedDateTime with OffsetDateTime globally per go/avoid-zdt. OffsetDateTime is a better fit as we use a hardcoded ZoneOffset.UTC throughout the system, making geographical time zone rules (like daylight saving time) irrelevant and preventing serialization ambiguities. Added a presubmit check. - Completely removed all transitional bridge methods from DateTimeUtils and deleted obsolete converters (e.g., DateTimeConverter). - Updated testing infrastructure, Apache Beam pipelines, custom JCommander parameters, and networking modules to solely rely on java.time primitives. - Retained the lone necessary org.joda.time.Instant usage in SafeBrowsingTransforms required by the Apache Beam API. - Cleared Gradle lockfiles and removed the joda-time dependency entirely from the build configuration.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
com.fasterxml.jackson.core:jackson-annotations:2.21=classpath
|
||||
gradle.plugin.org.flywaydb:gradle-plugin-publishing:12.2.0=classpath
|
||||
org.flywaydb.flyway:org.flywaydb.flyway.gradle.plugin:12.2.0=classpath
|
||||
org.flywaydb:flyway-core:12.6.0=classpath
|
||||
org.flywaydb:flyway-database-postgresql:12.6.0=classpath
|
||||
org.flywaydb:flyway-core:12.6.1=classpath
|
||||
org.flywaydb:flyway-database-postgresql:12.6.1=classpath
|
||||
tools.jackson.core:jackson-core:3.1.1=classpath
|
||||
tools.jackson.core:jackson-databind:3.1.1=classpath
|
||||
tools.jackson:jackson-bom:3.1.1=classpath
|
||||
|
||||
+2
-3
@@ -79,7 +79,6 @@ io.opencensus:opencensus-contrib-http-util:0.31.1=deploy_jar,runtimeClasspath,te
|
||||
jakarta.inject:jakarta.inject-api:2.0.1=testCompileClasspath,testRuntimeClasspath
|
||||
javax.annotation:javax.annotation-api:1.3.2=deploy_jar,runtimeClasspath,testRuntimeClasspath
|
||||
javax.inject:javax.inject:1=annotationProcessor,testAnnotationProcessor
|
||||
joda-time:joda-time:2.14.2=testCompileClasspath,testRuntimeClasspath
|
||||
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
|
||||
net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath
|
||||
net.java.dev.jna:jna:5.18.1=compileClasspath,deploy_jar,runtimeClasspath
|
||||
@@ -110,8 +109,8 @@ org.codehaus.plexus:plexus-classworlds:2.6.0=checkstyle
|
||||
org.codehaus.plexus:plexus-component-annotations:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-container-default:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-utils:3.3.0=checkstyle
|
||||
org.flywaydb:flyway-core:12.6.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.flywaydb:flyway-database-postgresql:12.6.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.flywaydb:flyway-core:12.6.1=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.flywaydb:flyway-database-postgresql:12.6.1=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
|
||||
org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt
|
||||
org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt
|
||||
|
||||
@@ -15,4 +15,3 @@
|
||||
CREATE INDEX IDXy98mebut8ix1v07fjxxdkqcx ON "Host" (creation_time);
|
||||
CREATE INDEX IDXovmntef6l45tw2bsfl56tcugx ON "Host" (deletion_time);
|
||||
CREATE INDEX IDXl49vydnq0h5j1piefwjy4i8er ON "Host" (current_sponsor_registrar_id);
|
||||
|
||||
|
||||
-1
@@ -16,4 +16,3 @@ ALTER TABLE "BillingCancellation" DROP COLUMN billing_event_domain_repo_id;
|
||||
ALTER TABLE "BillingCancellation" DROP COLUMN billing_event_history_id;
|
||||
ALTER TABLE "BillingCancellation" DROP COLUMN billing_recurrence_domain_repo_id;
|
||||
ALTER TABLE "BillingCancellation" DROP COLUMN billing_recurrence_history_id;
|
||||
|
||||
|
||||
@@ -25,4 +25,3 @@
|
||||
);
|
||||
|
||||
create index IDXlg6a5tp70nch9cp0gc11brc5o on "PackagePromotion" (token);
|
||||
|
||||
|
||||
@@ -18,4 +18,3 @@ CREATE SEQUENCE public."project_wide_unique_id_seq"
|
||||
MINVALUE 59880480005
|
||||
NO MAXVALUE
|
||||
CACHE 10;
|
||||
|
||||
|
||||
@@ -14,4 +14,3 @@
|
||||
|
||||
alter table "RegistrarPoc" add column login_email_address text;
|
||||
create index registrarpoc_login_email_idx on "RegistrarPoc" (login_email_address);
|
||||
|
||||
|
||||
@@ -13,4 +13,3 @@
|
||||
-- limitations under the License.
|
||||
|
||||
ALTER TABLE "RegistrarPoc" DROP COLUMN gae_user_id;
|
||||
|
||||
|
||||
-3
@@ -15,6 +15,3 @@
|
||||
ALTER TABLE "DnsRefreshRequest" RENAME COLUMN process_time TO last_process_time;
|
||||
CREATE INDEX IDXfdk2xpil2x1gh0omt84k2y3o1 ON "DnsRefreshRequest" (last_process_time);
|
||||
DROP INDEX IDX3i7i2ktts9d7lcjbs34h0pvwo;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,4 +13,3 @@
|
||||
-- limitations under the License.
|
||||
|
||||
ALTER TABLE "Lock" DROP COLUMN request_log_id;
|
||||
|
||||
|
||||
@@ -13,4 +13,3 @@
|
||||
-- limitations under the License.
|
||||
|
||||
ALTER TABLE "User" DROP COLUMN gaia_id;
|
||||
|
||||
|
||||
@@ -19,4 +19,3 @@ ALTER TABLE "DomainHost"
|
||||
ADD CONSTRAINT FK_DomainHost_host_valid
|
||||
FOREIGN KEY (ns_hosts)
|
||||
REFERENCES "HostResource";
|
||||
|
||||
|
||||
@@ -15,4 +15,3 @@
|
||||
ALTER TABLE "RegistryLock" DROP COLUMN relock_duration;
|
||||
|
||||
ALTER TABLE "RegistryLock" ADD COLUMN relock_duration interval;
|
||||
|
||||
|
||||
@@ -24,4 +24,3 @@ ALTER TABLE if exists "Domain"
|
||||
FOREIGN KEY (transfer_billing_event_id)
|
||||
REFERENCES "BillingEvent"
|
||||
DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
|
||||
@@ -22,4 +22,3 @@ ALTER TABLE "HostHistory" ADD CONSTRAINT fk_hosthistory_host
|
||||
FOREIGN KEY (host_repo_id)
|
||||
REFERENCES "Host"(repo_id)
|
||||
DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
|
||||
@@ -19,4 +19,3 @@ create index IDXq9gy8x2xynt9tb16yajn1gcm8 on "Domain" (billing_contact);
|
||||
create index IDXr22ciyccwi9rrqmt1ro0s59qf on "Domain" (tech_contact);
|
||||
|
||||
create index IDXa7fu0bqynfb79rr80528b4jqt on "Domain" (registrant_contact);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user