nus-yam/ex-repair huggingface dataset:
Program: 85397
Project: 85397
Buggy source:
private WebMarkupContainer createAccountSettingsGroup(User user){
  final WebMarkupContainer accountSettingsGroup=new WebMarkupContainer("String_Node_Str");
  accountSettingsGroup.setVisible(getAccountSettingsGroupVisibility());
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(createRolesCheckGroup(user));
  return accountSettingsGroup;
}

Fixed version (ground truth):
private WebMarkupContainer createAccountSettingsGroup(IModel<Set<Role>> rolesModel){
  final WebMarkupContainer accountSettingsGroup=new WebMarkupContainer("String_Node_Str");
  accountSettingsGroup.setVisible(getAccountSettingsGroupVisibility());
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(new CheckBox("String_Node_Str"));
  accountSettingsGroup.add(createRolesCheckGroup(rolesModel));
  return accountSettingsGroup;
}
Program: 85398
Project: 85398
Buggy source:
private WebMarkupContainer createDisplayRolesGroup(User user){
  WebMarkupContainer displayRolesGroup=new WebMarkupContainer("String_Node_Str");
  displayRolesGroup.setVisible(getDisplayRolesGroupVisibility());
  displayRolesGroup.add(createRolesRepeater(user));
  return displayRolesGroup;
}

Fixed version (ground truth):
private WebMarkupContainer createDisplayRolesGroup(IModel<Set<Role>> rolesModel){
  WebMarkupContainer displayRolesGroup=new WebMarkupContainer("String_Node_Str");
  displayRolesGroup.setVisible(getDisplayRolesGroupVisibility());
  displayRolesGroup.add(createRolesRepeater(rolesModel));
  return displayRolesGroup;
}
Program: 85399
Project: 85399
Buggy source:
private CheckGroup<Role> createRolesCheckGroup(User user){
  CheckGroup<Role> rolesCheckGroup=new CheckGroup<Role>("String_Node_Str",user.getRoles());
  ListView<Role> roles=new ListView<Role>("String_Node_Str",allAvailableRoles){
    @Override protected void populateItem(    ListItem<Role> roleListItem){
      roleListItem.add(new Check<Role>("String_Node_Str",roleListItem.getModel()));
      roleListItem.add(new Label("String_Node_Str",roleListItem.getModel()));
    }
  }
.setReuseItems(true);
  rolesCheckGroup.add(roles);
  return rolesCheckGroup;
}

Fixed version (ground truth):
private CheckGroup<Role> createRolesCheckGroup(IModel<Set<Role>> rolesModel){
  CheckGroup<Role> rolesCheckGroup=new CheckGroup<Role>("String_Node_Str",rolesModel);
  ListView<Role> roles=new ListView<Role>("String_Node_Str",allAvailableRoles){
    @Override protected void populateItem(    ListItem<Role> roleListItem){
      roleListItem.add(new Check<Role>("String_Node_Str",roleListItem.getModel()));
      roleListItem.add(new Label("String_Node_Str",roleListItem.getModel()));
    }
  }
.setReuseItems(true);
  rolesCheckGroup.add(roles);
  return rolesCheckGroup;
}
Program: 85400
Project: 85400
Buggy source:
private RepeatingView createRolesRepeater(User user){
  RepeatingView rolesRepeater=new RepeatingView("String_Node_Str");
  for (  Role role : user.getRoles()) {
    WebMarkupContainer roleItem=new WebMarkupContainer(rolesRepeater.newChildId());
    rolesRepeater.add(roleItem);
    roleItem.add(new Label("String_Node_Str",role.toString()));
  }
  return rolesRepeater;
}

Fixed version (ground truth):
private RepeatingView createRolesRepeater(IModel<Set<Role>> rolesModel){
  RepeatingView rolesRepeater=new RepeatingView("String_Node_Str");
  Set<Role> roles=rolesModel.getObject();
  for (  Role role : roles) {
    WebMarkupContainer roleItem=new WebMarkupContainer(rolesRepeater.newChildId());
    rolesRepeater.add(roleItem);
    roleItem.add(new Label("String_Node_Str",role.toString()));
  }
  return rolesRepeater;
}
Program: 85403
Project: 85403
Buggy source:
private static String addPropertiesToPom(String existingPomXmlAsString,StringBuffer sortedProperties){
  String adjustedPom=existingPomXmlAsString;
  if (adjustedPom.contains("String_Node_Str")) {
    adjustedPom=adjustedPom.replace("String_Node_Str","String_Node_Str");
  }
  adjustedPom=adjustedPom.replace("String_Node_Str",LINE_SEP + "String_Node_Str" + sortedProperties+ "String_Node_Str");
  adjustedPom=adjustedPom.replaceAll("String_Node_Str","String_Node_Str");
  return adjustLineEndingsForOS(adjustedPom);
}

