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

Marko A. Rodriguez commented on TINKERPOP-1498:
-----------------------------------------------

This is bad. Nesting a set in itself is never a good idea in programming. For 
instance, without Gremlin:

{code}
gremlin> x = [1,2,3] as Set
==>1
==>2
==>3
gremlin> x.add(x)
==>true
gremlin> x
==>1
==>2
==>3
java.lang.StackOverflowError
Type ':help' or ':h' for help.
Display stack trace? [yN]
{code}

Thus, I don't think this is a TinkerPop ISSUE. Its more an issue with having 
"bad" logic. At best, we can throw an exception like: "BulkSet.add(this) -> You 
can not add a set to itself." However, then {{BulkSet}} would be a bit 
different than {{Set}}. As such, I think that this is just a non-issue and 
should be closed.

> choose() can throw StackOverflowErrors
> --------------------------------------
>
>                 Key: TINKERPOP-1498
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1498
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.2
>            Reporter: Daniel Kuppitz
>
> {noformat}
> gremlin> g = TinkerFactory.createModern().traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> g.V().choose(select("x"), select("x"), constant("not x")).store("x")
> java.lang.StackOverflowError
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to