Program: 47489
Project: 47489
Buggy source:
/** 
 * @param repositoryFile
 */
public ImportDialog(RepositoryFile repositoryFile){
  super(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,true);
  final PopupPanel indefiniteProgress=new PopupPanel(false,true);
  DOM.setStyleAttribute(indefiniteProgress.getElement(),"String_Node_Str","String_Node_Str");
  Image waitImage=new Image("String_Node_Str");
  indefiniteProgress.add(waitImage);
  form=new FormPanel();
  form.addSubmitHandler(new SubmitHandler(){
    @Override public void onSubmit(    SubmitEvent se){
      okButton.setEnabled(false);
      cancelButton.setEnabled(false);
      indefiniteProgress.center();
    }
  }
);
  form.addSubmitCompleteHandler(new SubmitCompleteHandler(){
    @Override public void onSubmitComplete(    SubmitCompleteEvent sce){
      new RefreshRepositoryCommand().execute(false);
      indefiniteProgress.hide();
      okButton.setEnabled(false);
      cancelButton.setEnabled(true);
      ImportDialog.this.hide();
      String result=sce.getResults();
      if (result.length() > 5) {
        logWindow(result,Messages.getString("String_Node_Str"));
      }
 else {
        Window.alert(Messages.getString("String_Node_Str"));
      }
    }
  }
);
  VerticalPanel rootPanel=new VerticalPanel();
  VerticalPanel spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  rootPanel.add(spacer);
  Label fileLabel=new Label(Messages.getString("String_Node_Str") + "String_Node_Str");
  final TextBox importDir=new TextBox();
  rootPanel.add(fileLabel);
  okButton.setEnabled(false);
  final TextBox fileTextBox=new TextBox();
  fileTextBox.setHeight("String_Node_Str");
  fileTextBox.setEnabled(false);
  final FileUpload upload=new FileUpload();
  upload.setName("String_Node_Str");
  ChangeHandler fileUploadHandler=new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      fileTextBox.setText(upload.getFilename());
      if (!"String_Node_Str".equals(importDir.getValue())) {
        okButton.setEnabled(true);
      }
 else {
        okButton.setEnabled(false);
      }
    }
  }
;
  upload.addChangeHandler(fileUploadHandler);
  upload.setVisible(false);
  HorizontalPanel fileUploadPanel=new HorizontalPanel();
  fileUploadPanel.add(fileTextBox);
  fileUploadPanel.add(new HTML("String_Node_Str"));
  Button browseButton=new Button(Messages.getString("String_Node_Str") + "String_Node_Str");
  browseButton.setStyleName("String_Node_Str");
  fileUploadPanel.add(browseButton);
  browseButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      jsClickUpload(upload.getElement());
    }
  }
);
  rootPanel.add(fileUploadPanel);
  rootPanel.add(upload);
  final CheckBox applyAclPermissions=new CheckBox(Messages.getString("String_Node_Str"),true);
  applyAclPermissions.setName("String_Node_Str");
  applyAclPermissions.setValue(Boolean.TRUE);
  applyAclPermissions.setFormValue("String_Node_Str");
  applyAclPermissions.setEnabled(true);
  applyAclPermissions.setVisible(false);
  final CheckBox overwriteAclPermissions=new CheckBox(Messages.getString("String_Node_Str"),true);
  overwriteAclPermissions.setName("String_Node_Str");
  overwriteAclPermissions.setValue(Boolean.TRUE);
  overwriteAclPermissions.setFormValue("String_Node_Str");
  overwriteAclPermissions.setEnabled(true);
  overwriteAclPermissions.setVisible(false);
  rootPanel.add(applyAclPermissions);
  rootPanel.add(overwriteAclPermissions);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  rootPanel.add(spacer);
  DisclosurePanel disclosurePanel=new DisclosurePanel(Messages.getString("String_Node_Str"));
  disclosurePanel.getHeader().setStyleName("String_Node_Str");
  HorizontalPanel mainPanel=new HorizontalPanel();
  mainPanel.add(new HTML("String_Node_Str"));
  VerticalPanel disclosureContent=new VerticalPanel();
  HTML replaceLabel=new HTML(Messages.getString("String_Node_Str"));
  replaceLabel.setStyleName("String_Node_Str");
  disclosureContent.add(replaceLabel);
  final CustomListBox overwriteFile=new CustomListBox();
  overwriteFile.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  DefaultListItem replaceListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  replaceListItem.setValue("String_Node_Str");
  overwriteFile.addItem(replaceListItem);
  DefaultListItem doNotImportListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  doNotImportListItem.setValue("String_Node_Str");
  overwriteFile.addItem(doNotImportListItem);
  overwriteFile.setVisibleRowCount(1);
  disclosureContent.add(overwriteFile);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  HTML filePermissionsLabel=new HTML(Messages.getString("String_Node_Str"));
  filePermissionsLabel.setStyleName("String_Node_Str");
  disclosureContent.add(filePermissionsLabel);
  final CustomListBox filePermissionsDropDown=new CustomListBox();
  DefaultListItem usePermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  usePermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(usePermissionsListItem);
  DefaultListItem retainPermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  retainPermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(retainPermissionsListItem);
  DefaultListItem removePermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  removePermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(removePermissionsListItem);
  ChangeListener filePermissionsHandler=new ChangeListener(){
    @Override public void onChange(    Widget sender){
      String value=filePermissionsDropDown.getSelectedItem().getValue().toString();
      filePermissionsDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",value);
      applyAclPermissions.setValue(Boolean.TRUE);
      applyAclPermissions.setFormValue("String_Node_Str");
      overwriteAclPermissions.setFormValue(value);
      overwriteAclPermissions.setValue(Boolean.valueOf(value));
      if (value.equals("String_Node_Str")) {
        applyAclPermissions.setValue(Boolean.FALSE);
        applyAclPermissions.setFormValue("String_Node_Str");
      }
    }
  }