Fixed version (ground truth):
private static String addPropertiesToPom(String existingPomXmlAsString,StringBuffer sortedProperties){
  String adjustedPom=existingPomXmlAsString;
  adjustedPom=adjustedPom.replace("String_Node_Str",LINE_SEP + "String_Node_Str" + sortedProperties+ "String_Node_Str");
  adjustedPom=adjustedPom.replaceAll("String_Node_Str","String_Node_Str");
  return adjustLineEndingsForOS(adjustedPom);
}
Program: 85404
Project: 85404
Buggy source:
public int compareTo(Object o){
  return (equals(o) ? 0 : -1);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public int compareTo(Object o){
  return (equals(o) ? 0 : -1);
}
Program: 85405
Project: 85405
Buggy source:
/** 
 * @see org.springframework.security.GrantedAuthority#getAuthority()
 * @return the name property (getAuthority required by Acegi's GrantedAuthority interface)
 */
@Transient public String getAuthority(){
  return getName();
}

Fixed version (ground truth):
/** 
 * @return the name property (getAuthority required by Acegi's GrantedAuthority interface)
 * @see org.springframework.security.GrantedAuthority#getAuthority()
 */
@Transient public String getAuthority(){
  return getName();
}
Program: 85406
Project: 85406
Buggy source:
/** 
 * @see org.springframework.security.userdetails.UserDetails#getAuthorities()
 * @return GrantedAuthority[] an array of roles.
 */
@Transient public GrantedAuthority[] getAuthorities(){
  return roles.toArray(new GrantedAuthority[0]);
}

Fixed version (ground truth):
/** 
 * @return GrantedAuthority[] an array of roles.
 * @see org.springframework.security.userdetails.UserDetails#getAuthorities()
 */
@Transient public GrantedAuthority[] getAuthorities(){
  return roles.toArray(new GrantedAuthority[0]);
}
Program: 85407
Project: 85407
Buggy source:
private MavenProject createProjectFromPom(File pom){
  MavenEmbedder maven=new MavenEmbedder();
  maven.setOffline(true);
  maven.setClassLoader(Thread.currentThread().getContextClassLoader());
  maven.setLogger(new MavenEmbedderConsoleLogger());
  MavenProject p=null;
  try {
    maven.start();
    p=maven.readProjectWithDependencies(pom);
    maven.stop();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return p;
}

Fixed version (ground truth):
private MavenProject createProjectFromPom(File pom){
  MavenEmbedder maven=new MavenEmbedder();
  maven.setOffline(true);
  maven.setClassLoader(Thread.currentThread().getContextClassLoader());
  maven.setLogger(new MavenEmbedderConsoleLogger());
  MavenProject p=null;
  try {
    maven.setAlignWithUserInstallation(true);
    maven.start();
    p=maven.readProjectWithDependencies(pom);
    maven.stop();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return p;
}
Program: 85408
Project: 85408
Buggy source:
public String add(){
  user=new User();
  user.addRole(new Role(Constants.USER_ROLE));
  return "String_Node_Str";
}

Fixed version (ground truth):
public String add(){
  user=new User();
  user.setEnabled(true);
  user.addRole(new Role(Constants.USER_ROLE));
  return "String_Node_Str";
}
Program: 85409
Project: 85409
Buggy source:
public String save() throws IOException {
  setUserRoles(getRequest().getParameterValues("String_Node_Str"));
  for (int i=0; (userRoles != null) && (i < userRoles.length); i++) {
    String roleName=userRoles[i];
    user.addRole(roleManager.getRole(roleName));
  }
  Integer originalVersion=user.getVersion();
  try {
    user=userManager.saveUser(user);
  }
 catch (  AccessDeniedException ade) {
    log.warn(ade.getMessage());
    getResponse().sendError(HttpServletResponse.SC_FORBIDDEN);
    return null;
  }
catch (  UserExistsException e) {
    addError("String_Node_Str",new Object[]{user.getUsername(),user.getEmail()});
    user.setVersion(originalVersion);
    return "String_Node_Str";
  }
  if (!"String_Node_Str".equals(getParameter("String_Node_Str"))) {
    addMessage("String_Node_Str");
    return "String_Node_Str";
  }
 else {
    if ("String_Node_Str".equals(getParameter("String_Node_Str"))) {
      addMessage("String_Node_Str",user.getFullName());
      try {
        sendUserMessage(user,getText("String_Node_Str",user.getFullName()),RequestUtil.getAppURL(getRequest()));
      }
 catch (      MailException me) {
        addError(me.getCause().getLocalizedMessage());
      }
      return "String_Node_Str";
    }
 else {
      addMessage("String_Node_Str",user.getFullName());
      return "String_Node_Str";
    }
  }
}

Fixed version (ground truth):
public String save() throws IOException {
  setUserRoles(getRequest().getParameterValues("String_Node_Str"));
  for (int i=0; (userRoles != null) && (i < userRoles.length); i++) {
    String roleName=userRoles[i];
    user.addRole(roleManager.getRole(roleName));
  }
  Integer originalVersion=user.getVersion();
  if (user.getVersion() == 0) {
    user.setVersion(null);
  }
  try {
    user=userManager.saveUser(user);
  }
 catch (  AccessDeniedException ade) {
    log.warn(ade.getMessage());
    getResponse().sendError(HttpServletResponse.SC_FORBIDDEN);
    return null;
  }
catch (  UserExistsException e) {
    addError("String_Node_Str",new Object[]{user.getUsername(),user.getEmail()});
    user.setVersion(originalVersion);
    return "String_Node_Str";
  }
  if (!"String_Node_Str".equals(getParameter("String_Node_Str"))) {
    addMessage("String_Node_Str");
    return "String_Node_Str";
  }
 else {
    if ("String_Node_Str".equals(getParameter("String_Node_Str"))) {
      addMessage("String_Node_Str",user.getFullName());
      try {
        sendUserMessage(user,getText("String_Node_Str",user.getFullName()),RequestUtil.getAppURL(getRequest()));
      }
 catch (      MailException me) {
        addError(me.getCause().getLocalizedMessage());
      }
      return "String_Node_Str";
    }
 else {
      addMessage("String_Node_Str",user.getFullName());
      return "String_Node_Str";
    }
  }
}
Program: 85411
Project: 85411
Buggy source:
public String fromFile(String fileName) throws IOException {
  BufferedReader in=new BufferedReader(new FileReader(fileName));
  StringBuffer fileContents=new StringBuffer();
  String str;
  while ((str=in.readLine()) != null) {
    fileContents.append(str);
    fileContents.append("String_Node_Str");
  }
  in.close();
  return fileContents.toString();
}

Fixed version (ground truth):
public String fromFile(String fileName) throws IOException {
  return FileUtils.readFileToString(new File(fileName),"String_Node_Str");
}
Program: 85412
Project: 85412
Buggy source:
private void refactorNonPackageFiles(){
  try {
    String[] extensions={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    Iterator filesInMain=org.apache.commons.io.FileUtils.iterateFiles(new File(this.workBaseDir),extensions,true);
    while (filesInMain.hasNext()) {
      File f=(File)filesInMain.next();
      changePackageNamesInFile(f.getAbsolutePath(),RenamePackages.SAVE_FILE);
    }
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str" + ioex.getMessage());
  }
}

Fixed version (ground truth):
private void refactorNonPackageFiles(){
  try {
    String[] extensions={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    Iterator filesInMain=FileUtils.iterateFiles(new File(this.workBaseDir),extensions,true);
    while (filesInMain.hasNext()) {
      File f=(File)filesInMain.next();
      changePackageNamesInFile(f.getAbsolutePath(),RenamePackages.SAVE_FILE);
    }
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str" + ioex.getMessage());
  }
}
Program: 85413
Project: 85413
Buggy source:
public void toFile(String fileName,String contents) throws IOException {
  if (debug) {
    log.debug("String_Node_Str" + fileName + "String_Node_Str");
  }
  BufferedOutputStream bout=new BufferedOutputStream(new DataOutputStream(new FileOutputStream(fileName)));
  bout.write(contents.getBytes());
  bout.flush();
  bout.close();
}

Fixed version (ground truth):
public void toFile(String fileName,String contents) throws IOException {
  if (debug) {
    log.debug("String_Node_Str" + fileName + "String_Node_Str");
  }
  FileUtils.writeStringToFile(new File(fileName),contents,"String_Node_Str");
}
Program: 85419
Project: 85419
Buggy source:
public String upload() throws IOException {
  HttpServletRequest request=getRequest();
  String uploadDir=getServletContext().getRealPath("String_Node_Str") + "String_Node_Str" + request.getRemoteUser()+ "String_Node_Str";
  File dirPath=new File(uploadDir);
  if (!dirPath.exists()) {
    dirPath.mkdirs();
  }
  InputStream stream=file.getInputStream();
  OutputStream bos=new FileOutputStream(uploadDir + file.getName());
  int bytesRead=0;
  byte[] buffer=new byte[8192];
  while ((bytesRead=stream.read(buffer,0,8192)) != -1) {
    bos.write(buffer,0,bytesRead);
  }
  bos.close();
  stream.close();
  request.setAttribute("String_Node_Str",name);
  request.setAttribute("String_Node_Str",file.getName());
  request.setAttribute("String_Node_Str",file.getContentType());
  request.setAttribute("String_Node_Str",file.getSize() + "String_Node_Str");
  request.setAttribute("String_Node_Str",dirPath.getAbsolutePath() + Constants.FILE_SEP + file.getName());
  String link=request.getContextPath() + "String_Node_Str" + "String_Node_Str"+ request.getRemoteUser()+ "String_Node_Str";
  request.setAttribute("String_Node_Str",link + file.getName());
  return "String_Node_Str";
}

Fixed version (ground truth):
public String upload() throws IOException {
  HttpServletRequest request=getRequest();
  String uploadDir=getServletContext().getRealPath("String_Node_Str") + "String_Node_Str" + request.getRemoteUser()+ "String_Node_Str";
  File dirPath=new File(uploadDir);
  if (!dirPath.exists()) {
    dirPath.mkdirs();
  }
  InputStream stream=file.getInputStream();
  String filename=file.getName();
  if (filename.indexOf("String_Node_Str") != -1) {
    int slash=filename.lastIndexOf("String_Node_Str");
    if (slash != -1) {
      filename=filename.substring(slash + 1);
    }
    int slash2=filename.lastIndexOf("String_Node_Str");
    if (slash2 != -1) {
      filename=filename.substring(slash2 + 1);
    }
    int slash3=filename.lastIndexOf("String_Node_Str");
    if (slash3 != -1) {
      filename=filename.substring(slash3 + 1);
    }
  }
  OutputStream bos=new FileOutputStream(uploadDir + filename);
  int bytesRead;
  byte[] buffer=new byte[8192];
  while ((bytesRead=stream.read(buffer,0,8192)) != -1) {
    bos.write(buffer,0,bytesRead);
  }
  bos.close();
  stream.close();
  request.setAttribute("String_Node_Str",name);
  request.setAttribute("String_Node_Str",filename);
  request.setAttribute("String_Node_Str",file.getContentType());
  request.setAttribute("String_Node_Str",file.getSize() + "String_Node_Str");
  request.setAttribute("String_Node_Str",dirPath.getAbsolutePath() + Constants.FILE_SEP + filename);
  String link=request.getContextPath() + "String_Node_Str" + "String_Node_Str"+ request.getRemoteUser()+ "String_Node_Str";
  request.setAttribute("String_Node_Str",link + filename);
  return "String_Node_Str";
}
Program: 85421
Project: 85421
Buggy source:
public void validate(){
  if (getRequest().getMethod().equalsIgnoreCase("String_Node_Str")) {
    if ("String_Node_Str".equals(fileFileName) || file == null) {
      super.addFieldError("String_Node_Str",getText("String_Node_Str",new String[]{getText("String_Node_Str")}));
    }
 else     if (file.length() > 2097152) {
      addActionError(getText("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
public void validate(){
  if (getRequest().getMethod().equalsIgnoreCase("String_Node_Str")) {
    getFieldErrors().clear();
    if ("String_Node_Str".equals(fileFileName) || file == null) {
      super.addFieldError("String_Node_Str",getText("String_Node_Str",new String[]{getText("String_Node_Str")}));
    }
 else     if (file.length() > 2097152) {
      addActionError(getText("String_Node_Str"));
    }
  }
}
Program: 85422
Project: 85422
Buggy source:
public Object convertFromString(Map ctx,String[] value,Class arg2){
  if (value[0] == null || value[0].trim().equals("String_Node_Str")) {
    return null;
  }
  try {
    DateUtil.convertStringToDate(value[0]);
  }
 catch (  ParseException pe) {
    pe.printStackTrace();
    throw new TypeConversionException(pe.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public Object convertFromString(Map ctx,String[] value,Class arg2){
  if (value[0] == null || value[0].trim().equals("String_Node_Str")) {
    return null;
  }
  try {
    return DateUtil.convertStringToDate(value[0]);
  }
 catch (  ParseException pe) {
    pe.printStackTrace();
    throw new TypeConversionException(pe.getMessage());
  }
}
Program: 85425
Project: 85425
Buggy source:
private String getDaoFramework(){
  String fw=project.getProperties().getProperty("String_Node_Str");
  if (fw.equalsIgnoreCase("String_Node_Str")) {
    return "String_Node_Str";
  }
 else {
    return fw;
  }
}

Fixed version (ground truth):
private String getDaoFramework(){
  if (daoFramework.equalsIgnoreCase("String_Node_Str")) {
    return "String_Node_Str";
  }
 else {
    return daoFramework;
  }
}
Program: 85427
Project: 85427
Buggy source:
protected void addError(IValidationDelegate delegate,String componentId,String message,ValidationConstraint constraint){
  IFormComponent component=(IFormComponent)getComponent(componentId);
  delegate.setFormComponent(component);
  delegate.record(message,constraint);
}

Fixed version (ground truth):
protected void addError(String componentId,String message,ValidationConstraint constraint){
  IFormComponent component=(IFormComponent)getComponent(componentId);
  delegate.setFormComponent(component);
  delegate.record(message,constraint);
}
Program: 85430
Project: 85430
Buggy source:
protected Object formBackingObject(HttpServletRequest request) throws Exception {
  if (!isFormSubmission(request)) {
    String username=request.getParameter("String_Node_Str");
    log.debug("String_Node_Str");
    AuthenticationTrustResolver resolver=new AuthenticationTrustResolverImpl();
    SecurityContext ctx=SecurityContextHolder.getContext();
    if (ctx.getAuthentication() != null) {
      Authentication auth=ctx.getAuthentication();
      if (resolver.isRememberMe(auth)) {
        request.getSession().setAttribute("String_Node_Str","String_Node_Str");
        saveMessage(request,getText("String_Node_Str",request.getLocale()));
      }
    }
    User user=null;
    if (request.getRequestURI().indexOf("String_Node_Str") > -1) {
      user=getUserManager().getUserByUsername(request.getRemoteUser());
    }
 else     if (!StringUtils.isBlank(username) && !"String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      user=getUserManager().getUserByUsername(username);
    }
 else {
      user=new User();
      user.addRole(new Role(Constants.USER_ROLE));
    }
    user.setConfirmPassword(user.getPassword());
    return user;
  }
  return super.formBackingObject(request);
}

Fixed version (ground truth):
protected Object formBackingObject(HttpServletRequest request) throws Exception {
  if (!isFormSubmission(request)) {
    String username=request.getParameter("String_Node_Str");
    log.debug("String_Node_Str");
    AuthenticationTrustResolver resolver=new AuthenticationTrustResolverImpl();
    SecurityContext ctx=SecurityContextHolder.getContext();
    if (ctx.getAuthentication() != null) {
      Authentication auth=ctx.getAuthentication();
      if (resolver.isRememberMe(auth)) {
        request.getSession().setAttribute("String_Node_Str","String_Node_Str");
        saveMessage(request,getText("String_Node_Str",request.getLocale()));
      }
    }
    User user;
    if (request.getRequestURI().indexOf("String_Node_Str") > -1) {
      user=getUserManager().getUserByUsername(request.getRemoteUser());
    }
 else     if (!StringUtils.isBlank(username) && !"String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      user=getUserManager().getUserByUsername(username);
    }
 else {
      user=new User();
      user.addRole(new Role(Constants.USER_ROLE));
    }
    user.setConfirmPassword(user.getPassword());
    return user;
  }
 else   if (request.getParameter("String_Node_Str") != null && !"String_Node_Str".equals(request.getParameter("String_Node_Str")) && request.getParameter("String_Node_Str") == null) {
    return getUserManager().getUser(request.getParameter("String_Node_Str"));
  }
  return super.formBackingObject(request);
}
Program: 85432
Project: 85432
Buggy source:
public List getUsers(){
  return userManager.getUsers(null);
}

Fixed version (ground truth):
public List getUsers(){
  List users=userManager.getUsers(null);
  Comparator comparator=new BeanComparator(sortColumn);
  if (!ascending) {
    comparator=new ReverseComparator(comparator);
  }
  Collections.sort(users,comparator);
  return users;
}
Program: 85433
Project: 85433
Buggy source:
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field != null) {
      if (field instanceof BaseObject) {
        objectToRequestParameters(field,request,fields[i].getName());
      }
 else       if (!(field instanceof List) && !(field instanceof Set)) {
        String paramName=fields[i].getName();
        if (prefix != null) {
          paramName=prefix + "String_Node_Str" + paramName;
        }
        String paramValue=String.valueOf(fields[i].get(o));
        if (field instanceof java.util.Date) {
          paramValue=DateUtil.convertDateToString((Date)fields[i].get(o));
          if ("String_Node_Str".equals(paramValue))           paramValue="String_Node_Str";
        }
        request.addParameter(paramName,paramValue);
      }
    }
  }
}

Fixed version (ground truth):
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field != null) {
      if (field instanceof BaseObject) {
        if (prefix != null) {
          objectToRequestParameters(field,request,prefix + "String_Node_Str" + fields[i].getName());
        }
 else {
          objectToRequestParameters(field,request,fields[i].getName());
        }
      }
 else       if (!(field instanceof List) && !(field instanceof Set)) {
        String paramName=fields[i].getName();
        if (prefix != null) {
          paramName=prefix + "String_Node_Str" + paramName;
        }
        String paramValue=String.valueOf(fields[i].get(o));
        if (field instanceof java.util.Date) {
          paramValue=DateUtil.convertDateToString((Date)fields[i].get(o));
          if ("String_Node_Str".equals(paramValue))           paramValue="String_Node_Str";
        }
        request.addParameter(paramName,paramValue);
      }
    }
  }
}
Program: 85434
Project: 85434
Buggy source:
private void addUserRoles(final User user){
  if (user.getRoles() != null) {
    for (Iterator it=user.getRoles().iterator(); it.hasNext(); ) {
      Role role=(Role)it.next();
      Map newRole=new HashMap();
      newRole.put("String_Node_Str",user.getId());
      newRole.put("String_Node_Str",role.getId());
      List userRoles=getSqlMapClientTemplate().queryForList("String_Node_Str",user.getUsername());
      if (userRoles.isEmpty()) {
        getSqlMapClientTemplate().update("String_Node_Str",newRole);
      }
    }
  }
}

Fixed version (ground truth):
private void addUserRoles(final User user){
  if (user.getRoles() != null) {
    for (Iterator it=user.getRoles().iterator(); it.hasNext(); ) {
      Role role=(Role)it.next();
      Map newRole=new HashMap();
      newRole.put("String_Node_Str",user.getId());
      newRole.put("String_Node_Str",role.getId());
      List userRoles=getSqlMapClientTemplate().queryForList("String_Node_Str",user.getId());
      if (userRoles.isEmpty()) {
        getSqlMapClientTemplate().update("String_Node_Str",newRole);
      }
    }
  }
}
Program: 85435
Project: 85435
Buggy source:
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  User user2=new User();
  BeanUtils.copyProperties(user,user2);
  user2.setId(null);
  user2.setVersion(null);
  try {
    manager.saveUser(user2);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}

Fixed version (ground truth):
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  User user2=new User();
  BeanUtils.copyProperties(user,user2);
  user2.setId(null);
  user2.setVersion(null);
  user2.setRoles(null);
  try {
    manager.saveUser(user2);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}
Program: 85436
Project: 85436
Buggy source:
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  user.setUsername("String_Node_Str");
  user.setEmail("String_Node_Str");
  user.setRoles(null);
  user.setVersion(null);
  manager.saveUser(user);
  user.setId(null);
  try {
    manager.saveUser(user);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}

Fixed version (ground truth):
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  user.setUsername("String_Node_Str");
  user.setEmail("String_Node_Str");
  user.setRoles(null);
  user.setVersion(null);
  manager.saveUser(user);
  User user2=new User();
  BeanUtils.copyProperties(user,user2);
  user2.setId(null);
  try {
    manager.saveUser(user2);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}
Program: 85437
Project: 85437
Buggy source:
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  user.setUsername("String_Node_Str");
  user.setEmail("String_Node_Str");
  user.setRoles(null);
  user.setVersion(null);
  manager.saveUser(user);
  User user2=new User();
  BeanUtils.copyProperties(user,user2);
  user2.setId(null);
  try {
    manager.saveUser(user2);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}

Fixed version (ground truth):
public void testAddExistingUser() throws Exception {
  logger.debug("String_Node_Str");
  User user=manager.getUser("String_Node_Str");
  User user2=new User();
  BeanUtils.copyProperties(user,user2);
  user2.setId(null);
  user2.setVersion(null);
  try {
    manager.saveUser(user2);
    fail("String_Node_Str");
  }
 catch (  UserExistsException uee) {
    assertNotNull(uee);
  }
}
Program: 85438
Project: 85438
Buggy source:
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field instanceof BaseObject) {
      objectToRequestParameters(field,request,fields[i].getName());
    }
 else     if (!(field instanceof List) && !(field instanceof Set)) {
      String paramName=fields[i].getName();
      if (prefix != null) {
        paramName=prefix + "String_Node_Str" + paramName;
      }
      String paramValue=String.valueOf(fields[i].get(o));
      if (field instanceof java.util.Date) {
        paramValue=DateUtil.convertDateToString((Date)fields[i].get(o));
        if ("String_Node_Str".equals(paramValue))         paramValue="String_Node_Str";
      }
      request.addParameter(paramName,paramValue);
    }
  }
}

Fixed version (ground truth):
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field != null) {
      if (field instanceof BaseObject) {
        objectToRequestParameters(field,request,fields[i].getName());
      }
 else       if (!(field instanceof List) && !(field instanceof Set)) {
        String paramName=fields[i].getName();
        if (prefix != null) {
          paramName=prefix + "String_Node_Str" + paramName;
        }
        String paramValue=String.valueOf(fields[i].get(o));
        if (field instanceof java.util.Date) {
          paramValue=DateUtil.convertDateToString((Date)fields[i].get(o));
          if ("String_Node_Str".equals(paramValue))           paramValue="String_Node_Str";
        }
        request.addParameter(paramName,paramValue);
      }
    }
  }
}
Program: 85440
Project: 85440
Buggy source:
/** 
 * @see javax.servlet.ServletRequestWrapper#getLocales()
 */
public Enumeration getLocales(){
  if (null != preferredLocale) {
    return setLocales();
  }
 else {
    return super.getLocales();
  }
}

Fixed version (ground truth):
/** 
 * @see javax.servlet.ServletRequestWrapper#getLocales()
 */
public Enumeration getLocales(){
  if (null != preferredLocale) {
    List l=Collections.list(super.getLocales());
    if (l.contains(preferredLocale)) {
      l.remove(preferredLocale);
    }
    l.add(0,preferredLocale);
    return Collections.enumeration(l);
  }
 else {
    return super.getLocales();
  }
}
Program: 85441
Project: 85441
Buggy source:
public String execute(){
}

Fixed version (ground truth):
public String execute(){
  if (username == null || "String_Node_Str".equals(username)) {
    log.warn("String_Node_Str");
    addError("String_Node_Str",getText("String_Node_Str"));
    return null;
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  try {
    User user=userManager.getUser(username);
    StringBuffer msg=new StringBuffer();
    msg.append("String_Node_Str" + user.getPasswordHint());
    msg.append("String_Node_Str" + RequestUtil.getAppURL(getRequest()));
    message.setTo(user.getEmail());
    String subject='[' + getText("String_Node_Str") + "String_Node_Str"+ getText("String_Node_Str");
    message.setSubject(subject);
    message.setText(msg.toString());
    mailEngine.send(message);
    addMessage("String_Node_Str",new Object[]{username,user.getEmail()});
  }
 catch (  Exception e) {
    e.printStackTrace();
    addError("String_Node_Str",username);
  }
  return "String_Node_Str";
}
Program: 85443
Project: 85443
Buggy source:
private int getHibernateLength() throws XDocletException {
  Properties props=new Properties();
  props.setProperty("String_Node_Str","String_Node_Str");
  props.setProperty("String_Node_Str","String_Node_Str");
  int length=0;
  if (super.hasTag(props,FOR_METHOD)) {
    String tagVal=super.getTagValue(props,FOR_METHOD);
    System.out.println("String_Node_Str" + tagVal);
    length=Integer.valueOf(tagVal).intValue();
  }
  return length;
}

Fixed version (ground truth):
private int getHibernateLength() throws XDocletException {
  Properties props=new Properties();
  props.setProperty("String_Node_Str","String_Node_Str");
  props.setProperty("String_Node_Str","String_Node_Str");
  int length=0;
  if (super.hasTag(props,FOR_METHOD)) {
    String tagVal=super.getTagValue(props,FOR_METHOD);
    length=Integer.valueOf(tagVal).intValue();
  }
  return length;
}
Program: 85446
Project: 85446
Buggy source:
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  return result;
}

Fixed version (ground truth):
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  result=29 * result + (birthDate != null ? birthDate.hashCode() : 0);
  return result;
}
Program: 85447
Project: 85447
Buggy source:
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  return true;
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  if (birthDate != null ? !birthDate.equals(person.birthDate) : person.birthDate != null)   return false;
  return true;
}
Program: 85448
Project: 85448
Buggy source:
public String toString(){
  return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE).append("String_Node_Str",this.lastName).append("String_Node_Str",this.personId).append("String_Node_Str",this.firstName).toString();
}

