[
https://issues.apache.org/jira/browse/TINKERPOP-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15361120#comment-15361120
]
ASF GitHub Bot commented on TINKERPOP-1355:
-------------------------------------------
Github user dkuppitz commented on the issue:
https://github.com/apache/tinkerpop/pull/355
I noticed a flaw while reading through the code. It was not introduced by
this PR, but it's probably a good time to get it from the table.
```
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().hasId(within(new ArrayList()))
0
Display stack trace? [yN] N
gremlin> g.V().hasId(without(new ArrayList()))
0
Display stack trace? [yN]
```
A `HasContainer` with an empty collection will always throw an exception
because of [line 58 in
HasContainer.java](https://github.com/BrynCooke/incubator-tinkerpop/blob/ca8a4f9fb8a9bc1d69aa10870d75076b8fa906b5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java#L58),
where we simply assume that a collection will always contain at least one
element.
> Design HasContainer for extension
> ---------------------------------
>
> Key: TINKERPOP-1355
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1355
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.0-incubating
> Reporter: Bryn Cooke
> Priority: Critical
>
> Currently HasContainer is final. This means that Graph implementations cannot
> support their own type systems across the entire traversal.
> Given the traversal:
> g.V.has('foo', nonTinkerpopType).out('bar').has('foo', nonTinkerpopType)
> Say that the initial traversal g.V.has('foo', nonTinkerpopType) is dealt with
> via strategy, the non-Tinkerpop type can be dealt with. However the rest of
> the traversal is processed via the default Tinkerpop pipeline, and as such it
> doesn't know how to deal with type conversions/comparisons etc.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)