Activity log for bug #686432

Date Who What changed Old value New value Message
2010-12-07 10:39:10 Sébastien Heymann bug added bug
2010-12-07 10:39:21 Sébastien Heymann gephi: milestone 0.7beta
2010-12-07 10:39:40 Sébastien Heymann nominated for series gephi/toolkit
2010-12-07 10:39:40 Sébastien Heymann bug task added gephi/toolkit
2010-12-07 10:40:48 Sébastien Heymann gephi: assignee Cezary Bartosiak (cezary-bartosiak)
2010-12-07 10:42:43 Sébastien Heymann description I tried to export a GEXF file to check things but it crashed, trying to write: <attributes class="node" mode="dynamic"> <attribute id="time_interval" title="Time Interval" With the following exception: java.lang.NullPointerException at org.gephi.io.exporter.plugin.ExporterGEXF.writeAttributes(ExporterGEXF.java:324) at org.gephi.io.exporter.plugin.ExporterGEXF.writeAttributes(ExporterGEXF.java:296) at org.gephi.io.exporter.plugin.ExporterGEXF.writeGraph(ExporterGEXF.java:251) at org.gephi.io.exporter.plugin.ExporterGEXF.execute(ExporterGEXF.java:213) at org.gephi.io.exporter.impl.ExportControllerImpl.exportFile(ExportControllerImpl.java:110) at org.gephi.io.exporter.impl.ExportControllerImpl.exportFile(ExportControllerImpl.java:67) The problem is raised at at the line: AttributeType staticType = TypeConvertor.getStaticType(col.getType()); When col.getType() return TimeInterval, which is not a type known by TypeConvertor.getStaticType(). But it seems the problem is inside ExporterGEXF.writeAttributes() with the predicate to add a dynamic column: if (exportDynamic && col.getType().isDynamicType() && col.getOrigin().equals(AttributeOrigin.PROPERTY) && col.getIndex() == PropertiesColumn.EDGE_WEIGHT.getIndex()) { dynamicCols.add(col); } "col.getIndex() == PropertiesColumn.EDGE_WEIGHT.getIndex()" is suspicious, as it is true for the node attribute encoding the TimeInterval. How to reproduce using the Toolkit: //Init a project - and therefore a workspace ProjectController pc = Lookup.getDefault().lookup(ProjectController.class); pc.newProject(); Workspace workspace = pc.getCurrentWorkspace(); //Get controllers and models ImportController importController = Lookup.getDefault().lookup(ImportController.class); //Import file Container container; try { File file = new File("1.csv"); container = importController.importFile(file); container.getLoader().setEdgeDefault(EdgeDefault.DIRECTED); //Force DIRECTED container.setAllowAutoNode(false); //Don't create missing nodes } catch (Exception ex) { ex.printStackTrace(); return; } //Initialize the DynamicProcessor - which will append the container to the workspace DynamicProcessor dynamicProcessor = new DynamicProcessor(); dynamicProcessor.setDateMode(false); //Set 'true' if you set real dates (ex: yyyy-mm-dd), it's double otherwise dynamicProcessor.setLabelmatching(false); //Set 'true' if node matching is done on labels instead of ids //Set date for this file dynamicProcessor.setDate("1"); //Process the container using the DynamicProcessor importController.process(container, dynamicProcessor, workspace); //Export full graph ExportController ec = Lookup.getDefault().lookup(ExportController.class); try { ec.exportFile(new File("io_gexf.gexf")); } catch (IOException ex) { ex.printStackTrace(); return; } I tried to export a GEXF file to check things but it crashed, trying to write: <attributes class="node" mode="dynamic">    <attribute id="time_interval" title="Time Interval" With the following exception: java.lang.NullPointerException at org.gephi.io.exporter.plugin.ExporterGEXF.writeAttributes(ExporterGEXF.java:324) at org.gephi.io.exporter.plugin.ExporterGEXF.writeAttributes(ExporterGEXF.java:296) at org.gephi.io.exporter.plugin.ExporterGEXF.writeGraph(ExporterGEXF.java:251) at org.gephi.io.exporter.plugin.ExporterGEXF.execute(ExporterGEXF.java:213) at org.gephi.io.exporter.impl.ExportControllerImpl.exportFile(ExportControllerImpl.java:110) at org.gephi.io.exporter.impl.ExportControllerImpl.exportFile(ExportControllerImpl.java:67) The problem is raised at at the line: AttributeType staticType = TypeConvertor.getStaticType(col.getType()); When col.getType() return TimeInterval, which is not a type known by TypeConvertor.getStaticType(). But it seems the problem is inside ExporterGEXF.writeAttributes() with the predicate to add a dynamic column: if (exportDynamic && col.getType().isDynamicType() && col.getOrigin().equals(AttributeOrigin.PROPERTY) && col.getIndex() == PropertiesColumn.EDGE_WEIGHT.getIndex()) { dynamicCols.add(col); } "col.getIndex() == PropertiesColumn.EDGE_WEIGHT.getIndex()" is suspicious, as it is true for the node attribute encoding the TimeInterval. How to reproduce using the Toolkit: //Init a project - and therefore a workspace ProjectController pc = Lookup.getDefault().lookup(ProjectController.class); pc.newProject(); Workspace workspace = pc.getCurrentWorkspace(); //Get controllers and models ImportController importController = Lookup.getDefault().lookup(ImportController.class); //Import file Container container; try { File file = new File("1.csv"); container = importController.importFile(file); container.getLoader().setEdgeDefault(EdgeDefault.DIRECTED); //Force DIRECTED container.setAllowAutoNode(false); //Don't create missing nodes } catch (Exception ex) { ex.printStackTrace(); return; } //Initialize the DynamicProcessor - which will append the container to the workspace DynamicProcessor dynamicProcessor = new DynamicProcessor(); dynamicProcessor.setDateMode(false); //Set 'true' if you set real dates (ex: yyyy-mm-dd), it's double otherwise dynamicProcessor.setLabelmatching(false); //Set 'true' if node matching is done on labels instead of ids //Set date for this file dynamicProcessor.setDate("1"); //Process the container using the DynamicProcessor importController.process(container, dynamicProcessor, workspace); //Export full graph ExportController ec = Lookup.getDefault().lookup(ExportController.class); try { ec.exportFile(new File("io_gexf.gexf")); } catch (IOException ex) { ex.printStackTrace(); return; }
2010-12-07 10:42:56 Sébastien Heymann tags export
2010-12-07 12:37:16 Sébastien Heymann gephi: assignee Cezary Bartosiak (cezary-bartosiak) Sébastien Heymann (sebastien.heymann)
2010-12-07 12:37:23 Sébastien Heymann gephi: status New Fix Committed
2010-12-07 12:37:35 Sébastien Heymann gephi/toolkit: status New Fix Committed
2011-04-13 09:25:15 Sébastien Heymann gephi: status Fix Committed Fix Released
2011-04-13 09:25:17 Sébastien Heymann gephi/toolkit: status Fix Committed Fix Released