[jgrapht-users] NullPointerException in DOTExporter
Brought to you by:
barak_naveh,
perfecthash
From: Aleksandar D. <ale...@go...> - 2011-02-22 02:40:57
|
Dear jgrapht users and devs, I believe I've hit a bug, but maybe it's just me overlooking something in the docs or my own code. I would like to render my graphs to the DOT format, with labelled arcs and vertices. However, every time I attempt to do that, I receive a Null pointer exception from jgrapht: > Caused by: java.lang.NullPointerException > at org.jgrapht.ext.DOTExporter.renderAttributes(Unknown Source) > at org.jgrapht.ext.DOTExporter.export(Unknown Source) The code for my dotexporter looks something like this: > final DOTExporter<String,String> dotex = new DOTExporter<String,String> > ( new IntegerNameProvider<String>() > , new VertexNameProvider<String>() { private int i = 0; > public String getVertexName(String t) { i++;return i+t; } } > , null); The integer variable is there to guarantee uniqueness. The documentation for StringVertexNameProvider<V> seemed to require .toString of V to generate something unique. I'm familiar with the DOT language, and I believe this would only be relevant for the unique ID (which, in my case, IntegerNameProvider covers well.) I did leave it in, though, since I only intend the graphs to be used for debugging. But they're complex graphs, I'd like to see them properly displayed. The above code is running *inside* an Apache UIMA analysis engine. I doubt that this would have anything to do with the error. Removing the VertexNameProvider and substituting null for it works. The same happens with the EdgeNameProvider. I'm using the version jgrapht-jdk1.6-0.8.2 (at least, that's what my JAR file is called :-) I know that this is painfully little debugging information, and I haven't yet isolated a runnable minimal case. Unfortunately, I'm rather busy today, and probably tomorrow. I'll try to provide further information if needed to reproduce the problem later this week. Thank you in advance (and for writing a really neat library!) Aleks |