shunping commented on code in PR #38531:
URL: https://github.com/apache/beam/pull/38531#discussion_r3262992958


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java:
##########
@@ -1805,7 +1806,14 @@ static Object deserializeNode(JsonNode node, Method 
method) throws IOException {
     parser.nextToken();
 
     JsonDeserializer<Object> jsonDeserializer = 
getDeserializerForMethod(method);
-    return jsonDeserializer.deserialize(parser, 
DESERIALIZATION_CONTEXT.copy());
+    // Create a fresh context that is correctly associated with the active 
parser.
+    // Using copy() here would leave the context's transient parser field as 
null,
+    // causing NullPointerExceptions in Jackson 2.14+ deserializers during 
coercion
+    // validations and length checks.
+    DefaultDeserializationContext context =
+        ((DefaultDeserializationContext) MAPPER.getDeserializationContext())
+            .createInstance(MAPPER.getDeserializationConfig(), parser, new 
InjectableValues.Std());

Review Comment:
   Done



-- 
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]

Reply via email to