Fixed version (ground truth):
public String toString(){
  return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE).append("String_Node_Str",this.lastName).append("String_Node_Str",this.personId).append("String_Node_Str",this.firstName).append("String_Node_Str",this.birthDate).toString();
}
Program: 85449
Project: 85449
Buggy source:
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field instanceof BaseObject) {
      objectToRequestParameters(field,request,fields[i].getName());
    }
 else     if (!(field instanceof List) && !(field instanceof Set)) {
      String paramName=fields[i].getName();
      if (prefix != null) {
        paramName=prefix + "String_Node_Str" + paramName;
      }
      request.addParameter(paramName,String.valueOf(fields[i].get(o)));
    }
  }
}

Fixed version (ground truth):
public void objectToRequestParameters(Object o,MockHttpServletRequest request,String prefix) throws Exception {
  Class clazz=o.getClass();
  Field[] fields=getDeclaredFields(clazz);
  AccessibleObject.setAccessible(fields,true);
  for (int i=0; i < fields.length; i++) {
    Object field=(fields[i].get(o));
    if (field instanceof BaseObject) {
      objectToRequestParameters(field,request,fields[i].getName());
    }
 else     if (!(field instanceof List) && !(field instanceof Set)) {
      String paramName=fields[i].getName();
      if (prefix != null) {
        paramName=prefix + "String_Node_Str" + paramName;
      }
      String paramValue=String.valueOf(fields[i].get(o));
      if (field instanceof java.util.Date) {
        paramValue=DateUtil.convertDateToString((Date)fields[i].get(o));
      }
      request.addParameter(paramName,paramValue);
    }
  }
}
Program: 85450
Project: 85450
Buggy source:
public int hashCode(){
  return new HashCodeBuilder(1923026325,-1034774675).append(this.firstName).append(this.personId).append(this.lastName).toHashCode();
}

