Program: 188731
Project: 188731
Buggy source:
private BasicSearch(){
  facetDescriptionLevels=new FlowPanel();
  facetHasRepresentations=new FlowPanel();
  searchInputListBox=new Dropdown();
  searchAdvancedFieldOptions=new ListBox();
  initWidget(uiBinder.createAndBindUi(this));
  searchDescription.add(new HTMLWidgetWrapper("String_Node_Str"));
  searchInputListBox.setLabel(messages.searchListBoxItems());
  searchInputListBox.addItem(messages.searchListBoxItems(),RodaConstants.SEARCH_LIST_BOX_ITEMS);
  searchInputListBox.addItem(messages.searchListBoxRepresentations(),RodaConstants.SEARCH_LIST_BOX_REPRESENTATIONS);
  searchInputListBox.addItem(messages.searchListBoxFiles(),RodaConstants.SEARCH_LIST_BOX_FILES);
  searchInputListBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      if (searchInputListBox.getSelectedValue().equals(RodaConstants.SEARCH_LIST_BOX_ITEMS)) {
        showSearchAdvancedFieldsPanel();
      }
 else       if (searchInputListBox.getSelectedValue().equals(RodaConstants.SEARCH_LIST_BOX_REPRESENTATIONS)) {
        showRepresentationsSearchAdvancedFieldsPanel();
      }
 else {
        showFilesSearchAdvancedFieldsPanel();
      }
      doSearch();
    }
  }
);
  searchInputListBox.addPopupStyleName("String_Node_Str");
  searchInputBox.getElement().setPropertyString("String_Node_Str",messages.searchPlaceHolder());
  searchAdvancedPanel.setVisible(false);
  searchInputBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      doSearch();
    }
  }
);
  searchInputButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      doSearch();
    }
  }
);
  searchAdvancedDisclosureButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      showSearchAdvancedPanel();
    }
  }
);
  BrowserService.Util.getInstance().getSearchFields(LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<List<SearchField>>(){
    @Override public void onFailure(    Throwable caught){
      GWT.log("String_Node_Str",caught);
    }
    @Override public void onSuccess(    List<SearchField> searchFields){
      BasicSearch.this.searchFields.clear();
      for (      SearchField searchField : searchFields) {
        ListboxUtils.insertItemByAlphabeticOrder(searchAdvancedFieldOptions,searchField.getLabel(),searchField.getId());
        BasicSearch.this.searchFields.put(searchField.getId(),searchField);
      }
      for (      SearchField searchField : searchFields) {
        if (searchField.isFixed()) {
          SearchFieldPanel searchFieldPanel=new SearchFieldPanel();
          searchFieldPanel.setSearchAdvancedFields(searchAdvancedFieldOptions);
          searchFieldPanel.setSearchFields(BasicSearch.this.searchFields);
          addSearchFieldPanel(searchFieldPanel);
          searchFieldPanel.selectSearchField(searchField.getId());
        }
      }
    }
  }
);
  createRepresentationsSearchAdvancedFieldsPanel();
  createFilesSearchAdvancedFieldsPanel();
  showSearchAdvancedFieldsPanel();
}

Fixed version (ground truth):
private BasicSearch(){
  facetDescriptionLevels=new FlowPanel();
  facetHasRepresentations=new FlowPanel();
  facetFormats=new FlowPanel();
  facetPronoms=new FlowPanel();
  facetMimetypes=new FlowPanel();
  searchInputListBox=new Dropdown();
  searchAdvancedFieldOptions=new ListBox();
  initWidget(uiBinder.createAndBindUi(this));
  searchDescription.add(new HTMLWidgetWrapper("String_Node_Str"));
  searchInputListBox.setLabel(messages.searchListBoxItems());
  searchInputListBox.addItem(messages.searchListBoxItems(),RodaConstants.SEARCH_LIST_BOX_ITEMS);
  searchInputListBox.addItem(messages.searchListBoxRepresentations(),RodaConstants.SEARCH_LIST_BOX_REPRESENTATIONS);
  searchInputListBox.addItem(messages.searchListBoxFiles(),RodaConstants.SEARCH_LIST_BOX_FILES);
  searchInputListBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      if (searchInputListBox.getSelectedValue().equals(RodaConstants.SEARCH_LIST_BOX_ITEMS)) {
        showSearchAdvancedFieldsPanel();
      }
 else       if (searchInputListBox.getSelectedValue().equals(RodaConstants.SEARCH_LIST_BOX_REPRESENTATIONS)) {
        showRepresentationsSearchAdvancedFieldsPanel();
      }
 else {
        showFilesSearchAdvancedFieldsPanel();
      }
      doSearch();
    }
  }
);
  searchInputListBox.addPopupStyleName("String_Node_Str");
  searchInputBox.getElement().setPropertyString("String_Node_Str",messages.searchPlaceHolder());
  searchAdvancedPanel.setVisible(false);
  searchInputBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      doSearch();
    }
  }
);
  searchInputButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      doSearch();
    }
  }
);
  searchAdvancedDisclosureButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      showSearchAdvancedPanel();
    }
  }
);
  BrowserService.Util.getInstance().getSearchFields(LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<List<SearchField>>(){
    @Override public void onFailure(    Throwable caught){
      GWT.log("String_Node_Str",caught);
    }
    @Override public void onSuccess(    List<SearchField> searchFields){
      BasicSearch.this.searchFields.clear();
      for (      SearchField searchField : searchFields) {
        ListboxUtils.insertItemByAlphabeticOrder(searchAdvancedFieldOptions,searchField.getLabel(),searchField.getId());
        BasicSearch.this.searchFields.put(searchField.getId(),searchField);
      }
      for (      SearchField searchField : searchFields) {
        if (searchField.isFixed()) {
          SearchFieldPanel searchFieldPanel=new SearchFieldPanel();
          searchFieldPanel.setSearchAdvancedFields(searchAdvancedFieldOptions);
          searchFieldPanel.setSearchFields(BasicSearch.this.searchFields);
          addSearchFieldPanel(searchFieldPanel);
          searchFieldPanel.selectSearchField(searchField.getId());
        }
      }
    }
  }
);
  createRepresentationsSearchAdvancedFieldsPanel();
  createFilesSearchAdvancedFieldsPanel();
  showSearchAdvancedFieldsPanel();
}