kenhuuu commented on code in PR #3433:
URL: https://github.com/apache/tinkerpop/pull/3433#discussion_r3357320309
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GremlinLang.java:
##########
@@ -252,6 +267,19 @@ private String argAsString(final Object arg) {
return ((Class) arg).getSimpleName();
}
+ if (pdtRegistry != null) {
+ final Optional<ProviderDefinedTypeAdapter<?>> adapter =
pdtRegistry.getAdapterByClass(arg.getClass());
+ if (adapter.isPresent()) {
+ @SuppressWarnings("unchecked")
+ final Map<String, Object> props =
((ProviderDefinedTypeAdapter) adapter.get()).toProperties(arg);
+ return argAsString(new
ProviderDefinedType(adapter.get().typeName(), props));
+ }
+ }
+
+ if (arg.getClass().isAnnotationPresent(ProviderDefined.class)) {
Review Comment:
Is the ordering of adapter first then annotation a specific choice? If so,
either add a maintenance comment or (probably better) add a unit test for this.
--
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]