milleruntime commented on code in PR #2718:
URL: https://github.com/apache/accumulo/pull/2718#discussion_r881545193
##########
core/src/main/java/org/apache/accumulo/core/metadata/schema/RootGcCandidatesJson.java:
##########
@@ -96,20 +98,6 @@ public Stream<String> stream() {
}
public String toJson() {
- GSonData gd = new GSonData();
- gd.candidates = candidates;
- return GSON.toJson(gd);
- }
-
- public static RootGcCandidates fromJson(String json) {
- GSonData gd = GSON.fromJson(json, GSonData.class);
-
- Preconditions.checkArgument(gd.version == 1);
-
- return new RootGcCandidates(gd.candidates);
- }
-
- public static RootGcCandidates fromJson(byte[] json) {
- return fromJson(new String(json, UTF_8));
+ return GSON.toJson(this);
Review Comment:
Yeah, I wasn't sure about this this as well. I could make the static method
take the object. Or maybe if I drop the empty arg constructor, this won't look
so suspect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]