;
  filePermissionsDropDown.addChangeListener(filePermissionsHandler);
  filePermissionsDropDown.setVisibleRowCount(1);
  disclosureContent.add(filePermissionsDropDown);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  HTML fileOwnershipLabel=new HTML(Messages.getString("String_Node_Str"));
  fileOwnershipLabel.setStyleName("String_Node_Str");
  disclosureContent.add(fileOwnershipLabel);
  final CustomListBox retainOwnership=new CustomListBox();
  retainOwnership.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  retainOwnership.addChangeListener(new ChangeListener(){
    public void onChange(    Widget sender){
      retainOwnership.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",retainOwnership.getSelectedItem().getValue().toString());
    }
  }
);
  DefaultListItem keepOwnershipListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  keepOwnershipListItem.setValue("String_Node_Str");
  retainOwnership.addItem(keepOwnershipListItem);
  DefaultListItem assignOwnershipListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  assignOwnershipListItem.setValue("String_Node_Str");
  retainOwnership.addItem(assignOwnershipListItem);
  retainOwnership.setVisibleRowCount(1);
  disclosureContent.add(retainOwnership);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  ChangeListener overwriteFileHandler=new ChangeListener(){
    @Override public void onChange(    Widget sender){
      String value=overwriteFile.getSelectedItem().getValue().toString();
      overwriteFile.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",value);
      if (value.equals("String_Node_Str")) {
        filePermissionsDropDown.setSelectedIndex(1);
        filePermissionsDropDown.setEnabled(false);
        retainOwnership.setSelectedIndex(0);
        retainOwnership.setEnabled(false);
      }
      if (value.equals("String_Node_Str")) {
        filePermissionsDropDown.setEnabled(true);
        retainOwnership.setEnabled(true);
      }
    }
  }
;
  overwriteFile.addChangeListener(overwriteFileHandler);
  HTML loggingLabel=new HTML(Messages.getString("String_Node_Str"));
  loggingLabel.setStyleName("String_Node_Str");
  disclosureContent.add(loggingLabel);
  final CustomListBox loggingDropDown=new CustomListBox();
  loggingDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  loggingDropDown.addChangeListener(new ChangeListener(){
    public void onChange(    Widget sender){
      loggingDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",loggingDropDown.getSelectedItem().getValue().toString());
    }
  }
);
  DefaultListItem noneListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  noneListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(noneListItem);
  DefaultListItem shortListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  shortListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(shortListItem);
  DefaultListItem debugListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  debugListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(debugListItem);
  loggingDropDown.setVisibleRowCount(1);
  disclosureContent.add(loggingDropDown);
  mainPanel.add(disclosureContent);
  disclosurePanel.setContent(mainPanel);
  rootPanel.add(disclosurePanel);
  importDir.setName("String_Node_Str");
  importDir.setText(repositoryFile.getPath());
  importDir.setVisible(false);
  rootPanel.add(importDir);
  form.setEncoding(FormPanel.ENCODING_MULTIPART);
  form.setMethod(FormPanel.METHOD_POST);
  setFormAction();
  form.add(rootPanel);
  setContent(form);
}

Fixed version (ground truth):
/** 
 * @param repositoryFile
 */
