[ 
https://issues.apache.org/jira/browse/TINKERPOP-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17728817#comment-17728817
 ] 

Stephen Mallette commented on TINKERPOP-2952:
---------------------------------------------

sorry, it took some time for me to get back to this. i was able to recreate the 
problem with your example. i'm not sure what i did to get it to work. perhaps i 
just was mistaken that it was working at all. 

i'm not sure that this is a bug necessarily as i'm not sure that it's the DSLs 
purpose to override existing step functionality. It's purpose is to provide new 
domain specific steps that offer functionality composed from existing steps. If 
you have functionality you want in {{properties(String...)}} i think the 
correct thing to do is to create a new step all together called 
{{myProperties(String...)}} (or whatever domain specific name makes sense). 

While I can see why folks might want to simply add features to existing steps, 
I think that if we allow this to work it makes Gremlin less readable because 
`properties(String...)` may or may not behave like the actual Gremlin 
definition of {{properties(String...)}}. I'm inclined to keep this working the 
way that it does and to update the documentation to make it clear that this is 
intended behavior.

> Error when overriding DSL methods
> ---------------------------------
>
>                 Key: TINKERPOP-2952
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2952
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.6.2
>            Reporter: Drew Nuttall-Smith
>            Priority: Major
>
> I'm implementing a custom gremlin DSL in java, and due to some interesting 
> requirements, I'm trying to override the `properties` method from the 
> GraphTraversal class.
>  
> Doing so results in a compilation error (see below) due to the method already 
> being defined. It looks like the DSL code generation is loading in the custom 
> methods, and then loading in the built in methods and the `@Override` 
> annotation is ignored.
>  
>  
> Error:
> {{[ERROR] 
> /Users/drewnuttall-smith/Documents/work/projects/compliance/dm-mettle-nextgen-compliance/target/generated-sources/annotations/com/datamigrators/mettle/compliance/gremlin/dsl/DatastageTraversal.java:[223,62]
>  method <E2>properties(java.lang.String...) is already defined in interface 
> com.datamigrators.mettle.compliance.gremlin.dsl.DatastageTraversal}}
> {{[ERROR] 
> /Users/drewnuttall-smith/Documents/work/projects/compliance/dm-mettle-nextgen-compliance/target/generated-sources/annotations/com/datamigrators/mettle/compliance/gremlin/dsl/__.java:[192,85]
>  name clash: <A,B>properties(java.lang.String...) and 
> <E2,S>properties(java.lang.String...) have the same erasure}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to