Program: 142917
Project: 142917
Buggy source:
@Override public JMenuItem getMenuPresenter(){
  JMenu menu=new JMenu(NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str"));
  String localImportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem localImport=new JMenuItem(new AbstractAction(localImportMessage){
    public void actionPerformed(    ActionEvent e){
      JFileChooser fileChooser=new JFileChooser();
      String localImportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      fileChooser.setDialogTitle(localImportDialogTitle);
      Neo4jCustomDirectoryProvider.setEnabled(true);
      fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      int dialogResult=fileChooser.showOpenDialog(null);
      if (dialogResult == JFileChooser.CANCEL_OPTION)       return;
      final File neo4jDirectory=fileChooser.getSelectedFile();
      if (graphDB != null)       graphDB.shutdown();
      graphDB=Neo4jUtils.localDatabase(neo4jDirectory);
      String traversalDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      final TraversalPanel traversalPanel=new TraversalPanel(graphDB);
      ValidationPanel validationPanel=traversalPanel.createValidationPanel();
      if (validationPanel.showOkCancelDialog(traversalDialogTitle)) {
        if (dialogResult == JFileChooser.APPROVE_OPTION) {
          final Neo4jImporter neo4jImporter=Lookup.getDefault().lookup(Neo4jImporter.class);
          LongTaskExecutor executor=new LongTaskExecutor(true);
          executor.execute((LongTask)neo4jImporter,new Runnable(){
            @Override public void run(){
              neo4jImporter.importDatabase(graphDB,traversalPanel.getStartNodeId(),traversalPanel.getOrder(),traversalPanel.getMaxDepth(),traversalPanel.getRelationshipInfos());
            }
          }
);
        }
      }
      Neo4jCustomDirectoryProvider.setEnabled(false);
    }
  }
);
  String localExportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem localExport=new JMenuItem(new AbstractAction(localExportMessage){
    public void actionPerformed(    ActionEvent e){
      JFileChooser fileChooser=new JFileChooser();
      String localExportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      fileChooser.setDialogTitle(localExportDialogTitle);
      fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      int dialogResult=fileChooser.showOpenDialog(null);
      if (dialogResult == JFileChooser.APPROVE_OPTION) {
        final File neo4jDirectory=fileChooser.getSelectedFile();
        final Neo4jExporter neo4jExporter=Lookup.getDefault().lookup(Neo4jExporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jExporter,new Runnable(){
          @Override public void run(){
            neo4jExporter.exportLocal(neo4jDirectory);
          }
        }
);
      }
    }
  }
);
  String remoteImportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem remoteImport=new JMenuItem(new AbstractAction(remoteImportMessage){
    public void actionPerformed(    ActionEvent e){
      final RemoteDatabasePanel databasePanel=new RemoteDatabasePanel();
      final ValidationPanel validationPanel=RemoteDatabasePanel.createValidationPanel(databasePanel);
      String remoteImportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      if (validationPanel.showOkCancelDialog(remoteImportDialogTitle)) {
        final Neo4jImporter neo4jImporter=Lookup.getDefault().lookup(Neo4jImporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jImporter,new Runnable(){
          @Override public void run(){
            if (graphDB != null)             graphDB.shutdown();
            graphDB=Neo4jUtils.remoteDatabase(databasePanel.getRemoteUrl(),databasePanel.getLogin(),databasePanel.getPassword());
            neo4jImporter.importDatabase(graphDB);
          }
        }
);
      }
    }
  }
);
  String remoteExportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem remoteExport=new JMenuItem(new AbstractAction(remoteExportMessage){
    public void actionPerformed(    ActionEvent e){
      final RemoteDatabasePanel databasePanel=new RemoteDatabasePanel();
      final ValidationPanel validationPanel=RemoteDatabasePanel.createValidationPanel(databasePanel);
      String remoteExportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      if (validationPanel.showOkCancelDialog(remoteExportDialogTitle)) {
        final Neo4jExporter neo4jExporter=Lookup.getDefault().lookup(Neo4jExporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jExporter,new Runnable(){
          @Override public void run(){
            neo4jExporter.exportRemote(databasePanel.getRemoteUrl(),databasePanel.getLogin(),databasePanel.getPassword());
          }
        }
);
      }
    }
  }
);
  menu.add(localImport);
  menu.add(remoteImport);
  menu.add(localExport);
  menu.add(remoteExport);
  return menu;
}

Fixed version (ground truth):
@Override public JMenuItem getMenuPresenter(){
  JMenu menu=new JMenu(NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str"));
  String localImportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem localImport=new JMenuItem(new AbstractAction(localImportMessage){
    public void actionPerformed(    ActionEvent e){
      JFileChooser fileChooser=new JFileChooser();
      String localImportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      fileChooser.setDialogTitle(localImportDialogTitle);
      Neo4jCustomDirectoryProvider.setEnabled(true);
      fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      int dialogResult=fileChooser.showOpenDialog(null);
      Neo4jCustomDirectoryProvider.setEnabled(false);
      if (dialogResult == JFileChooser.CANCEL_OPTION)       return;
      final File neo4jDirectory=fileChooser.getSelectedFile();
      if (graphDB != null)       graphDB.shutdown();
      graphDB=Neo4jUtils.localDatabase(neo4jDirectory);
      String traversalDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      final TraversalPanel traversalPanel=new TraversalPanel(graphDB);
      ValidationPanel validationPanel=traversalPanel.createValidationPanel();
      if (validationPanel.showOkCancelDialog(traversalDialogTitle)) {
        if (dialogResult == JFileChooser.APPROVE_OPTION) {
          final Neo4jImporter neo4jImporter=Lookup.getDefault().lookup(Neo4jImporter.class);
          LongTaskExecutor executor=new LongTaskExecutor(true);
          executor.execute((LongTask)neo4jImporter,new Runnable(){
            @Override public void run(){
              neo4jImporter.importDatabase(graphDB,traversalPanel.getStartNodeId(),traversalPanel.getOrder(),traversalPanel.getMaxDepth(),traversalPanel.getRelationshipInfos());
            }
          }
);
        }
      }
    }
  }
);
  String localExportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem localExport=new JMenuItem(new AbstractAction(localExportMessage){
    public void actionPerformed(    ActionEvent e){
      JFileChooser fileChooser=new JFileChooser();
      String localExportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      fileChooser.setDialogTitle(localExportDialogTitle);
      fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      int dialogResult=fileChooser.showOpenDialog(null);
      if (dialogResult == JFileChooser.APPROVE_OPTION) {
        final File neo4jDirectory=fileChooser.getSelectedFile();
        final Neo4jExporter neo4jExporter=Lookup.getDefault().lookup(Neo4jExporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jExporter,new Runnable(){
          @Override public void run(){
            neo4jExporter.exportLocal(neo4jDirectory);
          }
        }
);
      }
    }
  }
);
  String remoteImportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem remoteImport=new JMenuItem(new AbstractAction(remoteImportMessage){
    public void actionPerformed(    ActionEvent e){
      final RemoteDatabasePanel databasePanel=new RemoteDatabasePanel();
      final ValidationPanel validationPanel=RemoteDatabasePanel.createValidationPanel(databasePanel);
      String remoteImportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      if (validationPanel.showOkCancelDialog(remoteImportDialogTitle)) {
        final Neo4jImporter neo4jImporter=Lookup.getDefault().lookup(Neo4jImporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jImporter,new Runnable(){
          @Override public void run(){
            if (graphDB != null)             graphDB.shutdown();
            graphDB=Neo4jUtils.remoteDatabase(databasePanel.getRemoteUrl(),databasePanel.getLogin(),databasePanel.getPassword());
            neo4jImporter.importDatabase(graphDB);
          }
        }
);
      }
    }
  }
);
  String remoteExportMessage=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
  JMenuItem remoteExport=new JMenuItem(new AbstractAction(remoteExportMessage){
    public void actionPerformed(    ActionEvent e){
      final RemoteDatabasePanel databasePanel=new RemoteDatabasePanel();
      final ValidationPanel validationPanel=RemoteDatabasePanel.createValidationPanel(databasePanel);
      String remoteExportDialogTitle=NbBundle.getMessage(Neo4jImportExportAction.class,"String_Node_Str");
      if (validationPanel.showOkCancelDialog(remoteExportDialogTitle)) {
        final Neo4jExporter neo4jExporter=Lookup.getDefault().lookup(Neo4jExporter.class);
        LongTaskExecutor executor=new LongTaskExecutor(true);
        executor.execute((LongTask)neo4jExporter,new Runnable(){
          @Override public void run(){
            neo4jExporter.exportRemote(databasePanel.getRemoteUrl(),databasePanel.getLogin(),databasePanel.getPassword());
          }
        }
);
      }
    }
  }
);
  menu.add(localImport);
  menu.add(remoteImport);
  menu.add(localExport);
  menu.add(remoteExport);
  return menu;
}