public ImportDialog(RepositoryFile repositoryFile){
  super(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),false,true);
  final PopupPanel indefiniteProgress=new PopupPanel(false,true);
  DOM.setStyleAttribute(indefiniteProgress.getElement(),"String_Node_Str","String_Node_Str");
  Image waitImage=new Image("String_Node_Str");
  indefiniteProgress.add(waitImage);
  form=new FormPanel();
  form.addSubmitHandler(new SubmitHandler(){
    @Override public void onSubmit(    SubmitEvent se){
      okButton.setEnabled(false);
      cancelButton.setEnabled(false);
      indefiniteProgress.center();
    }
  }
);
  form.addSubmitCompleteHandler(new SubmitCompleteHandler(){
    @Override public void onSubmitComplete(    SubmitCompleteEvent sce){
      new RefreshRepositoryCommand().execute(false);
      indefiniteProgress.hide();
      okButton.setEnabled(false);
      cancelButton.setEnabled(true);
      ImportDialog.this.hide();
      String result=sce.getResults();
      if (result.length() > 5) {
        logWindow(result,Messages.getString("String_Node_Str"));
      }
 else {
        Window.alert(Messages.getString("String_Node_Str"));
      }
    }
  }
);
  VerticalPanel rootPanel=new VerticalPanel();
  VerticalPanel spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  rootPanel.add(spacer);
  Label fileLabel=new Label(Messages.getString("String_Node_Str") + "String_Node_Str");
  final TextBox importDir=new TextBox();
  rootPanel.add(fileLabel);
  okButton.setEnabled(false);
  final TextBox fileTextBox=new TextBox();
  fileTextBox.setHeight("String_Node_Str");
  fileTextBox.setEnabled(false);
  final FileUpload upload=new FileUpload();
  upload.setName("String_Node_Str");
  ChangeHandler fileUploadHandler=new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      fileTextBox.setText(upload.getFilename());
      if (!"String_Node_Str".equals(importDir.getValue())) {
        okButton.setEnabled(true);
      }
 else {
        okButton.setEnabled(false);
      }
    }
  }
;
  upload.addChangeHandler(fileUploadHandler);
  upload.setVisible(false);
  HorizontalPanel fileUploadPanel=new HorizontalPanel();
  fileUploadPanel.add(fileTextBox);
  fileUploadPanel.add(new HTML("String_Node_Str"));
  Button browseButton=new Button(Messages.getString("String_Node_Str") + "String_Node_Str");
  browseButton.setStyleName("String_Node_Str");
  fileUploadPanel.add(browseButton);
  browseButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      jsClickUpload(upload.getElement());
    }
  }
);
  rootPanel.add(fileUploadPanel);
  rootPanel.add(upload);
  final CheckBox applyAclPermissions=new CheckBox(Messages.getString("String_Node_Str"),true);
  applyAclPermissions.setName("String_Node_Str");
  applyAclPermissions.setValue(Boolean.TRUE);
  applyAclPermissions.setFormValue("String_Node_Str");
  applyAclPermissions.setEnabled(true);
  applyAclPermissions.setVisible(false);
  final CheckBox overwriteAclPermissions=new CheckBox(Messages.getString("String_Node_Str"),true);
  overwriteAclPermissions.setName("String_Node_Str");
  overwriteAclPermissions.setValue(Boolean.FALSE);
  overwriteAclPermissions.setFormValue("String_Node_Str");
  overwriteAclPermissions.setEnabled(true);
  overwriteAclPermissions.setVisible(false);
  rootPanel.add(applyAclPermissions);
  rootPanel.add(overwriteAclPermissions);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  rootPanel.add(spacer);
  DisclosurePanel disclosurePanel=new DisclosurePanel(Messages.getString("String_Node_Str"));
  disclosurePanel.getHeader().setStyleName("String_Node_Str");
  HorizontalPanel mainPanel=new HorizontalPanel();
  mainPanel.add(new HTML("String_Node_Str"));
  VerticalPanel disclosureContent=new VerticalPanel();
  HTML replaceLabel=new HTML(Messages.getString("String_Node_Str"));
  replaceLabel.setStyleName("String_Node_Str");
  disclosureContent.add(replaceLabel);
  final CustomListBox overwriteFile=new CustomListBox();
  overwriteFile.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  DefaultListItem replaceListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  replaceListItem.setValue("String_Node_Str");
  overwriteFile.addItem(replaceListItem);
  DefaultListItem doNotImportListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  doNotImportListItem.setValue("String_Node_Str");
  overwriteFile.addItem(doNotImportListItem);
  overwriteFile.setVisibleRowCount(1);
  disclosureContent.add(overwriteFile);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  HTML filePermissionsLabel=new HTML(Messages.getString("String_Node_Str"));
  filePermissionsLabel.setStyleName("String_Node_Str");
  disclosureContent.add(filePermissionsLabel);
  final CustomListBox filePermissionsDropDown=new CustomListBox();
  DefaultListItem usePermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  usePermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(usePermissionsListItem);
  DefaultListItem retainPermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  retainPermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(retainPermissionsListItem);
  DefaultListItem removePermissionsListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  removePermissionsListItem.setValue("String_Node_Str");
  filePermissionsDropDown.addItem(removePermissionsListItem);
  ChangeListener filePermissionsHandler=new ChangeListener(){
    @Override public void onChange(    Widget sender){
      String value=filePermissionsDropDown.getSelectedItem().getValue().toString();
      filePermissionsDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",value);
      applyAclPermissions.setValue(Boolean.TRUE);
      applyAclPermissions.setFormValue("String_Node_Str");
      overwriteAclPermissions.setFormValue(value);
      overwriteAclPermissions.setValue(Boolean.valueOf(value));
      if (value.equals("String_Node_Str")) {
        applyAclPermissions.setValue(Boolean.FALSE);
        applyAclPermissions.setFormValue("String_Node_Str");
        overwriteAclPermissions.setValue(Boolean.FALSE);
        overwriteAclPermissions.setFormValue("String_Node_Str");
      }
    }
  }