Fixed version (ground truth):
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  return result;
}
Program: 85451
Project: 85451
Buggy source:
public boolean equals(Object object){
  if (!(object instanceof Person)) {
    return false;
  }
  Person rhs=(Person)object;
  return new EqualsBuilder().append(this.firstName,rhs.firstName).append(this.personId,rhs.personId).append(this.lastName,rhs.lastName).isEquals();
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  return true;
}
Program: 85452
Project: 85452
Buggy source:
public int hashCode(){
  return new HashCodeBuilder(1923026325,-1034774675).append(this.firstName).append(this.personId).append(this.lastName).toHashCode();
}

Fixed version (ground truth):
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  return result;
}
Program: 85453
Project: 85453
Buggy source:
public boolean equals(Object object){
  if (!(object instanceof Person)) {
    return false;
  }
  Person rhs=(Person)object;
  return new EqualsBuilder().append(this.firstName,rhs.firstName).append(this.personId,rhs.personId).append(this.lastName,rhs.lastName).isEquals();
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  return true;
}
Program: 85454
Project: 85454
Buggy source:
public int hashCode(){
  return new HashCodeBuilder(1923026325,-1034774675).append(this.firstName).append(this.personId).append(this.lastName).toHashCode();
}

Fixed version (ground truth):
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  return result;
}
Program: 85455
Project: 85455
Buggy source:
public boolean equals(Object object){
  if (!(object instanceof Person)) {
    return false;
  }
  Person rhs=(Person)object;
  return new EqualsBuilder().append(this.firstName,rhs.firstName).append(this.personId,rhs.personId).append(this.lastName,rhs.lastName).isEquals();
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  return true;
}
Program: 85456
Project: 85456
Buggy source:
public int hashCode(){
  return new HashCodeBuilder(1923026325,-1034774675).append(this.firstName).append(this.id).append(this.lastName).toHashCode();
}

