nus-yam/ex-repair huggingface dataset:
Program: 78321
Project: 78321
Buggy source:
/** 
 * 获取当前用户信息
 * @param session
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public ServerResponse<User> getUserInfo(HttpSession session){
  User currentUser=(User)session.getAttribute(Const.CURRENT_USER);
  if (currentUser == null) {
    return ServerResponse.createByErorrCodeMessage(ResponseCode.NEED_LOGIN.getCode(),"String_Node_Str");
  }
  return iUserService.getUserInfo(currentUser.getId());
}

Fixed version (ground truth):
/** 
 * 获取当前用户信息
 * @param session
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public ServerResponse<User> getUserInfo(HttpSession session){
  User user=(User)session.getAttribute(Const.CURRENT_USER);
  if (user != null) {
    return ServerResponse.createBySuccess(user);
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78322
Project: 78322
Buggy source:
/** 
 * 登录用户重置密码
 * @param passwordOld
 * @param passwordNew
 * @param user
 * @return
 */
@Override public ServerResponse<String> resetPassword(String passwordOld,String passwordNew,User user){
  int resultCount=userMapper.selectOldPassword(user.getId(),passwordOld);
  if (resultCount == 0) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  user.setPassword(MD5Util.MD5EncodeUtf8(passwordNew));
  int updateCount=userMapper.updateByPrimaryKeySelective(user);
  if (updateCount > 0) {
    return ServerResponse.createBySuccessMessage("String_Node_Str");
  }
  return ServerResponse.createByErorrMessage("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 登录用户重置密码
 * @param passwordOld
 * @param passwordNew
 * @param user
 * @return
 */
@Override public ServerResponse<String> resetPassword(String passwordOld,String passwordNew,User user){
  int resultCount=userMapper.selectOldPassword(user.getId(),MD5Util.MD5EncodeUtf8(passwordOld));
  if (resultCount == 0) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  user.setPassword(MD5Util.MD5EncodeUtf8(passwordNew));
  int updateCount=userMapper.updateByPrimaryKeySelective(user);
  if (updateCount > 0) {
    return ServerResponse.createBySuccessMessage("String_Node_Str");
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78323
Project: 78323
Buggy source:
/** 
 * 更新用户信息
 * @param user
 * @return
 */
@Override public ServerResponse updateUserInfo(User user){
  int resultCount=userMapper.checkEmailByUserId(user.getId(),user.getEmail());
  if (resultCount > 0) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  User updateUser=new User();
  updateUser.setId(user.getId());
  updateUser.setEmail(user.getEmail());
  updateUser.setPhone(user.getPhone());
  updateUser.setQuestion(user.getQuestion());
  updateUser.setAnswer(user.getAnswer());
  int updateCount=userMapper.updateByPrimaryKeySelective(updateUser);
  if (updateCount > 0) {
    return ServerResponse.createBySuccessMessage("String_Node_Str");
  }
  return ServerResponse.createByErorrMessage("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 更新用户信息
 * @param user
 * @return
 */
@Override public ServerResponse updateUserInfo(User user){
  int resultCount=userMapper.checkEmailByUserId(user.getId(),user.getEmail());
  if (resultCount > 0) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  User updateUser=new User();
  updateUser.setId(user.getId());
  updateUser.setEmail(user.getEmail());
  updateUser.setPhone(user.getPhone());
  updateUser.setQuestion(user.getQuestion());
  updateUser.setAnswer(user.getAnswer());
  int updateCount=userMapper.updateByPrimaryKeySelective(updateUser);
  if (updateCount > 0) {
    return ServerResponse.createBySuccessMessage("String_Node_Str");
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78324
Project: 78324
Buggy source:
/** 
 * 验证用户名和密码
 * @param str
 * @param type
 * @return
 */
@Override public ServerResponse<String> checkValid(String str,String type){
  if (StringUtils.isNotBlank(type)) {
    if (Const.USERNAME.equals(type)) {
      int userCount=userMapper.checkUserName(str);
      if (userCount > 0) {
        return ServerResponse.createByErorrMessage("String_Node_Str");
      }
    }
    if (Const.EMAIL.equals(type)) {
      int emailCount=userMapper.checkEmail(str);
      if (emailCount > 0) {
        return ServerResponse.createByErorrMessage("String_Node_Str");
      }
    }
  }
 else {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  return ServerResponse.createBySuccessMessage("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 验证用户名和密码
 * @param str
 * @param type
 * @return
 */
@Override public ServerResponse<String> checkValid(String str,String type){
  if (StringUtils.isNotBlank(type)) {
    if (Const.USERNAME.equals(type)) {
      int userCount=userMapper.checkUserName(str);
      if (userCount > 0) {
        return ServerResponse.createByErrorMessage("String_Node_Str");
      }
    }
    if (Const.EMAIL.equals(type)) {
      int emailCount=userMapper.checkEmail(str);
      if (emailCount > 0) {
        return ServerResponse.createByErrorMessage("String_Node_Str");
      }
    }
  }
 else {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  return ServerResponse.createBySuccessMessage("String_Node_Str");
}
Program: 78325
Project: 78325
Buggy source:
/** 
 * 重置密码：检验token是否有效，重置新密码
 * @param username
 * @param passwordNew
 * @param forgetToken
 * @return
 */
@Override public ServerResponse<String> forgetResetPassword(String username,String passwordNew,String forgetToken){
  if (StringUtils.isBlank(forgetToken)) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  ServerResponse<String> valid=this.checkValid(username,Const.USERNAME);
  if (valid.isSuccess()) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  String token=TokenCache.getValue(TokenCache.TOKEN_PREFIX + username);
  if (StringUtils.isBlank(token)) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  if (StringUtils.equals(token,forgetToken)) {
    String md5Password=MD5Util.MD5EncodeUtf8(passwordNew);
    int updateCount=userMapper.updatePasswordByUsername(username,md5Password);
    if (updateCount > 0) {
      return ServerResponse.createBySuccessMessage("String_Node_Str");
    }
  }
 else {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  return ServerResponse.createByErorrMessage("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 重置密码：检验token是否有效，重置新密码
 * @param username
 * @param passwordNew
 * @param forgetToken
 * @return
 */
@Override public ServerResponse<String> forgetResetPassword(String username,String passwordNew,String forgetToken){
  if (StringUtils.isBlank(forgetToken)) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  ServerResponse<String> valid=this.checkValid(username,Const.USERNAME);
  if (valid.isSuccess()) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  String token=TokenCache.getValue(TokenCache.TOKEN_PREFIX + username);
  if (StringUtils.isBlank(token)) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  if (StringUtils.equals(token,forgetToken)) {
    String md5Password=MD5Util.MD5EncodeUtf8(passwordNew);
    int updateCount=userMapper.updatePasswordByUsername(username,md5Password);
    if (updateCount > 0) {
      return ServerResponse.createBySuccessMessage("String_Node_Str");
    }
  }
 else {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78326
Project: 78326
Buggy source:
@Override public ServerResponse<String> forgetGetQuestion(String username){
  ServerResponse<String> valid=this.checkValid(username,Const.USERNAME);
  if (valid.isSuccess()) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  String question=userMapper.selectForgetQuestion(username);
  if (StringUtils.isNotBlank(question)) {
    return ServerResponse.createBySuccess(question);
  }
  return ServerResponse.createByErorrMessage("String_Node_Str");
}

Fixed version (ground truth):
@Override public ServerResponse<String> forgetGetQuestion(String username){
  ServerResponse<String> valid=this.checkValid(username,Const.USERNAME);
  if (valid.isSuccess()) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  String question=userMapper.selectForgetQuestion(username);
  if (StringUtils.isNotBlank(question)) {
    return ServerResponse.createBySuccess(question);
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78327
Project: 78327
Buggy source:
@Override public ServerResponse<User> login(String username,String password){
  int userCount=userMapper.checkUserName(username);
  if (userCount == 0) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  String md5Password=MD5Util.MD5EncodeUtf8(password);
  User user=userMapper.selecLogin(username,md5Password);
  if (user == null) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  user.setPassword(StringUtils.EMPTY);
  return ServerResponse.createBySuccess(user);
}

Fixed version (ground truth):
@Override public ServerResponse<User> login(String username,String password){
  int userCount=userMapper.checkUserName(username);
  if (userCount == 0) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  String md5Password=MD5Util.MD5EncodeUtf8(password);
  User user=userMapper.selecLogin(username,md5Password);
  if (user == null) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  user.setPassword(StringUtils.EMPTY);
  user.setQuestion(StringUtils.EMPTY);
  user.setAnswer(StringUtils.EMPTY);
  return ServerResponse.createBySuccess(user);
}
Program: 78328
Project: 78328
Buggy source:
/** 
 * 获取用户信息---注意用户密码不能返回
 * @param userId
 * @return
 */
@Override public ServerResponse<User> getUserInfo(Integer userId){
  User user=userMapper.selectByPrimaryKey(userId);
  if (user == null) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  user.setPassword(StringUtils.EMPTY);
  return ServerResponse.createBySuccess(user);
}

Fixed version (ground truth):
/** 
 * 获取用户信息---注意用户密码不能返回
 * @param userId
 * @return
 */
@Override public ServerResponse<User> getUserInfo(Integer userId){
  User user=userMapper.selectByPrimaryKey(userId);
  if (user == null) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  user.setPassword(StringUtils.EMPTY);
  return ServerResponse.createBySuccess(user);
}
Program: 78329
Project: 78329
Buggy source:
@Override public ServerResponse<String> register(User user){
  ServerResponse<String> validResponse=checkValid(user.getUsername(),Const.USERNAME);
  if (!validResponse.isSuccess()) {
    return validResponse;
  }
  validResponse=checkValid(user.getEmail(),Const.EMAIL);
  if (!validResponse.isSuccess()) {
    return validResponse;
  }
  user.setPassword(MD5Util.MD5EncodeUtf8(user.getPassword()));
  user.setRole(Const.ROLE.NORMAL_USER);
  int userCount=userMapper.insert(user);
  if (userCount == 0) {
    return ServerResponse.createByErorrMessage("String_Node_Str");
  }
  return ServerResponse.createBySuccessMessage("String_Node_Str");
}

Fixed version (ground truth):
@Override public ServerResponse<String> register(User user){
  ServerResponse<String> validResponse=checkValid(user.getUsername(),Const.USERNAME);
  if (!validResponse.isSuccess()) {
    return validResponse;
  }
  validResponse=checkValid(user.getEmail(),Const.EMAIL);
  if (!validResponse.isSuccess()) {
    return validResponse;
  }
  user.setPassword(MD5Util.MD5EncodeUtf8(user.getPassword()));
  user.setRole(Const.ROLE.NORMAL_USER);
  int userCount=userMapper.insert(user);
  if (userCount == 0) {
    return ServerResponse.createByErrorMessage("String_Node_Str");
  }
  return ServerResponse.createBySuccessMessage("String_Node_Str");
}
Program: 78330
Project: 78330
Buggy source:
/** 
 * 忘记密码验证回答----使用本地缓存
 * @param username
 * @param question
 * @param answer
 * @return
 */
@Override public ServerResponse<String> checkQuestionAnswer(String username,String question,String answer){
  int resultCount=userMapper.selectQuestionAnswer(username,question,answer);
  if (resultCount > 0) {
    String checkToken=UUID.randomUUID().toString();
    TokenCache.setKey(TokenCache.TOKEN_PREFIX + username,checkToken);
    return ServerResponse.createBySuccess(checkToken);
  }
  return ServerResponse.createByErorrMessage("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 忘记密码验证回答----使用本地缓存
 * @param username
 * @param question
 * @param answer
 * @return
 */
@Override public ServerResponse<String> checkQuestionAnswer(String username,String question,String answer){
  int resultCount=userMapper.selectQuestionAnswer(username,question,answer);
  if (resultCount > 0) {
    String checkToken=UUID.randomUUID().toString();
    TokenCache.setKey(TokenCache.TOKEN_PREFIX + username,checkToken);
    return ServerResponse.createBySuccess(checkToken);
  }
  return ServerResponse.createByErrorMessage("String_Node_Str");
}
Program: 78331
Project: 78331
Buggy source:
public static String dateToStr(Date date){
  if (date == null) {
    return "String_Node_Str";
  }
  DateTime dateTime=new DateTime(date);
  return dateTime.toString(STANDARD_FORMAT_STR);
}

Fixed version (ground truth):
public static String dateToStr(Date date){
  return dateToStr(date,STANDARD_FORMAT_STR);
}
Program: 78332
Project: 78332
Buggy source:
public static Date strToDate(String dateStr){
  DateTimeFormatter dateTimeFormatter=DateTimeFormat.forPattern(STANDARD_FORMAT_STR);
  DateTime dateTime=dateTimeFormatter.parseDateTime(dateStr);
  return dateTime.toDate();
}

Fixed version (ground truth):
public static Date strToDate(String dateStr){
  return strToDate(dateStr,STANDARD_FORMAT_STR);
}
Program: 78334
Project: 78334
Buggy source:
public Node call() throws Exception {
  long startTime=System.currentTimeMillis();
  while ((System.currentTimeMillis() - startTime) < config.getLaunchTimeoutMillis()) {
    try {
      node.toComputer().connect(false).get();
    }
 catch (    Exception e) {
    }
    return node;
  }
  LOGGER.log(Level.WARNING,"String_Node_Str");
  return node;
}

Fixed version (ground truth):
public Node call() throws Exception {
  long startTime=System.currentTimeMillis();
  while ((System.currentTimeMillis() - startTime) < config.getLaunchTimeoutMillis()) {
    Computer c;
    try {
      c=node.toComputer();
      if (c != null) {
        c.connect(false).get();
      }
    }
 catch (    Exception e) {
    }
    return node;
  }
  LOGGER.log(Level.WARNING,"String_Node_Str");
  return node;
}
Program: 78336
Project: 78336
Buggy source:
private Instance _getInstance() throws IOException {
  ComputeEngineInstance node=getNode();
  ComputeEngineCloud cloud=getCloud();
  return cloud.client.getInstance(cloud.projectId,node.zone,node.getNodeName());
}

Fixed version (ground truth):
private Instance _getInstance() throws IOException {
  try {
    ComputeEngineInstance node=getNode();
    ComputeEngineCloud cloud=getCloud();
    if (node != null) {
      return cloud.client.getInstance(cloud.projectId,node.zone,node.getNodeName());
    }
 else {
      return null;
    }
  }
 catch (  CloudNotFoundException cnfe) {
    return null;
  }
}
Program: 78337
Project: 78337
Buggy source:
@DataBoundSetter public void setNumExecutorsStr(String value){
  Integer v=InstanceConfiguration.intOrDefault(value,InstanceConfiguration.DEFAULT_NUM_EXECUTORS);
  getNode().setNumExecutors(v);
}

Fixed version (ground truth):
@DataBoundSetter public void setNumExecutorsStr(String value){
  Integer v=InstanceConfiguration.intOrDefault(value,InstanceConfiguration.DEFAULT_NUM_EXECUTORS);
  ComputeEngineInstance node=getNode();
  if (node != null) {
    node.setNumExecutors(v);
  }
}
Program: 78338
Project: 78338
Buggy source:
/** 
 * When the slave is deleted, terminate the instance.
 */
@Override public HttpResponse doDoDelete() throws IOException {
  checkPermission(DELETE);
  if (getNode() != null) {
    try {
      getNode().terminate();
    }
 catch (    InterruptedException ie) {
    }
  }
  return new HttpRedirect("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * When the slave is deleted, terminate the instance.
 */
@Override public HttpResponse doDoDelete() throws IOException {
  checkPermission(DELETE);
  ComputeEngineInstance node=getNode();
  if (node != null) {
    try {
      node.terminate();
    }
 catch (    InterruptedException ie) {
    }
  }
  return new HttpRedirect("String_Node_Str");
}
Program: 78339
Project: 78339
Buggy source:
protected ComputeEngineCloud getCloud(){
  ComputeEngineInstance node=getNode();
  if (node == null)   return null;
  return node.getCloud();
}

Fixed version (ground truth):
protected ComputeEngineCloud getCloud() throws CloudNotFoundException {
  ComputeEngineInstance node=getNode();
  if (node == null)   throw new CloudNotFoundException("String_Node_Str");
  return node.getCloud();
}
Program: 78340
Project: 78340
Buggy source:
@Override protected void _terminate(TaskListener listener) throws IOException, InterruptedException {
  ComputeEngineCloud cloud=getCloud();
  if (cloud == null || cloud.client == null) {
    listener.error(String.format("String_Node_Str"));
    return;
  }
  cloud.client.terminateInstanceWithStatus(cloud.projectId,zone,name,"String_Node_Str");
}

Fixed version (ground truth):
@Override protected void _terminate(TaskListener listener) throws IOException, InterruptedException {
  try {
    ComputeEngineCloud cloud=getCloud();
    cloud.client.terminateInstanceWithStatus(cloud.projectId,zone,name,"String_Node_Str");
  }
 catch (  CloudNotFoundException cnfe) {
    listener.error(cnfe.getMessage());
    return;
  }
}
Program: 78341
Project: 78341
Buggy source:
public ComputeEngineCloud getCloud(){
  return (ComputeEngineCloud)Jenkins.getInstance().getCloud(cloudName);
}

Fixed version (ground truth):
public ComputeEngineCloud getCloud() throws CloudNotFoundException {
  ComputeEngineCloud cloud=(ComputeEngineCloud)Jenkins.getInstance().getCloud(cloudName);
  if (cloud == null)   throw new CloudNotFoundException(String.format("String_Node_Str",cloudName));
  return cloud;
}
Program: 78342
Project: 78342
Buggy source:
protected void logException(ComputeEngineComputer computer,TaskListener listener,String message,Throwable exception){
  ComputeEngineCloud cloud=computer.getCloud();
  if (cloud != null)   cloud.log(LOGGER,Level.WARNING,listener,message,exception);
}

Fixed version (ground truth):
protected void logException(ComputeEngineComputer computer,TaskListener listener,String message,Throwable exception){
  try {
    ComputeEngineCloud cloud=computer.getCloud();
    cloud.log(LOGGER,Level.WARNING,listener,message,exception);
  }
 catch (  CloudNotFoundException cnfe) {
  }
}
Program: 78344
Project: 78344
Buggy source:
protected void log(Level level,ComputeEngineComputer computer,TaskListener listener,String message){
  ComputeEngineCloud cloud=computer.getCloud();
  if (cloud != null)   cloud.log(LOGGER,level,listener,message);
}

Fixed version (ground truth):
protected void log(Level level,ComputeEngineComputer computer,TaskListener listener,String message){
  try {
    ComputeEngineCloud cloud=computer.getCloud();
    cloud.log(LOGGER,level,listener,message);
  }
 catch (  CloudNotFoundException cnfe) {
  }
}
Program: 78345
Project: 78345
Buggy source:
private GoogleKeyPair setupSshKeys(ComputeEngineComputer computer) throws Exception {
  ComputeEngineCloud cloud=computer.getCloud();
  ComputeClient client=cloud.client;
  ComputeEngineInstance instance=computer.getNode();
  GoogleKeyPair kp=GoogleKeyPair.generate();
  List<Metadata.Items> items=new ArrayList<>();
  items.add(new Metadata.Items().setKey(SSH_METADATA_KEY).setValue(kp.getPublicKey()));
  client.appendInstanceMetadata(cloud.projectId,instance.zone,instance.getNodeName(),items);
  return kp;
}

Fixed version (ground truth):
private GoogleKeyPair setupSshKeys(ComputeEngineComputer computer) throws CloudNotFoundException, IOException, InterruptedException {
  if (computer == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ComputeEngineInstance node=computer.getNode();
  if (node == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ComputeEngineCloud cloud=computer.getCloud();
  ComputeClient client=cloud.client;
  GoogleKeyPair kp=GoogleKeyPair.generate();
  List<Metadata.Items> items=new ArrayList<>();
  items.add(new Metadata.Items().setKey(SSH_METADATA_KEY).setValue(kp.getPublicKey()));
  client.appendInstanceMetadata(cloud.projectId,node.zone,node.getNodeName(),items);
  return kp;
}
Program: 78347
Project: 78347
Buggy source:
@Override public String getHelpFile(String fieldName){
  String p=super.getHelpFile(fieldName);
  if (p == null)   p=Jenkins.getInstance().getDescriptor(ComputeEngineInstance.class).getHelpFile(fieldName);
  return p;
}

Fixed version (ground truth):
@Override public String getHelpFile(String fieldName){
  String p=super.getHelpFile(fieldName);
  if (p == null) {
    Descriptor d=Jenkins.getInstance().getDescriptor(ComputeEngineInstance.class);
    if (d != null)     p=d.getHelpFile(fieldName);
  }
  return p;
}
Program: 78348
Project: 78348
Buggy source:
public static GoogleKeyPair generate() throws Exception {
  Map<String,String> keys=SshKeys.generate();
  return new GoogleKeyPair(keys.get("String_Node_Str"),keys.get("String_Node_Str"));
}

Fixed version (ground truth):
public static GoogleKeyPair generate(){
  Map<String,String> keys=SshKeys.generate();
  return new GoogleKeyPair(keys.get("String_Node_Str"),keys.get("String_Node_Str"));
}
Program: 78349
Project: 78349
Buggy source:
private void readResolve(){
  try {
    ClientFactory clientFactory=new ClientFactory(Jenkins.getInstance(),new ArrayList<DomainRequirement>(),credentialsId);
    this.client=clientFactory.compute();
  }
 catch (  IOException e) {
    this.client=null;
  }
  for (  InstanceConfiguration c : configurations) {
    c.cloud=this;
    c.appendLabels(REQUIRED_LABEL);
  }
}

Fixed version (ground truth):
protected Object readResolve(){
  try {
    ClientFactory clientFactory=new ClientFactory(Jenkins.getInstance(),new ArrayList<DomainRequirement>(),credentialsId);
    this.client=clientFactory.compute();
  }
 catch (  IOException e) {
    this.client=null;
  }
  for (  InstanceConfiguration c : configurations) {
    c.cloud=this;
    c.appendLabels(REQUIRED_LABEL);
  }
  return this;
}
Program: 78350
Project: 78350
Buggy source:
/** 
 * Update the state of the Assignment related to code.
 * @param code the code of the assignment.
 * @param state the new state of the assignment.
 * @return true if the update is successfully performed.
 */
public boolean updateAssignmentState(int code,Boolean state){
  DBConnector dbConnector=new DBConnector();
  String strState;
  if (state == null) {
    strState="String_Node_Str";
  }
 else {
    strState=state.toString().toUpperCase();
  }
  try {
    boolean isUpdated=dbConnector.updateDB("String_Node_Str" + strState + "String_Node_Str"+ code+ "String_Node_Str");
    dbConnector.closeUpdate();
    if (isUpdated) {
      System.out.println("String_Node_Str" + code + "String_Node_Str");
      if (state == null) {
        assignmentList.get(code).setState(null);
      }
 else {
        assignmentList.get(code).setState(state);
      }
      return true;
    }
 else {
      System.out.println("String_Node_Str" + code + "String_Node_Str");
      return false;
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Update the state of the Assignment related to code.
 * @param code the code of the assignment.
 * @param state the new state of the assignment.
 * @return true if the update is successfully performed.
 */
public boolean updateAssignmentState(int code,Boolean state){
  DBConnector dbConnector=new DBConnector();
  String strState;
  if (state == null) {
    strState="String_Node_Str";
  }
 else {
    strState=state.toString().toUpperCase();
  }
  try {
    boolean isUpdated=dbConnector.updateDB("String_Node_Str" + strState + "String_Node_Str"+ code+ "String_Node_Str");
    dbConnector.closeUpdate();
    if (isUpdated) {
      System.out.println("String_Node_Str" + code + "String_Node_Str");
      if (state == null) {
        assignmentList.get(code).setState(null);
      }
 else {
        assignmentList.get(code).setState(state);
        if (state == false) {
          if (!refundCustomer(code)) {
            return false;
          }
        }
      }
      return true;
    }
 else {
      System.out.println("String_Node_Str" + code + "String_Node_Str");
      return false;
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return false;
  }
}
Program: 78351
Project: 78351
Buggy source:
/** 
 * When the user presses the "Cancel" button the calendar come back into normal mode.
 */
public void cancel(){
  calendarState=CalendarState.NORMAL;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(204,230,255));
    buttonDay[i].setEnabled(true);
  }
  menuAssignment.setVisible(true);
  menuReview.setVisible(true);
  menuSettings.setVisible(true);
  menuExtra.setVisible(true);
  menuItemCancel.setVisible(false);
  if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
    showAssignmentsOnCalendar(email,proxy);
  }
}

Fixed version (ground truth):
/** 
 * When the user presses the "Cancel" button the calendar come back into normal mode.
 */
public void cancel(){
  calendarState=CalendarState.NORMAL;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(204,230,255));
    buttonDay[i].setEnabled(true);
  }
  menuAssignment.setVisible(true);
  menuReview.setVisible(true);
  menuSettings.setVisible(true);
  menuExtra.setVisible(true);
  menuItemCancel.setVisible(false);
  if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
    showAssignmentsOnCalendar(email,proxy);
  }
  beforeUpdateCalendar();
}
Program: 78352
Project: 78352
Buggy source:
/** 
 * Put the home screen into adding mode. The day's button become green and on the menu bar remain only "Canibau" and "Cancel items.
 */
public void newAssignment(){
  try {
    enableDisableDateButtonAssignment();
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  calendarState=CalendarState.ADDING;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(179,255,179));
  }
  menuAssignment.setVisible(false);
  menuReview.setVisible(false);
  menuSettings.setVisible(false);
  menuExtra.setVisible(false);
  menuItemCancel.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Put the home screen into adding mode. The day's button become green and on the menu bar remain only "Canibau" and "Cancel items.
 */
public void newAssignment(){
  try {
    enableDisableDateButtonAssignment();
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  calendarState=CalendarState.ADDING;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(179,255,179));
  }
  menuAssignment.setVisible(false);
  menuReview.setVisible(false);
  menuSettings.setVisible(false);
  menuExtra.setVisible(false);
  menuItemCancel.setVisible(true);
  beforeUpdateCalendar();
}
Program: 78353
Project: 78353
Buggy source:
/** 
 * Put the home screen into removing mode. The day's buttons become red and on the menu bar remain only "Canibau" and "Cancel items.
 */
public void removeAssignment(){
  try {
    enableDisableDateButtonAssignment();
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  calendarState=CalendarState.REMOVING;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(242,82,37));
  }
  menuAssignment.setVisible(false);
  menuReview.setVisible(false);
  menuSettings.setVisible(false);
  menuExtra.setVisible(false);
  menuItemCancel.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Put the home screen into removing mode. The day's buttons become red and on the menu bar remain only "Canibau" and "Cancel items.
 */
public void removeAssignment(){
  try {
    enableDisableDateButtonAssignment();
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  calendarState=CalendarState.REMOVING;
  int i;
  for (i=0; i < NDAYMONTH; i++) {
    buttonDay[i].setBackground(new Color(242,82,37));
  }
  menuAssignment.setVisible(false);
  menuReview.setVisible(false);
  menuSettings.setVisible(false);
  menuExtra.setVisible(false);
  menuItemCancel.setVisible(true);
  beforeUpdateCalendar();
}
Program: 78354
Project: 78354
Buggy source:
/** 
 * Create a new home for the customer specified by the email.
 * @param email the customer's email address.
 * @throws ParseException
 */
public GUICustomer(String email) throws ParseException {
  super(email);
  setTitle("String_Node_Str");
  setLocation((screenSize.width - getWidth()) / 2,(screenSize.height - getHeight()) / 2);
  setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  setResizable(false);
  setLayout(new BorderLayout());
  guiCustomer=this;
  this.email=email;
  this.proxy=new CustomerProxy(email);
  initComponents();
}

Fixed version (ground truth):
/** 
 * Create a new home for the customer specified by the email.
 * @param email the customer's email address.
 * @throws ParseException
 */
public GUICustomer(String email) throws ParseException {
  super(email);
  setTitle("String_Node_Str");
  setLocation((screenSize.width - getWidth()) / 2,(screenSize.height - getHeight()) / 2);
  setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  setResizable(false);
  setLayout(new BorderLayout());
  guiCustomer=this;
  this.email=email;
  this.proxy=new CustomerProxy(email);
  startTimer(proxy);
  initComponents();
}
Program: 78355
Project: 78355
Buggy source:
/** 
 * Create a new home screen for the dog sitter specified by the email address.
 * @param email the dog sitter's email address.
 * @throws ParseException
 */
public GUIDogSitter(String email) throws ParseException {
  super(email);
  setTitle("String_Node_Str");
  setLocation((screenSize.width - getWidth()) / 2,(screenSize.height - getHeight()) / 2);
  setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  setResizable(false);
  setLayout(new BorderLayout());
  this.email=email;
  this.proxy=new DogSitterProxy(email);
  initComponents();
}

Fixed version (ground truth):
/** 
 * Create a new home screen for the dog sitter specified by the email address.
 * @param email the dog sitter's email address.
 * @throws ParseException
 */
public GUIDogSitter(String email) throws ParseException {
  super(email);
  setTitle("String_Node_Str");
  setLocation((screenSize.width - getWidth()) / 2,(screenSize.height - getHeight()) / 2);
  setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  setResizable(false);
  setLayout(new BorderLayout());
  this.email=email;
  this.proxy=new DogSitterProxy(email);
  startTimer(proxy);
  initComponents();
}
Program: 78356
Project: 78356
Buggy source:
/** 
 * Go to the previous month
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void goBackMonthCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber) - 1;
  if (monthNumber == 0) {
    monthNumber=12;
    Integer newYear=Integer.parseInt(strYear) - 1;
    strYear=newYear.toString();
  }
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(monthNumber,proxy);
}

Fixed version (ground truth):
/** 
 * Go to the previous month
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void goBackMonthCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber) - 1;
  if (monthNumber == 0) {
    monthNumber=12;
    Integer newYear=Integer.parseInt(strYear) - 1;
    strYear=newYear.toString();
  }
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(proxy);
}
Program: 78357
Project: 78357
Buggy source:
/** 
 * Initialize the calendar with the current month and year.
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void initializeCalendar(Proxy proxy) throws ParseException {
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  Date currentMonth=new Date();
  int monthNumber=Integer.parseInt(dateMonth.format(currentMonth));
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date currentYear=new Date();
  labelDateMonthYear.setText(dateMonth.format(currentMonth) + "String_Node_Str" + dateYear.format(currentYear));
  Timer timer=new Timer();
  TimerHome timerTask=new TimerHome(this,proxy,monthNumber);
  timer.schedule(timerTask,60000,60000);
  updateCalendar(monthNumber,proxy);
}

Fixed version (ground truth):
/** 
 * Initialize the calendar with the current month and year.
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void initializeCalendar(Proxy proxy) throws ParseException {
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  Date currentMonth=new Date();
  int monthNumber=Integer.parseInt(dateMonth.format(currentMonth));
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date currentYear=new Date();
  labelDateMonthYear.setText(dateMonth.format(currentMonth) + "String_Node_Str" + dateYear.format(currentYear));
  updateCalendar(proxy);
}
Program: 78358
Project: 78358
Buggy source:
/** 
 * Go to the previous year.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void goBackYearCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber);
  Integer newYear=Integer.parseInt(strYear) - 1;
  strYear=newYear.toString();
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(monthNumber,proxy);
}

Fixed version (ground truth):
/** 
 * Go to the previous year.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void goBackYearCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber);
  Integer newYear=Integer.parseInt(strYear) - 1;
  strYear=newYear.toString();
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(proxy);
}
Program: 78359
Project: 78359
Buggy source:
/** 
 * Update the calendar.
 * @param monthNumber the number of the month.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void updateCalendar(int monthNumber,Proxy proxy) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  labelEmpty=new JLabel[NEMPTYLABEL];
  disposeEmptyLabel(dayNumber,monthNumber);
  if ((calendarState.equals(CalendarState.ADDING)) || (calendarState.equals(CalendarState.REMOVING))) {
    enableDisableDateButtonAssignment();
  }
  highlightCurrentDayButton();
  if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
    showAssignmentsOnCalendar(email,proxy);
  }
}

Fixed version (ground truth):
/** 
 * Update the calendar.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void updateCalendar(Proxy proxy) throws ParseException {
  SimpleDateFormat date=new SimpleDateFormat("String_Node_Str");
  String strDate="String_Node_Str" + labelDateMonthYear.getText();
  Date currentDate=date.parse(strDate);
  SimpleDateFormat dateDayNumber=new SimpleDateFormat("String_Node_Str");
  dateDayNumber.setLenient(false);
  String stringDayNumber=dateDayNumber.format(currentDate);
  int dayNumber=Integer.parseInt(stringDayNumber);
  labelEmpty=new JLabel[NEMPTYLABEL];
  SimpleDateFormat formatDateMonth=new SimpleDateFormat("String_Node_Str");
  Date dateMonth=null;
  try {
    dateMonth=formatDateMonth.parse(labelDateMonthYear.getText());
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  String strMonthNumber=formatDateMonth.format(dateMonth);
  int monthNumber=Integer.parseInt(strMonthNumber);
  disposeEmptyLabel(dayNumber,monthNumber);
  if ((calendarState.equals(CalendarState.ADDING)) || (calendarState.equals(CalendarState.REMOVING))) {
    enableDisableDateButtonAssignment();
  }
  highlightCurrentDayButton();
  if (!(calendarState.equals(CalendarState.ADDING)) && !(calendarState.equals(CalendarState.REMOVING))) {
    showAssignmentsOnCalendar(email,proxy);
  }
}
Program: 78360
Project: 78360
Buggy source:
/** 
 * Go to the next year.
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void goForwardYearCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber);
  Integer newYear=Integer.parseInt(strYear) + 1;
  strYear=newYear.toString();
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(monthNumber,proxy);
}

Fixed version (ground truth):
/** 
 * Go to the next year.
 * @param proxy the client proxy
 * @throws ParseException
 */
protected void goForwardYearCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber);
  Integer newYear=Integer.parseInt(strYear) + 1;
  strYear=newYear.toString();
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(proxy);
}
Program: 78361
Project: 78361
Buggy source:
/** 
 * Go to the next month.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void goForwardMonthCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber) + 1;
  if (monthNumber == 13) {
    monthNumber=1;
    Integer newYear=Integer.parseInt(strYear) + 1;
    strYear=newYear.toString();
  }
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(monthNumber,proxy);
}

Fixed version (ground truth):
/** 
 * Go to the next month.
 * @param proxy the client proxy.
 * @throws ParseException
 */
protected void goForwardMonthCalendar(Proxy proxy) throws ParseException {
  panelGridCalendar.removeAll();
  panelGridCalendar.revalidate();
  panelGridCalendar.repaint();
  int i=0;
  for (  WeekDays wd : WeekDays.values()) {
    labelDay[i]=new JLabel(wd.toString(),SwingConstants.CENTER);
    panelGridCalendar.add(labelDay[i]);
    i++;
  }
  SimpleDateFormat dateMonthYear=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateMonth=new SimpleDateFormat("String_Node_Str");
  SimpleDateFormat dateYear=new SimpleDateFormat("String_Node_Str");
  Date date=dateMonthYear.parse(labelDateMonthYear.getText());
  String strMonthNumber=dateMonth.format(date);
  String strYear=dateYear.format(date);
  int monthNumber=Integer.parseInt(strMonthNumber) + 1;
  if (monthNumber == 13) {
    monthNumber=1;
    Integer newYear=Integer.parseInt(strYear) + 1;
    strYear=newYear.toString();
  }
  if (monthNumber < 10) {
    labelDateMonthYear.setText("String_Node_Str" + monthNumber + "String_Node_Str"+ strYear);
  }
 else {
    labelDateMonthYear.setText(monthNumber + "String_Node_Str" + strYear);
  }
  updateCalendar(proxy);
}
Program: 78363
Project: 78363
Buggy source:
/** 
 * Method "run" that keeps the calendar updated.
 */
@Override public void run(){
  try {
    guiHome.updateCalendar(monthNumber,proxy);
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Method "run" that keeps the calendar updated.
 */
@Override public void run(){
  try {
    guiHome.updateCalendar(proxy);
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
}
Program: 78367
Project: 78367
Buggy source:
@Override public void actionPerformed(ActionEvent registrationAe){
  if (registrationAe.getActionCommand().equals("String_Node_Str")) {
    if (textDogsName.getText().equals("String_Node_Str") || textDogsWeight.getText().equals("String_Node_Str")) {
      JOptionPane.showMessageDialog(new JFrame(),"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
 else     if (checkNumber(textDogsWeight.getText())) {
      boolean add=newDog();
      if (add) {
        JOptionPane.showMessageDialog(new JFrame(),"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
        guiCustomerLabel.dispatchEvent(new WindowEvent(guiCustomerLabel,WindowEvent.WINDOW_CLOSING));
        GUILogin guiLogin=new GUILogin();
        guiLogin.setVisible(true);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent registrationAe){
  if (registrationAe.getActionCommand().equals("String_Node_Str")) {
    if (textDogsName.getText().equals("String_Node_Str") || textDogsWeight.getText().equals("String_Node_Str")) {
      JOptionPane.showMessageDialog(new JFrame(),"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
 else     if (checkNumber(textDogsWeight.getText())) {
      boolean add=newDog();
      if (add) {
        JOptionPane.showMessageDialog(new JFrame(),"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
        guiCustomerLabel.dispatchEvent(new WindowEvent(guiCustomerLabel,WindowEvent.WINDOW_CLOSING));
        guiSignUp.dispatchEvent(new WindowEvent(guiSignUp,WindowEvent.WINDOW_CLOSING));
      }
    }
  }
}
Program: 78368
Project: 78368
Buggy source:
@Override public void windowClosing(WindowEvent e){
  super.windowClosing(e);
  guiSignUp.setEnabled(true);
}

Fixed version (ground truth):
@Override public void windowClosing(WindowEvent e){
  super.windowClosing(e);
  guiSignUp.getGuiLogin().setEnabled(true);
}