Program: 188370
Project: 188370
Buggy source:
public static void showPromptDialog(String title,String message,String placeHolder,final RegExp validator,String cancelButtonText,String confirmButtonText,final AsyncCallback<String> callback){
  final DialogBox dialogBox=new DialogBox(false,true);
  dialogBox.setText(title);
  final FlowPanel layout=new FlowPanel();
  if (message != null) {
    final Label messageLabel=new Label(message);
    layout.add(messageLabel);
    messageLabel.addStyleName("String_Node_Str");
  }
  final TextBox inputBox=new TextBox();
  inputBox.setTitle("String_Node_Str");
  if (placeHolder != null) {
    inputBox.getElement().setPropertyString("String_Node_Str",placeHolder);
  }
  final Button cancelButton=new Button(cancelButtonText);
  final Button confirmButton=new Button(confirmButtonText);
  layout.add(inputBox);
  layout.add(cancelButton);
  layout.add(confirmButton);
  dialogBox.setWidget(layout);
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(false);
  cancelButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      dialogBox.hide();
      callback.onFailure(null);
    }
  }
);
  confirmButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      dialogBox.hide();
      callback.onSuccess(inputBox.getText());
    }
  }
);
  inputBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      boolean isValid=validator.test(inputBox.getText());
      if (isValid) {
        inputBox.addStyleName("String_Node_Str");
      }
 else {
        inputBox.removeStyleName("String_Node_Str");
      }
    }
  }
);
  inputBox.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    KeyPressEvent event){
      boolean isValid=validator.test(inputBox.getText());
      confirmButton.setEnabled(isValid);
    }
  }
);
  inputBox.addKeyDownHandler(new KeyDownHandler(){
    @Override public void onKeyDown(    KeyDownEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        boolean isValid=validator.test(inputBox.getText());
        if (isValid) {
          dialogBox.hide();
          callback.onSuccess(inputBox.getText());
        }
      }
    }
  }
);
  confirmButton.setEnabled(validator.test(inputBox.getText()));
  dialogBox.addStyleName("String_Node_Str");
  layout.addStyleName("String_Node_Str");
  inputBox.addStyleName("String_Node_Str");
  cancelButton.addStyleName("String_Node_Str");
  confirmButton.addStyleName("String_Node_Str");
  dialogBox.center();
  dialogBox.show();
  inputBox.setFocus(true);
}

Fixed version (ground truth):
public static void showPromptDialog(String title,String message,String placeHolder,final RegExp validator,String cancelButtonText,String confirmButtonText,final AsyncCallback<String> callback){
  final DialogBox dialogBox=new DialogBox(false,true);
  dialogBox.setText(title);
  final FlowPanel layout=new FlowPanel();
  if (message != null) {
    final Label messageLabel=new Label(message);
    layout.add(messageLabel);
    messageLabel.addStyleName("String_Node_Str");
  }
  final TextBox inputBox=new TextBox();
  inputBox.setTitle("String_Node_Str");
  if (placeHolder != null) {
    inputBox.getElement().setPropertyString("String_Node_Str",placeHolder);
  }
  final Button cancelButton=new Button(cancelButtonText);
  final Button confirmButton=new Button(confirmButtonText);
  layout.add(inputBox);
  layout.add(cancelButton);
  layout.add(confirmButton);
  dialogBox.setWidget(layout);
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(false);
  cancelButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      dialogBox.hide();
      callback.onFailure(null);
    }
  }
);
  confirmButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      boolean isValid=validator.test(inputBox.getText());
      if (isValid) {
        dialogBox.hide();
        callback.onSuccess(inputBox.getText());
      }
    }
  }
);
  inputBox.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> event){
      boolean isValid=validator.test(event.getValue());
      confirmButton.setEnabled(isValid);
      if (isValid) {
        inputBox.removeStyleName("String_Node_Str");
      }
 else {
        inputBox.addStyleName("String_Node_Str");
      }
    }
  }
);
  inputBox.addKeyPressHandler(new KeyPressHandler(){
    @Override public void onKeyPress(    KeyPressEvent event){
      TextBox box=(TextBox)event.getSource();
      confirmButton.setEnabled(validator.test(box.getText()));
    }
  }
);
  inputBox.addKeyDownHandler(new KeyDownHandler(){
    @Override public void onKeyDown(    KeyDownEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        boolean isValid=validator.test(inputBox.getText());
        if (isValid) {
          dialogBox.hide();
          callback.onSuccess(inputBox.getText());
        }
      }
 else {
        TextBox box=(TextBox)event.getSource();
        confirmButton.setEnabled(validator.test(box.getText()));
      }
    }
  }
);
  inputBox.addKeyUpHandler(new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        boolean isValid=validator.test(inputBox.getText());
        if (isValid) {
          dialogBox.hide();
          callback.onSuccess(inputBox.getText());
        }
      }
 else {
        TextBox box=(TextBox)event.getSource();
        confirmButton.setEnabled(validator.test(box.getText()));
      }
    }
  }
);
  dialogBox.addStyleName("String_Node_Str");
  layout.addStyleName("String_Node_Str");
  inputBox.addStyleName("String_Node_Str");
  cancelButton.addStyleName("String_Node_Str");
  confirmButton.addStyleName("String_Node_Str");
  dialogBox.center();
  dialogBox.show();
  inputBox.setFocus(true);
}