tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP-2345) NullPointerException when Map key is not found for math()
Date Tue, 31 Mar 2020 17:20:00 GMT

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

ASF GitHub Bot commented on TINKERPOP-2345:

spmallette commented on pull request #1272: TINKERPOP-2345 Improved error message for bad
value for math()
URL: https://github.com/apache/tinkerpop/pull/1272
   This problem really only applies to 3.4.x since by() didn't modulate Map traversers in
3.3.x. This change does also however fix the error message for non-Number objects trying to
be passed into a math() expression, but the error is at least more understandable than the
NullPointerException - on 3.3.x we get "java.lang.String cannot be cast to java.lang.Number"
which while not perfect is probably good enough for that older version. It didn't seem like
a big enough problem to add the enhancement there.
   All tests pass with `docker/build.sh -t -n -i`
   VOTE +1
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> NullPointerException when Map key is not found for math()
> ---------------------------------------------------------
>                 Key: TINKERPOP-2345
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2345
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.6
>            Reporter: Stephen Mallette
>            Priority: Minor
> We could probably have a nicer error here:
> {code}
> gremlin> g.V().hasLabel('person').elementMap().as('x').math('x').by('aged')
> java.lang.NullPointerException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.lang.NullPointerException
> 	at org.apache.tinkerpop.gremlin.process.traversal.step.map.MathStep.map(MathStep.java:73)
> 	at org.apache.tinkerpop.gremlin.process.traversal.step.map.MathStep.map(MathStep.java:47)
> 	at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:37)
> 	at org.apache.tinkerpop.gremlin.process.traversal.step.map.MathStep.processNextStart(MathStep.java:63)
> 	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> 	at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:197)
> 	at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:255)
> {code}

This message was sent by Atlassian Jira

View raw message