Remove usages of json-simple#3060
Conversation
There was a problem hiding this comment.
⚠️ 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.
jicelhay
left a comment
There was a problem hiding this comment.
@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
a459563 to
0dd36d7
Compare
There was a problem hiding this comment.
⚠️ 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.
gbrodman
left a comment
There was a problem hiding this comment.
@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
|
Previously, gbrodman 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. |
|
Previously, gbrodman wrote…
meant the ones from Preconditions. |
jicelhay
left a comment
There was a problem hiding this comment.
@jicelhay reviewed 17 files and all commit messages, and resolved 2 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gbrodman).
jicelhay
left a comment
There was a problem hiding this comment.
@jicelhay made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gbrodman).
jicelhay
left a comment
There was a problem hiding this comment.
@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).
0dd36d7 to
0ea8095
Compare
There was a problem hiding this comment.
⚠️ 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.
gbrodman
left a comment
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
@gbrodman resolved 1 discussion.
Reviewable status: 24 of 37 files reviewed, all discussions resolved (waiting on jicelhay).
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