Fixed version (ground truth):
public int hashCode(){
  int result;
  result=(firstName != null ? firstName.hashCode() : 0);
  result=29 * result + (lastName != null ? lastName.hashCode() : 0);
  return result;
}
Program: 85457
Project: 85457
Buggy source:
public boolean equals(Object object){
  if (!(object instanceof Person)) {
    return false;
  }
  Person rhs=(Person)object;
  return new EqualsBuilder().append(this.firstName,rhs.firstName).append(this.id,rhs.id).append(this.lastName,rhs.lastName).isEquals();
}

Fixed version (ground truth):
public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof Person))   return false;
  final Person person=(Person)o;
  if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null)   return false;
  if (lastName != null ? !lastName.equals(person.lastName) : person.lastName != null)   return false;
  return true;
}
Program: 85458
Project: 85458
Buggy source:
/** 
 * Return default datePattern (MM/dd/yyyy)
 * @return a string representing the date pattern on the UI
 */
public static String getDatePattern(){
  if (defaultDatePattern == null) {
    Locale locale=LocaleContextHolder.getLocale();
    defaultDatePattern=ResourceBundle.getBundle(Constants.BUNDLE_KEY).getString("String_Node_Str");
  }
  return defaultDatePattern;
}

Fixed version (ground truth):
/** 
 * Return default datePattern (MM/dd/yyyy)
 * @return a string representing the date pattern on the UI
 */
