Program: 190257
Project: 190257
Buggy source:
private PreviewSettingsTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  if (UIUtils.isAquaLookAndFeel()) {
    mainPanel.setBackground(UIManager.getColor("String_Node_Str"));
  }
  propertySheet=new PropertySheet();
  propertySheet.setNodes(new Node[]{new PreviewNode()});
  propertiesPanel.add(propertySheet,BorderLayout.CENTER);
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() != null) {
    refreshButton.setEnabled(true);
  }
  PreviewUIController.findInstance();
  ratioSlider.addChangeListener(new ChangeListener(){
    NumberFormat formatter=NumberFormat.getPercentInstance();
    public void stateChanged(    ChangeEvent e){
      float val=ratioSlider.getValue() / 100f;
      if (val == 0f) {
        ratioLabel.setText(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
      }
 else {
        ratioLabel.setText(formatter.format(val));
      }
    }
  }
);
  presetComboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      PreviewController pc=Lookup.getDefault().lookup(PreviewController.class);
      PreviewModel previewModel=pc.getModel();
      if (previewModel != null && presetComboBox.getSelectedItem() instanceof PreviewPreset) {
        if (previewModel.getCurrentPreset() != presetComboBox.getSelectedItem()) {
          pc.setCurrentPreset((PreviewPreset)presetComboBox.getSelectedItem());
          propertySheet.setNodes(new Node[]{new PreviewNode()});
        }
      }
    }
  }
);
  svgExportButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      VectorialFileExporterUI ui=Lookup.getDefault().lookup(VectorialFileExporterUI.class);
      ui.action();
    }
  }
);
  refreshModel();
}

Fixed version (ground truth):
private PreviewSettingsTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
  setIcon(ImageUtilities.loadImage(ICON_PATH));
  if (UIUtils.isAquaLookAndFeel()) {
    mainPanel.setBackground(UIManager.getColor("String_Node_Str"));
  }
  propertySheet=new PropertySheet();
  propertySheet.setNodes(new Node[]{new PreviewNode()});
  propertiesPanel.add(propertySheet,BorderLayout.CENTER);
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  if (pc.getCurrentWorkspace() != null) {
    enableRefreshButton();
  }
  PreviewUIController.findInstance();
  ratioSlider.addChangeListener(new ChangeListener(){
    NumberFormat formatter=NumberFormat.getPercentInstance();
    public void stateChanged(    ChangeEvent e){
      float val=ratioSlider.getValue() / 100f;
      if (val == 0f) {
        ratioLabel.setText(NbBundle.getMessage(PreviewSettingsTopComponent.class,"String_Node_Str"));
      }
 else {
        ratioLabel.setText(formatter.format(val));
      }
    }
  }
);
  presetComboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      PreviewController pc=Lookup.getDefault().lookup(PreviewController.class);
      PreviewModel previewModel=pc.getModel();
      if (previewModel != null && presetComboBox.getSelectedItem() instanceof PreviewPreset) {
        if (previewModel.getCurrentPreset() != presetComboBox.getSelectedItem()) {
          pc.setCurrentPreset((PreviewPreset)presetComboBox.getSelectedItem());
          propertySheet.setNodes(new Node[]{new PreviewNode()});
        }
      }
    }
  }
);
  svgExportButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      VectorialFileExporterUI ui=Lookup.getDefault().lookup(VectorialFileExporterUI.class);
      ui.action();
    }
  }
);
  refreshModel();
}