Skip to content

Remove usages of json-simple#3060

Merged
gbrodman merged 1 commit into
google:masterfrom
gbrodman:removeSimpleJson
Jun 1, 2026
Merged

Remove usages of json-simple#3060
gbrodman merged 1 commit into
google:masterfrom
gbrodman:removeSimpleJson

Conversation

@gbrodman
Copy link
Copy Markdown
Collaborator

@gbrodman gbrodman commented May 22, 2026

We should use gson wherever possible. There's no point in having unnecessary dependencies (we'll need to keep around jackson for YAML parsing).


This change is Reviewable

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

Copy link
Copy Markdown
Collaborator

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jicelhay reviewed 35 files and all commit messages, and made 4 comments.
Reviewable status: 35 of 37 files reviewed, 4 unresolved discussions (waiting on gbrodman).


common/gradle.lockfile line 37 at r1 (raw file):

io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,testAnnotationProcessor,testingAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,testAnnotationProcessor,testingAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.16=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,testing,testingCompileClasspath

not related ot json, right?


console-webapp/package-lock.json line 631 at r1 (raw file):

      }
    },
    "node_modules/@angular/build/node_modules/@types/node": {

same for these dependencies.


core/src/main/java/google/registry/request/RequestModule.java line 212 at r1 (raw file):

    }
    try {
      return Preconditions.checkNotNull(gson.fromJson(payload, new TypeToken<>() {}));

nit: import these 2 static methods.


core/src/main/java/google/registry/security/JsonHttp.java line 45 at r1 (raw file):

  private static final FluentLogger logger = FluentLogger.forEnclosingClass();

  private static final Gson GSON = GsonUtils.provideGson();

same for these methods

@gbrodman gbrodman force-pushed the removeSimpleJson branch from a459563 to 0dd36d7 Compare May 27, 2026 17:50
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

Copy link
Copy Markdown
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbrodman made 4 comments.
Reviewable status: 20 of 37 files reviewed, 4 unresolved discussions (waiting on jicelhay).


core/src/main/java/google/registry/request/RequestModule.java line 212 at r1 (raw file):

Previously, jicelhay (Juan Celhay) wrote…

nit: import these 2 static methods.

which two? why? we have many instances of both "statically import the method" and "use Preconditions" in the codebase


core/src/main/java/google/registry/security/JsonHttp.java line 45 at r1 (raw file):

Previously, jicelhay (Juan Celhay) wrote…

same for these methods

no, these should not be statically imported. 1. the qualification distinguishes where we're getting it from 2. we do it this way all throughout the codebase


common/gradle.lockfile line 37 at r1 (raw file):

Previously, jicelhay (Juan Celhay) wrote…

not related ot json, right?

yeah these just get updated whenever we run the full build with --write-lockfiles


console-webapp/package-lock.json line 631 at r1 (raw file):

Previously, jicelhay (Juan Celhay) wrote…

same for these dependencies.

same

@jicelhay
Copy link
Copy Markdown
Collaborator

jicelhay commented Jun 1, 2026

core/src/main/java/google/registry/security/JsonHttp.java line 45 at r1 (raw file):

Previously, gbrodman wrote…

no, these should not be statically imported. 1. the qualification distinguishes where we're getting it from 2. we do it this way all throughout the codebase

IMO this Gsonutils method should be statically imported if following go/java-practices/imports#static recommendations since it's self-describing.

Also in our recently added GEMINI rules we have a rule for "Always statically import methods from utility classes.."

But I'm not going to block on this.

@jicelhay
Copy link
Copy Markdown
Collaborator

jicelhay commented Jun 1, 2026

core/src/main/java/google/registry/request/RequestModule.java line 212 at r1 (raw file):

Previously, gbrodman wrote…

which two? why? we have many instances of both "statically import the method" and "use Preconditions" in the codebase

meant the ones from Preconditions.

Copy link
Copy Markdown
Collaborator

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jicelhay reviewed 17 files and all commit messages, and resolved 2 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gbrodman).

Copy link
Copy Markdown
Collaborator

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@jicelhay made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gbrodman).

Copy link
Copy Markdown
Collaborator

@jicelhay jicelhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jicelhay resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on gbrodman).

We should use gson wherever possible. There's no point in having
unnecessary dependencies (we'll need to keep around jackson for YAML
parsing).
@gbrodman gbrodman force-pushed the removeSimpleJson branch from 0dd36d7 to 0ea8095 Compare June 1, 2026 19:27
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Attention Required: Lockfile Detected

This pull request contains modifications to one or more *.lockfile files. Please confirm that you have run update_dependency.sh to push new dependencies to the private repo.

Someone with Admin role must manually dismiss this review before merging.

Copy link
Copy Markdown
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbrodman made 1 comment.
Reviewable status: 24 of 37 files reviewed, 1 unresolved discussion (waiting on jicelhay).


core/src/main/java/google/registry/security/JsonHttp.java line 45 at r1 (raw file):

Previously, jicelhay (Juan Celhay) wrote…

IMO this Gsonutils method should be statically imported if following go/java-practices/imports#static recommendations since it's self-describing.

Also in our recently added GEMINI rules we have a rule for "Always statically import methods from utility classes.."

But I'm not going to block on this.

i'm not 100% sure that it's self-describing since there are multiple instances of gson creation in the codebase (when we need paramaters that are different from the usual ones). I figure it's best to be clear

@gbrodman gbrodman added this pull request to the merge queue Jun 1, 2026
Copy link
Copy Markdown
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbrodman resolved 1 discussion.
Reviewable status: 24 of 37 files reviewed, all discussions resolved (waiting on jicelhay).

Merged via the queue into google:master with commit a5b2808 Jun 1, 2026
14 of 15 checks passed
@gbrodman gbrodman deleted the removeSimpleJson branch June 1, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants