Re: [jgrapht-users] NullPointerException in DOTExporter
Brought to you by:
barak_naveh,
perfecthash
From: John S. <js...@gm...> - 2011-02-22 02:46:32
|
This is due to a regression which slipped into the last release. The fix is already in svn, and will be included in the next release. JVS On Mon, Feb 21, 2011 at 6:40 PM, Aleksandar Dimitrov <ale...@go...> wrote: > 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 > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQEcBAEBAgAGBQJNYyIHAAoJECmWntURB2vS/g4H/jrnOTAiYLSeNl0mSdmO7sj7 > S00pVJTXBYtfMEJteODG3M7dv1YiuCL9zber+0wX6u5dAzrlAUOnUxsygrB2AtGG > 1U50SDPc/1MGFeofElwo/REfrQcGczpJOwK6l5A9j0+S1P2IVMbuysNhQRpEU6Ea > y9D9O+AEFtyG9SJfJw8l6o7ibbc8rnJzV6aSggEsVMi5Vu1wbVbq3mB1023u88pK > lHFBcx9ZPLX7HfhBBvBbXQSZF88faw9Yyvzn0JMBwKw+m2S4yIAalUO2ZkFMQWys > wA1pDmrZyUsi4Mgpv4PL5brpQfr830BMNUsU2vF+eGYF9//0IrpB71ylE6Pv3mg= > =NJel > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Index, Search & Analyze Logs and other IT data in Real-Time with Splunk > Collect, index and harness all the fast moving IT data generated by your > applications, servers and devices whether physical, virtual or in the cloud. > Deliver compliance at lower cost and gain new business insights. > Free Software Download: http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |