Program: 188729
Project: 188729
Buggy source:
/** 
 * Create a new user data panel
 * @param visible
 * @param editmode
 * @param enableGroupSelect
 * @param enablePermissions
 */
public UserDataPanel(boolean visible,boolean editmode,boolean enableGroupSelect,boolean enablePermissions){
  password=new PasswordPanel(editmode);
  MultiWordSuggestOracle nationalityOracle=new MultiWordSuggestOracle();
  List<String> nationalityList=Arrays.asList(constants.nationalityList());
  nationalityOracle.addAll(nationalityList);
  nationality=new SuggestBox(nationalityOracle);
  MultiWordSuggestOracle countryOracle=new MultiWordSuggestOracle();
  List<String> countryList=Arrays.asList(constants.countryList());
  countryOracle.addAll(countryList);
  country=new SuggestBox(countryOracle);
  groupSelect=new GroupSelect(enableGroupSelect);
  initWidget(uiBinder.createAndBindUi(this));
  this.editmode=editmode;
  super.setVisible(visible);
  this.enableGroupSelect=enableGroupSelect;
  groupSelectPanel.setVisible(enableGroupSelect);
  permissionsSelectPanel.setVisible(enablePermissions);
  businessCategory.setVisibleItemCount(1);
  for (  String function : constants.getJobFunctions()) {
    businessCategory.addItem(function);
  }
  idType.setVisibleItemCount(1);
  for (  String type : User.ID_TYPES) {
    String typeText;
    try {
      typeText=constants.getString("String_Node_Str" + type);
    }
 catch (    MissingResourceException e) {
      typeText=type;
    }
    idType.addItem(typeText,type);
  }
  DefaultFormat dateFormat=new DateBox.DefaultFormat(DateTimeFormat.getFormat("String_Node_Str"));
  idDate.setFormat(dateFormat);
  idDate.getDatePicker().setYearArrowsVisible(true);
  idDate.setFireNullValues(true);
  ValueChangeHandler<String> valueChangedHandler=new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      onChange();
    }
  }
;
  ChangeHandler changeHandler=new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      UserDataPanel.this.onChange();
    }
  }
;
  SelectionHandler<Suggestion> selectionHandler=new SelectionHandler<Suggestion>(){
    @Override public void onSelection(    SelectionEvent<Suggestion> event){
      onChange();
    }
  }
;
  KeyUpHandler keyUpHandler=new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      onChange();
    }
  }
;
  username.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    KeyPressEvent event){
      char keyCode=event.getCharCode();
      if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_BACKSPACE) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
        ((TextBox)event.getSource()).cancelKey();
      }
    }
  }
);
  username.addChangeHandler(changeHandler);
  username.addKeyUpHandler(keyUpHandler);
  password.addValueChangeHandler(valueChangedHandler);
  fullname.addChangeHandler(changeHandler);
  fullname.addKeyUpHandler(keyUpHandler);
  businessCategory.addChangeHandler(changeHandler);
  idType.addChangeHandler(changeHandler);
  idNumber.addChangeHandler(changeHandler);
  idNumber.addKeyUpHandler(keyUpHandler);
  idDate.addValueChangeHandler(new ValueChangeHandler<Date>(){
    @Override public void onValueChange(    ValueChangeEvent<Date> event){
      onChange();
    }
  }
);
  idLocality.addChangeHandler(changeHandler);
  idLocality.addKeyUpHandler(keyUpHandler);
  nationality.addValueChangeHandler(valueChangedHandler);
  nationality.addSelectionHandler(selectionHandler);
  nationality.addKeyUpHandler(keyUpHandler);
  nif.addChangeHandler(changeHandler);
  email.addChangeHandler(changeHandler);
  email.addKeyUpHandler(keyUpHandler);
  postalAddress.addChangeHandler(changeHandler);
  postalCode.addChangeHandler(changeHandler);
  locality.addChangeHandler(changeHandler);
  country.addValueChangeHandler(valueChangedHandler);
  country.addSelectionHandler(selectionHandler);
  country.addKeyUpHandler(keyUpHandler);
  phoneNumber.addChangeHandler(changeHandler);
  fax.addChangeHandler(changeHandler);
  permissionsPanel.addValueChangeHandler(new ValueChangeHandler<List<String>>(){
    @Override public void onValueChange(    ValueChangeEvent<List<String>> event){
      onChange();
    }
  }
);
  groupSelect.addValueChangeHandler(new ValueChangeHandler<List<Group>>(){
    @Override public void onValueChange(    ValueChangeEvent<List<Group>> event){
      updatePermissions(event.getValue());
      onChange();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create a new user data panel
 * @param visible
 * @param editmode
 * @param enableGroupSelect
 * @param enablePermissions
 */
public UserDataPanel(boolean visible,boolean editmode,boolean enableGroupSelect,boolean enablePermissions){
  password=new PasswordPanel(editmode);
  MultiWordSuggestOracle nationalityOracle=new MultiWordSuggestOracle();
  List<String> nationalityList=Arrays.asList(constants.nationalityList());
  nationalityOracle.addAll(nationalityList);
  nationality=new SuggestBox(nationalityOracle);
  MultiWordSuggestOracle countryOracle=new MultiWordSuggestOracle();
  List<String> countryList=Arrays.asList(constants.countryList());
  countryOracle.addAll(countryList);
  country=new SuggestBox(countryOracle);
  groupSelect=new GroupSelect(enableGroupSelect);
  initWidget(uiBinder.createAndBindUi(this));
  this.editmode=editmode;
  super.setVisible(visible);
  this.enableGroupSelect=enableGroupSelect;
  groupSelectPanel.setVisible(enableGroupSelect);
  permissionsSelectPanel.setVisible(enablePermissions);
  businessCategory.setVisibleItemCount(1);
  for (  String function : constants.getJobFunctions()) {
    businessCategory.addItem(function);
  }
  idType.setVisibleItemCount(1);
  for (  String type : User.ID_TYPES) {
    String typeText;
    try {
      typeText=constants.getString("String_Node_Str" + type);
    }
 catch (    MissingResourceException e) {
      typeText=type;
    }
    idType.addItem(typeText,type);
  }
  DefaultFormat dateFormat=new DateBox.DefaultFormat(DateTimeFormat.getFormat("String_Node_Str"));
  idDate.setFormat(dateFormat);
  idDate.getDatePicker().setYearArrowsVisible(true);
  idDate.setFireNullValues(true);
  ValueChangeHandler<String> valueChangedHandler=new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      onChange();
    }
  }
;
  ChangeHandler changeHandler=new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      UserDataPanel.this.onChange();
    }
  }
;
  SelectionHandler<Suggestion> selectionHandler=new SelectionHandler<Suggestion>(){
    @Override public void onSelection(    SelectionEvent<Suggestion> event){
      onChange();
    }
  }
;
  KeyUpHandler keyUpHandler=new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      onChange();
    }
  }
;
  username.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    KeyPressEvent event){
      char keyCode=event.getCharCode();
      if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
        ((TextBox)event.getSource()).cancelKey();
      }
    }
  }
);
  username.addChangeHandler(changeHandler);
  username.addKeyUpHandler(keyUpHandler);
  password.addValueChangeHandler(valueChangedHandler);
  fullname.addChangeHandler(changeHandler);
  fullname.addKeyUpHandler(keyUpHandler);
  businessCategory.addChangeHandler(changeHandler);
  idType.addChangeHandler(changeHandler);
  idNumber.addChangeHandler(changeHandler);
  idNumber.addKeyUpHandler(keyUpHandler);
  idDate.addValueChangeHandler(new ValueChangeHandler<Date>(){
    @Override public void onValueChange(    ValueChangeEvent<Date> event){
      onChange();
    }
  }
);
  idLocality.addChangeHandler(changeHandler);
  idLocality.addKeyUpHandler(keyUpHandler);
  nationality.addValueChangeHandler(valueChangedHandler);
  nationality.addSelectionHandler(selectionHandler);
  nationality.addKeyUpHandler(keyUpHandler);
  nif.addChangeHandler(changeHandler);
  email.addChangeHandler(changeHandler);
  email.addKeyUpHandler(keyUpHandler);
  postalAddress.addChangeHandler(changeHandler);
  postalCode.addChangeHandler(changeHandler);
  locality.addChangeHandler(changeHandler);
  country.addValueChangeHandler(valueChangedHandler);
  country.addSelectionHandler(selectionHandler);
  country.addKeyUpHandler(keyUpHandler);
  phoneNumber.addChangeHandler(changeHandler);
  fax.addChangeHandler(changeHandler);
  permissionsPanel.addValueChangeHandler(new ValueChangeHandler<List<String>>(){
    @Override public void onValueChange(    ValueChangeEvent<List<String>> event){
      onChange();
    }
  }
);
  groupSelect.addValueChangeHandler(new ValueChangeHandler<List<Group>>(){
    @Override public void onValueChange(    ValueChangeEvent<List<Group>> event){
      updatePermissions(event.getValue());
      onChange();
    }
  }
);
}