public static synchronized String getDatePattern(){
  Locale locale=LocaleContextHolder.getLocale();
  try {
    defaultDatePattern=ResourceBundle.getBundle(Constants.BUNDLE_KEY,locale).getString("String_Node_Str");
  }
 catch (  MissingResourceException mse) {
    defaultDatePattern="String_Node_Str";
  }
  return defaultDatePattern;
}
Program: 85459
Project: 85459
Buggy source:
/** 
 * This method converts a String to a date using the datePattern
 * @param strDate the date to convert (in format MM/dd/yyyy)
 * @return a date object
 * @throws ParseException
 */
public static Date convertStringToDate(String strDate) throws ParseException {
  Date aDate=null;
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + datePattern);
    }
    aDate=convertStringToDate(datePattern,strDate);
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str" + strDate + "String_Node_Str");
    pe.printStackTrace();
    throw new ParseException(pe.getMessage(),pe.getErrorOffset());
  }
  return aDate;
}

Fixed version (ground truth):
/** 
 * This method converts a String to a date using the datePattern
 * @param strDate the date to convert (in format MM/dd/yyyy)
 * @return a date object
 * @throws ParseException
 */
public static Date convertStringToDate(String strDate) throws ParseException {
  Date aDate=null;
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + getDatePattern());
    }
    aDate=convertStringToDate(getDatePattern(),strDate);
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str" + strDate + "String_Node_Str");
    pe.printStackTrace();
    throw new ParseException(pe.getMessage(),pe.getErrorOffset());
  }
  return aDate;
}
Program: 85460
Project: 85460
Buggy source:
/** 
 * Return default datePattern (MM/dd/yyyy)
 * @return a string representing the date pattern on the UI
 */
