Environment
Observed in 3.0.6, still valid in develop.
Expected Behaviour
Whenever I have an object of type SDocumentGraph (independent of its state), I can call SDocumentGraph.createTimeline(), which will result in adding an STimeline object to the graph. Afterwards, when I call SDocumentGraph.getTimeline(), a non-null STimeline object is returned.
Actual behavior
When I add n STextualDSs to an SDocumentGraph and call #createTimeline() on it, an NPE is thrown here:
for (STextualDS sTextualDS : getTextualDSs()) {
sTimeRelList.addAll(sTimeRelTable.get(sTextualDS));
}
I.e., List#addAll() does not support null arguments. At this point, though, sTimeRelTable.get(sTextualDS) returns null as STextualDSs are only added to the Hashtable while iterating over the graph's STextualRelations as returned by #getTextualRelations(). Because there are no STextualRelations in the graph as of yet (n STextualDSs have been added, but no STokens yet!), the STextualDSs in question are never added!
Steps to reproduce
SDocumentGraph graph = SaltFactory.createSDocumentGraph();
graph.createTextualDS("");
graph.createTimeline();
Environment
Observed in 3.0.6, still valid in develop.
Expected Behaviour
Whenever I have an object of type
SDocumentGraph(independent of its state), I can callSDocumentGraph.createTimeline(), which will result in adding anSTimelineobject to the graph. Afterwards, when I callSDocumentGraph.getTimeline(), a non-nullSTimelineobject is returned.Actual behavior
When I add n
STextualDSs to anSDocumentGraphand call#createTimeline()on it, anNPEis thrown here:I.e.,
List#addAll()does not supportnullarguments. At this point, though,sTimeRelTable.get(sTextualDS)returnsnullasSTextualDSs are only added to theHashtablewhile iterating over the graph'sSTextualRelations as returned by#getTextualRelations(). Because there are noSTextualRelations in the graph as of yet (nSTextualDSs have been added, but noSTokens yet!), theSTextualDSs in question are never added!Steps to reproduce