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

Stephen Mallette commented on TINKERPOP-2507:
---------------------------------------------

I dont know why this is the way it is. Perhaps it is a vestige of code left 
over from times prior to the {{IdManager}}? I don't see why that code needs to 
be present except that without it we have to do iteration time class checks to 
see if the "id" is an {{Element}} or not:

https://github.com/apache/tinkerpop/blob/332177a4b65563bc9ac2ad89e1a3ce78bf290195/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java#L313-L316

That bit of code would have to change. If you'd like to submit a pull request 
to change this, I'd be happy to review it. I imagine if there are things I'm 
not thinking of the test suite will complain and we'll know why we need to 
{{validateHomogenousIds()}}. 

> TinkerGraph erroneously assumes IDs must be homogeneous
> -------------------------------------------------------
>
>                 Key: TINKERPOP-2507
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2507
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: tinkergraph
>    Affects Versions: 3.4.9
>            Reporter: Christopher Smith
>            Priority: Major
>
> In {{TinkerGraph#validateHomogenousIds(List)}}, TinkerGraph _explicitly_ 
> checks for identical ID types among all IDs passed in and provides a 
> misleading error message if they mismatch. In fact, this is a semantic error; 
> TinkerGraph quite happily supports heterogeneous element ID types.
> In my application, vertex IDs are generally explicitly assigned using 
> UUID-as-string values, and so the IDs are primarily of type {{String}}. 
> However, my test infrastructure has a few bookkeeping nodes that I'm not 
> manually writing IDs to, and TinkerGraph assigns them {{Long}} IDs. These 
> mixed IDs work _just fine_, but when I try to pass an {{Object...}} to {{V}}, 
> TinkerGraph throws.
> Mixing ID types is perfectly legal (if not, in most cases, practically 
> advisable), and TinkerGraph should not throw when presented with a mixed 
> array of valid IDs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to