[
https://issues.apache.org/jira/browse/TINKERPOP3-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495587#comment-14495587
]
Matt Frantz commented on TINKERPOP3-549:
----------------------------------------
[~okram], [~dkuppitz]:
I intentionally made no changes to existing behavior with my PR. However, I
hope that we could deprecate the current {{Path.get}} API, as it violates the
Java Generic contract, and is also difficult to deal with because of its
"flexible" return type. My PR also uncovers some eccentric behavior of
{{SparsePath}}.
I feel that we might want to refactor {{PathTest}}. We need to have pure unit
tests for {{Path}} and its concrete subtypes, but we also want to beef up the
testing around traversals that rely on {{Path}}. TINKERPOP3-618, for example,
shows that the behavior of the {{select}} step depends on the particular
{{Traverser}} subtype, and thus, perhaps, on the particular {{Path}} subtype
used.
{{B_O_PA_S_SE_SL_Traverser}} uses {{SparsePath}}, which, as the new unit tests
in my PR show, has completely different semantics than the other {{Path}}
subtypes. I believe {{SparsePath}} may still be a reasonable optimization when
you can prove that a traversal does not need access to the full history of a
step label. For that reason, the proposed new steps {{selectLast}} and
{{selectList}} could influence the choice of {{Traverser}} type and thus the
{{Path}} type without loss of functionality. With {{select}} as it works now,
you would have to assume that you want the list, so you would make sure to
avoid {{SparsePath}}.
I believe that {{SparsePath.get}} should actually throw an exception, because
otherwise you get TINKERPOP3-618.
> Path data structure
> -------------------
>
> Key: TINKERPOP3-549
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-549
> Project: TinkerPop 3
> Issue Type: Bug
> Components: process
> Reporter: Daniel Kuppitz
> Fix For: 3.0.0.GA
>
>
> Cover the sample(s) in [Path Data
> Structure|http://www.tinkerpop.com/docs/3.0.0-SNAPSHOT/#path-data-structure]
> with unit tests. At the moment there's nothing that prevents one from
> removing the List-logic in
> [Path::get()|https://github.com/apache/incubator-tinkerpop/blob/master/gremlin-core/src/main/java/com/tinkerpop/gremlin/process/Path.java#L50-L71].
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)