Cole-Greer commented on code in PR #3433:
URL: https://github.com/apache/tinkerpop/pull/3433#discussion_r3393324812
##########
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:
It was deliberate so users have an ability to override an annotated class if
they so choose. I've added a comment and unit test.
--
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]