tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stephen mallette (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (TINKERPOP-2283) GraphStep's ids null exception
Date Thu, 15 Aug 2019 11:20:00 GMT

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

stephen mallette edited comment on TINKERPOP-2283 at 8/15/19 11:19 AM:
-----------------------------------------------------------------------

It looks like a {{NullPointerException}} is possible as you describe. Seems like the easiest
fix is to just do a better job initializing {{ids}} here:

https://github.com/apache/tinkerpop/blob/3473b1a3d94c8ed17e3db10173878a3d1f6e7306/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java#L66

Did you want to offer a pull request? If so, the pull request should be targetted at the {{tp33}}
branch I think since this issue goes back at least that far.


was (Author: spmallette):
It looks like a {{NullPointerException}} is possible as you describe. Seems like the easiest
fix is to just do a better job initializing {{ids}} here:

https://github.com/apache/tinkerpop/blob/3473b1a3d94c8ed17e3db10173878a3d1f6e7306/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java#L66

Did you want to offer a pull request?

> GraphStep's ids null exception
> ------------------------------
>
>                 Key: TINKERPOP-2283
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2283
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.4.2
>            Reporter: Stark Arya
>            Priority: Major
>
> Variable ids maybe null in GraphStep.java, s simple sample list here:
> _{color:#FF0000}gremlin> g.V().hasId([]).profile(){color}_
> _{color:#FF0000}==>Traversal Metrics{color}_
> _{color:#FF0000}Step Count Traversers Time (ms) % Dur{color}_
> _{color:#FF0000}============================================================================================================={color}_
> _{color:#FF0000}TinkerGraphStep(vertex,null) 0.037 100.00{color}_
>  _{color:#FF0000}>TOTAL - - 0.037 -{color}_ 
> So, GraphStep.java has many error when dealing with ids,just like:
> {color:#FF0000}_@Override_{color}
> {color:#FF0000}_public int hashCode() {_{color}
> {color:#FF0000} _int result = super.hashCode() ^ this.returnClass.hashCode();_{color}
> {color:#FF0000} _for (final Object id : this.ids) {_{color}
> {color:#FF0000} _result ^= id.hashCode();_{color}
> {color:#FF0000} _}_{color}
> {color:#FF0000} _return result;_{color}
> {color:#FF0000}_}_{color}
> {color:#d04437}_@Override_{color}
> {color:#d04437}_public String toString() {_{color}
> {color:#d04437} _if (this.hasContainers.isEmpty())_{color}
> {color:#d04437} _return super.toString();_{color}
> {color:#d04437} _else_{color}
> {color:#d04437} _return 0 == this.ids.length ?_{color}
> {color:#d04437} _StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(),
this.hasContainers) :_{color}
> {color:#d04437} _StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(),
Arrays.toString(this.ids), this.hasContainers);_{color}
> {color:#d04437}_}_{color}
> {color:#333333}I thinks this is bug not just appear from 3.4.2{color}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message