public static String getDatePattern(){
  return datePattern;
}

Fixed version (ground truth):
/** 
 * Return default datePattern (MM/dd/yyyy)
 * @return a string representing the date pattern on the UI
 */
public static String getDatePattern(){
  if (defaultDatePattern == null) {
    Locale locale=LocaleContextHolder.getLocale();
    defaultDatePattern=ResourceBundle.getBundle(Constants.BUNDLE_KEY).getString("String_Node_Str");
  }
  return defaultDatePattern;
}
Program: 85461
Project: 85461
Buggy source:
/** 
 * This method attempts to convert an Oracle-formatted date in the form dd-MMM-yyyy to mm/dd/yyyy.
 * @param aDate date from database as a string
 * @return formatted string for the ui
 */
public static final String getDate(Date aDate){
  SimpleDateFormat df=null;
  String returnValue="String_Node_Str";
  if (aDate != null) {
    df=new SimpleDateFormat(datePattern);
    returnValue=df.format(aDate);
  }
  return (returnValue);
}

Fixed version (ground truth):
/** 
 * This method attempts to convert an Oracle-formatted date in the form dd-MMM-yyyy to mm/dd/yyyy.
 * @param aDate date from database as a string
 * @return formatted string for the ui
 */
public static final String getDate(Date aDate){
  SimpleDateFormat df=null;
  String returnValue="String_Node_Str";
  if (aDate != null) {
    df=new SimpleDateFormat(getDatePattern());
    returnValue=df.format(aDate);
  }
  return (returnValue);
}
Program: 85462
Project: 85462
Buggy source:
/** 
 * This method generates a string representation of a date based on the System Property 'dateFormat' in the format you specify on input
 * @param aDate A date to convert
 * @return a string representation of the date
 */