;
  filePermissionsDropDown.addChangeListener(filePermissionsHandler);
  filePermissionsDropDown.setVisibleRowCount(1);
  disclosureContent.add(filePermissionsDropDown);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  HTML fileOwnershipLabel=new HTML(Messages.getString("String_Node_Str"));
  fileOwnershipLabel.setStyleName("String_Node_Str");
  disclosureContent.add(fileOwnershipLabel);
  final CustomListBox retainOwnership=new CustomListBox();
  retainOwnership.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  retainOwnership.addChangeListener(new ChangeListener(){
    public void onChange(    Widget sender){
      retainOwnership.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",retainOwnership.getSelectedItem().getValue().toString());
    }
  }
);
  DefaultListItem keepOwnershipListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  keepOwnershipListItem.setValue("String_Node_Str");
  retainOwnership.addItem(keepOwnershipListItem);
  DefaultListItem assignOwnershipListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  assignOwnershipListItem.setValue("String_Node_Str");
  retainOwnership.addItem(assignOwnershipListItem);
  retainOwnership.setVisibleRowCount(1);
  disclosureContent.add(retainOwnership);
  spacer=new VerticalPanel();
  spacer.setHeight("String_Node_Str");
  disclosureContent.add(spacer);
  ChangeListener overwriteFileHandler=new ChangeListener(){
    @Override public void onChange(    Widget sender){
      String value=overwriteFile.getSelectedItem().getValue().toString();
      overwriteFile.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",value);
      if (value.equals("String_Node_Str")) {
        filePermissionsDropDown.setSelectedIndex(1);
        filePermissionsDropDown.setEnabled(false);
        retainOwnership.setSelectedIndex(0);
        retainOwnership.setEnabled(false);
      }
      if (value.equals("String_Node_Str")) {
        filePermissionsDropDown.setEnabled(true);
        retainOwnership.setEnabled(true);
      }
    }
  }
;
  overwriteFile.addChangeListener(overwriteFileHandler);
  HTML loggingLabel=new HTML(Messages.getString("String_Node_Str"));
  loggingLabel.setStyleName("String_Node_Str");
  disclosureContent.add(loggingLabel);
  final CustomListBox loggingDropDown=new CustomListBox();
  loggingDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str","String_Node_Str");
  loggingDropDown.addChangeListener(new ChangeListener(){
    public void onChange(    Widget sender){
      loggingDropDown.getElement().getElementsByTagName("String_Node_Str").getItem(0).setPropertyString("String_Node_Str",loggingDropDown.getSelectedItem().getValue().toString());
    }
  }
);
  DefaultListItem noneListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  noneListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(noneListItem);
  DefaultListItem shortListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  shortListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(shortListItem);
  DefaultListItem debugListItem=new DefaultListItem(Messages.getString("String_Node_Str"));
  debugListItem.setValue("String_Node_Str");
  loggingDropDown.addItem(debugListItem);
  loggingDropDown.setVisibleRowCount(1);
  disclosureContent.add(loggingDropDown);
  mainPanel.add(disclosureContent);
  disclosurePanel.setContent(mainPanel);
  rootPanel.add(disclosurePanel);
  importDir.setName("String_Node_Str");
  importDir.setText(repositoryFile.getPath());
  importDir.setVisible(false);
  rootPanel.add(importDir);
  form.setEncoding(FormPanel.ENCODING_MULTIPART);
  form.setMethod(FormPanel.METHOD_POST);
  setFormAction();
  form.add(rootPanel);
  setContent(form);
}