tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stark Arya (Jira)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP-2283) GraphStep's ids null exception
Date Wed, 28 Aug 2019 01:46:00 GMT

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

Stark Arya commented on TINKERPOP-2283:
---------------------------------------

I am sorry for reply so late, The error exists,  as you can recurrent the error by doing:

gremlin> g.V().hasId([]).has("name","stephen").profile()
java.lang.NullPointerExceptionType ':help' or ':h' for help.
Display stack trace? [yN]y
java.lang.NullPointerException at org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.step.sideEffect.TinkerGraphStep.toString(TinkerGraphStep.java:107)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep.initializeIfNeeded(ProfileStep.java:91)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep.hasNext(ProfileStep.java:76)
...

I think why your case is Correct just because the branch this.hasContainers.isEmpty()) ==
true
public String toString() {
if (this.hasContainers.isEmpty())
   return super.toString();

Believe me, I will fix the bug today

> 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
(v8.3.2#803003)

Mime
View raw message