lukecwik commented on a change in pull request #15338:
URL: https://github.com/apache/beam/pull/15338#discussion_r697707454



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java
##########
@@ -1058,13 +1086,29 @@ private static void validateMethodAnnotations(
     validateGettersHaveConsistentAnnotation(
         methodNameToAllMethodMap, descriptors, 
AnnotationPredicates.DEFAULT_VALUE);
 
+    // Verify that there is no getter with a mixed @JsonDeserialize annotation.
+    validateGettersHaveConsistentAnnotation(

Review comment:
       Does it make sense that if `@JsonDeserialize` is on the getter then we 
must also have `@JsonSerialize` and vice versa?

##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java
##########
@@ -1791,6 +1984,11 @@ private static void checkEmptyStringAllowed(
     private final Map<Set<Class<? extends PipelineOptions>>, Registration<?>> 
combinedCache =
         Maps.newConcurrentMap();
 
+    private final Map<Method, JsonDeserializer<Object>> deserializerCache = 
Maps.newConcurrentMap();

Review comment:
       We should use `Optional` here as well to prevent recomputation all the 
time since computeIfAbsent will always compute again and again when null.




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