Visitar URL original
refactor: Inline json scope variable and ignoreUnknownFields variable… · googleapis/java-bigquerystorage@abea73c · GitHub
Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit abea73c

Browse files
committed
refactor: Inline json scope variable and ignoreUnknownFields variable in JsonToProtoMessage
1 parent 49f7ec7 commit abea73c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ public class JsonToProtoMessage implements ToProtoConverter<Object> {
9999
.optionalEnd()
100100
.toFormatter()
101101
.withZone(ZoneOffset.UTC);
102-
private final String ROOT_JSON_SCOPE = "root";
103-
private final boolean DONT_ACCEPT_UNKNOWN_FIELDS = false;
104102

105103
/** You can use {@link #INSTANCE} instead */
106104
public JsonToProtoMessage() {}
@@ -152,7 +150,7 @@ public DynamicMessage convertToProtoMessage(Descriptor protoSchema, JSONObject j
152150
Preconditions.checkState(json.length() != 0, "JSONObject is empty.");
153151

154152
return convertToProtoMessage(
155-
protoSchema, null, json, ROOT_JSON_SCOPE, DONT_ACCEPT_UNKNOWN_FIELDS);
153+
protoSchema, null, json, "root", false);
156154
}
157155

158156
/**
@@ -176,8 +174,8 @@ public DynamicMessage convertToProtoMessage(
176174
protoSchema,
177175
tableSchema.getFieldsList(),
178176
json,
179-
ROOT_JSON_SCOPE,
180-
DONT_ACCEPT_UNKNOWN_FIELDS);
177+
"root",
178+
false);
181179
}
182180

183181
/**
@@ -199,7 +197,7 @@ public DynamicMessage convertToProtoMessage(
199197
Preconditions.checkState(json.length() != 0, "JSONObject is empty.");
200198

201199
return convertToProtoMessage(
202-
protoSchema, tableSchema.getFieldsList(), json, ROOT_JSON_SCOPE, ignoreUnknownFields);
200+
protoSchema, tableSchema.getFieldsList(), json, "root", ignoreUnknownFields);
203201
}
204202

205203
/**

0 commit comments

Comments
 (0)