[jira] [Commented] (TINKERPOP-1468) GraphTraversal.optional throws a NPE if no traversal is provided

2016-10-27 Thread Ted Wilmes (JIRA)

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

Ted Wilmes commented on TINKERPOP-1468:
---

I haven't kept up as much with the GLV development, but thinking through that 
case where at some future point, I would think many
folks would not be running an embedded graph db and instead would be using a 
client that would be passing Gremlin byte code, which
would then be reconstructed on the server side, we'd probably avoid this issue 
anyway or maybe catch it with byte code level validation?

Regardless, I'm okay with closing it "won't fix".

> GraphTraversal.optional throws a NPE if no traversal is provided
> 
>
> Key: TINKERPOP-1468
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1468
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.2
>Reporter: Ted Wilmes
>  Labels: trivial
>
> {{GraphTraversal.optional}} throws a NPE if no traversal is provided.  We 
> should probably throw a friendlier exception with instructions to provide a 
> traversal as an argument.
> {code}
> gremlin> g.V().optional()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
>   at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.optional(GraphTraversal.java:1316)
> {code}



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


[jira] [Commented] (TINKERPOP-1468) GraphTraversal.optional throws a NPE if no traversal is provided

2016-10-27 Thread Robert Dale (JIRA)

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

Robert Dale commented on TINKERPOP-1468:


Then again, you do have the stacktrace pointing right to the optional() method. 
I think the next logical step is to check the API. The API clearly shows that 
it takes a Traversal parameter. I hope at that point it's obvious what needs to 
be done. It may not be user friendly in the sense of hand-holding, but it's a 
lot better than most SQL error messages.  So, yes, I would close as "won't fix".

> GraphTraversal.optional throws a NPE if no traversal is provided
> 
>
> Key: TINKERPOP-1468
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1468
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.2
>Reporter: Ted Wilmes
>  Labels: trivial
>
> {{GraphTraversal.optional}} throws a NPE if no traversal is provided.  We 
> should probably throw a friendlier exception with instructions to provide a 
> traversal as an argument.
> {code}
> gremlin> g.V().optional()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
>   at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.optional(GraphTraversal.java:1316)
> {code}



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


[jira] [Commented] (TINKERPOP-1468) GraphTraversal.optional throws a NPE if no traversal is provided

2016-10-26 Thread Robert Dale (JIRA)

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

Robert Dale commented on TINKERPOP-1468:


I guess it depends on how user friendly you want to be Vs. accepting certain 
groovy-isms.

You could null check here and provide a friendly message like the ticket 
suggests.  Ideally that would be consistent everywhere. That could be a lot of 
places.  Is that work done all at once or case by case?

Even with that in place, there are certain groovy-isms that can't be avoided: 
```
gremlin> g.V().choose()
Could not find which method choose() to invoke from this list:
```
But maybe that message is user friendly enough.

I wonder what other GLVs do.

> GraphTraversal.optional throws a NPE if no traversal is provided
> 
>
> Key: TINKERPOP-1468
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1468
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.2
>Reporter: Ted Wilmes
>  Labels: trivial
>
> {{GraphTraversal.optional}} throws a NPE if no traversal is provided.  We 
> should probably throw a friendlier exception with instructions to provide a 
> traversal as an argument.
> {code}
> gremlin> g.V().optional()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
>   at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.optional(GraphTraversal.java:1316)
> {code}



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


[jira] [Commented] (TINKERPOP-1468) GraphTraversal.optional throws a NPE if no traversal is provided

2016-10-21 Thread Marko A. Rodriguez (JIRA)

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

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

This is really weird because there is no method signature that allows for no 
args.

{code}
public default  GraphTraversal optional(final Traversal 
optionalTraversal) {
this.asAdmin().getBytecode().addStep(Symbols.optional, 
optionalTraversal);
return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), 
(Traversal.Admin) optionalTraversal, (Traversal.Admin) 
optionalTraversal.asAdmin().clone(), (Traversal.Admin) 
__.identity()));
}

{code}

And its dying on the {{clone()}} call. I don't know why Groovy isn't throwing a 
"no such method found exception".

> GraphTraversal.optional throws a NPE if no traversal is provided
> 
>
> Key: TINKERPOP-1468
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1468
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.2
>Reporter: Ted Wilmes
>  Labels: trivial
>
> {{GraphTraversal.optional}} throws a NPE if no traversal is provided.  We 
> should probably throw a friendlier exception with instructions to provide a 
> traversal as an argument.
> {code}
> gremlin> g.V().optional()
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
>   at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.optional(GraphTraversal.java:1316)
> {code}



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