gephi / graphstore

Fast in-memory graph structure, powering Gephi
Apache License 2.0
71 stars 26 forks source link

Null pointer exception when changing value of boolean[] column #125

Closed eduramiba closed 8 years ago

eduramiba commented 8 years ago

Way to reproduce:

This seems to only happen to boolean arrays, and not to other types of arrays.

java.lang.NullPointerException
    at org.gephi.graph.impl.IndexImpl$AbstractIndex.removeValue(IndexImpl.java:434)
    at org.gephi.graph.impl.IndexImpl$BooleanArrayIndex.removeValue(IndexImpl.java:951)
    at org.gephi.graph.impl.IndexImpl$AbstractIndex.replaceValue(IndexImpl.java:444)
    at org.gephi.graph.impl.IndexImpl.set(IndexImpl.java:209)
    at org.gephi.graph.impl.IndexStore.set(IndexStore.java:111)
    at org.gephi.graph.impl.ElementImpl.setAttribute(ElementImpl.java:359)
eduramiba commented 8 years ago

Actually not that easy to reproduce (seems to only happen when there is only one node in the graph and the first value has at least 2 elements).

It can be reproduced often in Gephi with these steps:

mbastian commented 8 years ago

Good catch. In fact the error is due to the fact arrays contain duplicate values... This wasn't really developed with great care as I didn't test this case. I was doubtful the way we index array actually make sense and this is a good trigger to change it. More in #126.