xiazcy commented on code in PR #3578:
URL: https://github.com/apache/tinkerpop/pull/3578#discussion_r3669656992


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java:
##########
@@ -78,11 +79,15 @@ public final class GryoMapper implements Mapper<Kryo> {
     private final List<TypeRegistration<?>> typeRegistrations;
     private final boolean registrationRequired;
     private final boolean referenceTracking;
+    private final boolean javaSerializationAllowed;
     private final Supplier<ClassResolver> classResolver;
     private final GryoVersion version;
 
     private GryoMapper(final Builder builder) {
-        this.typeRegistrations = builder.typeRegistrations;
+        this.javaSerializationAllowed = builder.javaSerializationAllowed;
+        this.typeRegistrations = builder.typeRegistrations.stream().
+                filter(tr -> javaSerializationAllowed || 
!(tr.getShadedSerializer() instanceof JavaSerializer)).

Review Comment:
   Is there a reason we are doing the filtering of direct `JavaSerializer` here 
in the constructor, instead of inside `createMapper()` via the 
`resolvesToJavaSerializer` helper with the rest?



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