Buggy code:
public class GraphPanel extends JPanel { private static final long serialVersionUID = - 8752440317807009185L ; private DirectedSparseGraph < MyVertex , Integer > tree ; private DelegateTree < MyVertex , Integer > td ; private VisualizationViewer < MyVertex , Integer > vv ; private final JPanel graph ; private final JList < PrimaryEvents > listPrimaryEvents ; private JPanel panel_1 ; private JPanel panel_2 ; private JPanel modePanel ; private JPanel scaleGrid ; private JPanel panel_3 ; private JButton btnDoLayout ; private JSeparator separator ; private JButton btnCalculate ; public GraphPanel ( ) { } private void populatePrimaryEvents ( ) { } private void createGraph ( ) { } double calculateTopProbability ( MyVertex v ) { } public void setGraph ( DirectedSparseGraph < MyVertex , Integer > g ) { } void saveAs ( ) { } void loadGraph ( ) { JFileChooser fileChooser = new JFileChooser ( ) ; <START_BUG> fileChooser . addChoosableFileFilter ( new FileNameExtensionFilter ( ".graphml" , "graph<seq2seq4repair_space>ml" ) ) ; <END_BUG> fileChooser . setDialogTitle ( "Specify<seq2seq4repair_space>a<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>open" ) ; if ( ( fileChooser . showOpenDialog ( this ) ) == ( JFileChooser . APPROVE_OPTION ) ) { BufferedReader fileReader ; try { fileReader = new BufferedReader ( new FileReader ( fileChooser . getSelectedFile ( ) ) ) ; } catch ( FileNotFoundException e1 ) { e1 . printStackTrace ( ) ; return ; } Event . clear ( ) ; Transformer < GraphMetadata , DelegateForest < MyVertex , Integer > > graphTransformer = new Transformer < GraphMetadata , DelegateForest < MyVertex , Integer > > ( ) { public DelegateForest < MyVertex , Integer > transform ( GraphMetadata metadata ) { if ( metadata . getEdgeDefault ( ) . equals ( metadata . getEdgeDefault ( ) . DIRECTED ) ) { DelegateForest < MyVertex , Integer > t = new DelegateForest < MyVertex , Integer > ( ) ; return t ; } else { return null ; } } } ; Transformer < NodeMetadata , MyVertex > vertexTransformer = new Transformer < NodeMetadata , MyVertex > ( ) { public MyVertex transform ( NodeMetadata metadata ) { MyVertex v = null ; if ( metadata . getProperty ( "type" ) . equals ( Event . class . getName ( ) ) ) { Event e = new Event ( Integer . parseInt ( metadata . getId ( ) ) , metadata . getProperty ( "name" ) ) ; e . setProbability ( Double . parseDouble ( metadata . getProperty ( "probability" ) ) ) ; e . setEvent ( PrimaryEvents . valueOf ( metadata . getProperty ( "subtype" ) ) ) ; e . setDescription ( metadata . getProperty ( "description" ) ) ; v = e ; } else if ( metadata . getProperty ( "type" ) . equals ( Gate . class . getName ( ) ) ) { v = new Gate ( Integer . parseInt ( metadata . getId ( ) ) , Gates . valueOf ( metadata . getProperty ( "subtype" ) ) , metadata . getProperty ( "name" ) ) ; } return v ; } } ; Transformer < EdgeMetadata , Integer > edgeTransformer = new Transformer < EdgeMetadata , Integer > ( ) { public Integer transform ( EdgeMetadata metadata ) { Integer e = MyEdgeFactory . getInstance ( ) . create ( ) ; return e ; } } ; Transformer < HyperEdgeMetadata , Integer > hyperEdgeTransformer = new Transformer < HyperEdgeMetadata , Integer > ( ) { public Integer transform ( HyperEdgeMetadata metadata ) { Integer e = MyEdgeFactory . getInstance ( ) . create ( ) ; return e ; } } ; Transformer < GraphMetadata , DirectedSparseGraph < MyVertex , Integer > > gTransformer = new Transformer < GraphMetadata , DirectedSparseGraph < MyVertex , Integer > > ( ) { public DirectedSparseGraph < MyVertex , Integer > transform ( GraphMetadata metadata ) { if ( metadata . getEdgeDefault ( ) . equals ( metadata . getEdgeDefault ( ) . DIRECTED ) ) { return new DirectedSparseGraph < MyVertex , Integer > ( ) ; } else { return null ; } } } ; GraphMLReader2 < DirectedSparseGraph < MyVertex , Integer > , MyVertex , Integer > graphReader = new GraphMLReader2 < DirectedSparseGraph < MyVertex , Integer > , MyVertex , Integer > ( fileReader , gTransformer , vertexTransformer , edgeTransformer , hyperEdgeTransformer ) ; try { tree = graphReader . readGraph ( ) ; td = new DelegateTree < MyVertex , Integer > ( tree ) ; td . setRoot ( Helper . getRoot ( tree ) ) ; TreeLayout < MyVertex , Integer > layout = new TreeLayout < MyVertex , Integer > ( td ) ; vv . setGraphLayout ( layout ) ; vv . getGraphLayout ( ) . initialize ( ) ; vv . repaint ( ) ; } catch ( GraphIOException ex ) { } } } }

Fix:
fileChooser . addChoosableFileFilter ( new FileNameExtensionFilter ( "GraphML<seq2seq4repair_space>Files" , "graphml" ) ) ;