public static final String convertDateToString(Date aDate){
  return getDateTime(datePattern,aDate);
}

Fixed version (ground truth):
/** 
 * This method generates a string representation of a date based on the System Property 'dateFormat' in the format you specify on input
 * @param aDate A date to convert
 * @return a string representation of the date
 */
public static final String convertDateToString(Date aDate){
  return getDateTime(getDatePattern(),aDate);
}
Program: 85463
Project: 85463
Buggy source:
/** 
 * This method returns the current date in the format: MM/dd/yyyy
 * @return the current date
 * @throws ParseException
 */
public static Calendar getToday() throws ParseException {
  Date today=new Date();
  SimpleDateFormat df=new SimpleDateFormat(datePattern);
  String todayAsString=df.format(today);
  Calendar cal=new GregorianCalendar();
  cal.setTime(convertStringToDate(todayAsString));
  return cal;
}

Fixed version (ground truth):
/** 
 * This method returns the current date in the format: MM/dd/yyyy
 * @return the current date
 * @throws ParseException
 */
public static Calendar getToday() throws ParseException {
  Date today=new Date();
  SimpleDateFormat df=new SimpleDateFormat(getDatePattern());
  String todayAsString=df.format(today);
  Calendar cal=new GregorianCalendar();
  cal.setTime(convertStringToDate(todayAsString));
  return cal;
}