nus-yam/ex-repair huggingface dataset:
Program: 99560
Project: 99560
Buggy source:
/** 
 * @param issue the Issue to update on the server. issue.getId() is used for identification.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the required ID is not found
 * @throws RedmineException 
 */
public void updateIssue(Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getUpdateIssueURI(issue.getId());
  HttpPut httpRequest=new HttpPut(query);
  String NO_PROJECT_KEY=null;
  String xmlBody=getIssueXML(NO_PROJECT_KEY,issue);
  setEntity(httpRequest,xmlBody);
  Response response=sendRequest(httpRequest);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + issue.getId() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param issue the Issue to update on the server. issue.getId() is used for identification.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the required ID is not found
 * @throws RedmineException 
 */
public void updateIssue(Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getUpdateIssueURI(issue.getId());
  HttpPut httpRequest=new HttpPut(query);
  String NO_PROJECT_KEY=null;
  String xmlBody=RedmineXMLGenerator.toXML(NO_PROJECT_KEY,issue);
  setEntity(httpRequest,xmlBody);
  Response response=sendRequest(httpRequest);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + issue.getId() + "String_Node_Str");
  }
}
Program: 99561
Project: 99561
Buggy source:
/** 
 * Sample usage: <p> <pre>  {@code Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);}<p>
 * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.
 * @param issue the Issue object to create on the server.
 * @return the newly created Issue.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given projectKey is not found
 * @throws RedmineException 
 */
public Issue createIssue(String projectKey,Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getCreateIssueURI();
  HttpPost http=new HttpPost(query);
  String xmlBody=getIssueXML(projectKey,issue);
  setEntity(http,xmlBody);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Issue newIssue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return newIssue;
}

Fixed version (ground truth):
/** 
 * Sample usage: <p> <pre>  {@code Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);}<p>
 * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.
 * @param issue the Issue object to create on the server.
 * @return the newly created Issue.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given projectKey is not found
 * @throws RedmineException 
 */
public Issue createIssue(String projectKey,Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getCreateIssueURI();
  HttpPost http=new HttpPost(query);
  String xmlBody=RedmineXMLGenerator.toXML(projectKey,issue);
  setEntity(http,xmlBody);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Issue newIssue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return newIssue;
}
Program: 99562
Project: 99562
Buggy source:
private <T>T createObject(Class<T> classs,T obj) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  addAuthParameters(params);
  List<NameValuePair> paramsList=new ArrayList<NameValuePair>(params.values());
  URI uri=getCreateURI(obj.getClass(),paramsList);
  HttpPost http=new HttpPost(uri);
  String xml=RedmineXMLParser.convertObjectToXML(obj);
  setEntity((HttpEntityEnclosingRequest)http,xml);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + response.getBody());
  }
  return RedmineXMLParser.parseObjectFromXML(classs,response.getBody());
}

Fixed version (ground truth):
private <T>T createObject(Class<T> classs,T obj) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  addAuthParameters(params);
  List<NameValuePair> paramsList=new ArrayList<NameValuePair>(params.values());
  URI uri=getCreateURI(obj.getClass(),paramsList);
  HttpPost http=new HttpPost(uri);
  String xml=RedmineXMLGenerator.toXML(obj);
  setEntity((HttpEntityEnclosingRequest)http,xml);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + response.getBody());
  }
  return RedmineXMLParser.parseObjectFromXML(classs,response.getBody());
}
Program: 99563
Project: 99563
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((assignee == null) ? 0 : assignee.hashCode());
  result=prime * result + ((author == null) ? 0 : author.hashCode());
  result=prime * result + ((createdOn == null) ? 0 : createdOn.hashCode());
  result=prime * result + ((description == null) ? 0 : description.hashCode());
  result=prime * result + ((doneRatio == null) ? 0 : doneRatio.hashCode());
  result=prime * result + ((dueDate == null) ? 0 : dueDate.hashCode());
  result=prime * result + ((estimatedHours == null) ? 0 : estimatedHours.hashCode());
  result=prime * result + ((id == null) ? 0 : id.hashCode());
  result=prime * result + ((parentId == null) ? 0 : parentId.hashCode());
  result=prime * result + ((priorityText == null) ? 0 : priorityText.hashCode());
  result=prime * result + ((project == null) ? 0 : project.hashCode());
  result=prime * result + ((startDate == null) ? 0 : startDate.hashCode());
  result=prime * result + ((subject == null) ? 0 : subject.hashCode());
  result=prime * result + ((tracker == null) ? 0 : tracker.hashCode());
  result=prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((assignee == null) ? 0 : assignee.hashCode());
  result=prime * result + ((author == null) ? 0 : author.hashCode());
  result=prime * result + ((createdOn == null) ? 0 : createdOn.hashCode());
  result=prime * result + ((description == null) ? 0 : description.hashCode());
  result=prime * result + ((doneRatio == null) ? 0 : doneRatio.hashCode());
  result=prime * result + ((dueDate == null) ? 0 : dueDate.hashCode());
  result=prime * result + ((estimatedHours == null) ? 0 : estimatedHours.hashCode());
  result=prime * result + ((id == null) ? 0 : id.hashCode());
  result=prime * result + ((parentId == null) ? 0 : parentId.hashCode());
  result=prime * result + ((priorityText == null) ? 0 : priorityText.hashCode());
  result=prime * result + ((project == null) ? 0 : project.hashCode());
  result=prime * result + ((startDate == null) ? 0 : startDate.hashCode());
  result=prime * result + ((statusId == null) ? 0 : statusId.hashCode());
  result=prime * result + ((statusName == null) ? 0 : statusName.hashCode());
  result=prime * result + ((subject == null) ? 0 : subject.hashCode());
  result=prime * result + ((tracker == null) ? 0 : tracker.hashCode());
  result=prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
  return result;
}
Program: 99565
Project: 99565
Buggy source:
public TimeEntry getTimeEntry(Integer id) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  return getObject(TimeEntry.class,id);
}

Fixed version (ground truth):
/** 
 * @param id the database Id of the TimeEntry record
 * @return
 * @throws IOException
 * @throws AuthenticationException
 * @throws NotFoundException
 * @throws RedmineException
 */
public TimeEntry getTimeEntry(Integer id) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  return getObject(TimeEntry.class,id);
}
Program: 99566
Project: 99566
Buggy source:
@Test public void testProjectsAllPagesLoaded() throws IOException, AuthenticationException, NotFoundException, URISyntaxException {
  int NUM=27;
  List<Project> projects=createProjects(NUM);
  List<Project> loadedProjects=mgr.getProjects();
  assertTrue(loadedProjects.size() > NUM);
  deleteProjects(projects);
}

Fixed version (ground truth):
@Test public void testProjectsAllPagesLoaded() throws IOException, AuthenticationException, NotFoundException, URISyntaxException, RedmineException {
  int NUM=27;
  List<Project> projects=createProjects(NUM);
  List<Project> loadedProjects=mgr.getProjects();
  assertTrue(loadedProjects.size() > NUM);
  deleteProjects(projects);
}
Program: 99567
Project: 99567
Buggy source:
private void deleteProjects(List<Project> projects) throws IOException, AuthenticationException, NotFoundException {
  for (  Project p : projects) {
    mgr.deleteProject(p.getIdentifier());
  }
}

Fixed version (ground truth):
private void deleteProjects(List<Project> projects) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  for (  Project p : projects) {
    mgr.deleteProject(p.getIdentifier());
  }
}
Program: 99568
Project: 99568
Buggy source:
@Test public void testCreateProject() throws IOException, AuthenticationException, NotFoundException {
  Project projectToCreate=generateRandomProject();
  String key=null;
  try {
    Project createdProject=mgr.createProject(projectToCreate);
    key=createdProject.getIdentifier();
    assertNotNull("String_Node_Str",createdProject);
    assertEquals(projectToCreate.getIdentifier(),createdProject.getIdentifier());
    assertEquals(projectToCreate.getName(),createdProject.getName());
    assertEquals(projectToCreate.getDescription(),createdProject.getDescription());
    List<Tracker> trackers=createdProject.getTrackers();
    assertNotNull("String_Node_Str",trackers);
    assertTrue("String_Node_Str",!(trackers.isEmpty()));
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
 finally {
    if (key != null) {
      mgr.deleteProject(key);
    }
  }
}

Fixed version (ground truth):
@Test public void testCreateProject() throws IOException, AuthenticationException, NotFoundException, RedmineException {
  Project projectToCreate=generateRandomProject();
  String key=null;
  try {
    Project createdProject=mgr.createProject(projectToCreate);
    key=createdProject.getIdentifier();
    assertNotNull("String_Node_Str",createdProject);
    assertEquals(projectToCreate.getIdentifier(),createdProject.getIdentifier());
    assertEquals(projectToCreate.getName(),createdProject.getName());
    assertEquals(projectToCreate.getDescription(),createdProject.getDescription());
    List<Tracker> trackers=createdProject.getTrackers();
    assertNotNull("String_Node_Str",trackers);
    assertTrue("String_Node_Str",!(trackers.isEmpty()));
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
 finally {
    if (key != null) {
      mgr.deleteProject(key);
    }
  }
}
Program: 99569
Project: 99569
Buggy source:
@Test public void testGetUserById() throws IOException, AuthenticationException, NotFoundException {
  User loadedUser=mgr.getUserById(getOurUser().getId());
  assertEquals(getOurUser().getId(),loadedUser.getId());
  assertEquals(getOurUser().getLogin(),loadedUser.getLogin());
}

Fixed version (ground truth):
@Test public void testGetUserById() throws IOException, AuthenticationException, NotFoundException, RedmineException {
  User loadedUser=mgr.getUserById(getOurUser().getId());
  assertEquals(getOurUser().getId(),loadedUser.getId());
  assertEquals(getOurUser().getLogin(),loadedUser.getLogin());
}
Program: 99570
Project: 99570
Buggy source:
private List<Project> createProjects(int num) throws IOException, AuthenticationException, NotFoundException {
  List<Project> projects=new ArrayList<Project>(num);
  for (int i=0; i < num; i++) {
    Project projectToCreate=generateRandomProject();
    Project p=mgr.createProject(projectToCreate);
    projects.add(p);
  }
  return projects;
}

Fixed version (ground truth):
private List<Project> createProjects(int num) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  List<Project> projects=new ArrayList<Project>(num);
  for (int i=0; i < num; i++) {
    Project projectToCreate=generateRandomProject();
    Project p=mgr.createProject(projectToCreate);
    projects.add(p);
  }
  return projects;
}
Program: 99571
Project: 99571
Buggy source:
@Test public void testGetCurrentUser() throws IOException, AuthenticationException {
  User currentUser=mgr.getCurrentUser();
  assertEquals(getOurUser().getId(),currentUser.getId());
  assertEquals(getOurUser().getLogin(),currentUser.getLogin());
}

Fixed version (ground truth):
@Test public void testGetCurrentUser() throws IOException, AuthenticationException, RedmineException {
  User currentUser=mgr.getCurrentUser();
  assertEquals(getOurUser().getId(),currentUser.getId());
  assertEquals(getOurUser().getLogin(),currentUser.getLogin());
}
Program: 99572
Project: 99572
Buggy source:
@Test public void testCreateGetUpdateDeleteProject() throws IOException, AuthenticationException, NotFoundException {
  Project projectToCreate=generateRandomProject();
  String key=null;
  try {
    projectToCreate.setIdentifier("String_Node_Str" + new Date().getTime());
    System.out.println("String_Node_Str" + projectToCreate.getIdentifier());
    Project createdProject=mgr.createProject(projectToCreate);
    key=createdProject.getIdentifier();
    String newDescr="String_Node_Str";
    String newName="String_Node_Str";
    createdProject.setName(newName);
    createdProject.setDescription(newDescr);
    mgr.updateProject(createdProject);
    Project updatedProject=mgr.getProjectByIdentifier(key);
    assertNotNull(updatedProject);
    assertEquals(createdProject.getIdentifier(),updatedProject.getIdentifier());
    assertEquals(newName,updatedProject.getName());
    assertEquals(newDescr,updatedProject.getDescription());
    List<Tracker> trackers=updatedProject.getTrackers();
    assertNotNull("String_Node_Str",trackers);
    assertTrue("String_Node_Str",!(trackers.isEmpty()));
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
 finally {
    if (key != null) {
      mgr.deleteProject(key);
    }
  }
}

Fixed version (ground truth):
@Test public void testCreateGetUpdateDeleteProject() throws IOException, AuthenticationException, NotFoundException, RedmineException {
  Project projectToCreate=generateRandomProject();
  String key=null;
  try {
    projectToCreate.setIdentifier("String_Node_Str" + new Date().getTime());
    System.out.println("String_Node_Str" + projectToCreate.getIdentifier());
    Project createdProject=mgr.createProject(projectToCreate);
    key=createdProject.getIdentifier();
    String newDescr="String_Node_Str";
    String newName="String_Node_Str";
    createdProject.setName(newName);
    createdProject.setDescription(newDescr);
    mgr.updateProject(createdProject);
    Project updatedProject=mgr.getProjectByIdentifier(key);
    assertNotNull(updatedProject);
    assertEquals(createdProject.getIdentifier(),updatedProject.getIdentifier());
    assertEquals(newName,updatedProject.getName());
    assertEquals(newDescr,updatedProject.getDescription());
    List<Tracker> trackers=updatedProject.getTrackers();
    assertNotNull("String_Node_Str",trackers);
    assertTrue("String_Node_Str",!(trackers.isEmpty()));
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
 finally {
    if (key != null) {
      mgr.deleteProject(key);
    }
  }
}
Program: 99573
Project: 99573
Buggy source:
private void createIssues(int num) throws IOException, AuthenticationException, NotFoundException {
  for (int i=0; i < num; i++) {
    Issue issueToCreate=new Issue();
    issueToCreate.setSubject("String_Node_Str" + i + "String_Node_Str"+ new Date());
    mgr.createIssue(projectKey,issueToCreate);
  }
}

Fixed version (ground truth):
private void createIssues(int num) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  for (int i=0; i < num; i++) {
    Issue issueToCreate=new Issue();
    issueToCreate.setSubject("String_Node_Str" + i + "String_Node_Str"+ new Date());
    mgr.createIssue(projectKey,issueToCreate);
  }
}
Program: 99574
Project: 99574
Buggy source:
public User getCurrentUser() throws IOException, AuthenticationException {
  String query=getURLCurrentUser();
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}

Fixed version (ground truth):
public User getCurrentUser() throws IOException, AuthenticationException, RedmineException {
  String query=getURLCurrentUser();
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}
Program: 99575
Project: 99575
Buggy source:
public User getUserById(Integer userId) throws IOException, AuthenticationException, NotFoundException {
  String query=getURLUserById(userId);
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + userId + "String_Node_Str");
  }
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}

Fixed version (ground truth):
public User getUserById(Integer userId) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getURLUserById(userId);
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + userId + "String_Node_Str");
  }
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}
Program: 99576
Project: 99576
Buggy source:
/** 
 * Sample usage: <p> <pre>  {@code Project project = new Project(); Long timeStamp = Calendar.getInstance().getTimeInMillis(); String key = &quot;projkey&quot; + timeStamp; String name = &quot;project number &quot; + timeStamp; String description = &quot;some description for the project&quot;; project.setIdentifier(key); project.setName(name); project.setDescription(description); Project createdProject = mgr.createProject(project);}</pre>
 * @param project project to create on the server
 * @return the newly created Project object.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 */
public Project createProject(Project project) throws IOException, AuthenticationException {
  String query=buildCreateProjectURI();
  query+="String_Node_Str";
  HttpPost httpPost=new HttpPost(query);
  String createProjectXML=RedmineXMLParser.convertObjectToXML(project);
  setEntity(httpPost,createProjectXML);
  Response response=sendRequest(httpPost);
  Project createdProject=RedmineXMLParser.parseProjectFromXML(response.getBody());
  return createdProject;
}

Fixed version (ground truth):
/** 
 * Sample usage: <p> <pre>  {@code Project project = new Project(); Long timeStamp = Calendar.getInstance().getTimeInMillis(); String key = &quot;projkey&quot; + timeStamp; String name = &quot;project number &quot; + timeStamp; String description = &quot;some description for the project&quot;; project.setIdentifier(key); project.setName(name); project.setDescription(description); Project createdProject = mgr.createProject(project);}</pre>
 * @param project project to create on the server
 * @return the newly created Project object.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws RedmineException 
 */
public Project createProject(Project project) throws IOException, AuthenticationException, RedmineException {
  String query=buildCreateProjectURI();
  query+="String_Node_Str";
  HttpPost httpPost=new HttpPost(query);
  String createProjectXML=RedmineXMLParser.convertObjectToXML(project);
  setEntity(httpPost,createProjectXML);
  Response response=sendRequest(httpPost);
  Project createdProject=RedmineXMLParser.parseProjectFromXML(response.getBody());
  return createdProject;
}
Program: 99577
Project: 99577
Buggy source:
/** 
 * @param issue the Issue to update on the server. issue.getId() is used for identification.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the required ID is not found
 */
public void updateIssue(Issue issue) throws IOException, AuthenticationException, NotFoundException {
  String query=getUpdateIssueURI(issue.getId());
  HttpPut httpRequest=new HttpPut(query);
  String NO_PROJECT_KEY=null;
  String xmlBody=getIssueXML(NO_PROJECT_KEY,issue);
  setEntity(httpRequest,xmlBody);
  Response response=sendRequest(httpRequest);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + issue.getId() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param issue the Issue to update on the server. issue.getId() is used for identification.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the required ID is not found
 * @throws RedmineException 
 */
public void updateIssue(Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getUpdateIssueURI(issue.getId());
  HttpPut httpRequest=new HttpPut(query);
  String NO_PROJECT_KEY=null;
  String xmlBody=getIssueXML(NO_PROJECT_KEY,issue);
  setEntity(httpRequest,xmlBody);
  Response response=sendRequest(httpRequest);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + issue.getId() + "String_Node_Str");
  }
}
Program: 99578
Project: 99578
Buggy source:
private String getIssueXML(String projectKey,Issue issue){
  String xml="String_Node_Str";
  if (projectKey != null) {
    xml+="String_Node_Str" + projectKey + "String_Node_Str";
  }
  if (issue.getParentId() != null) {
    xml+="String_Node_Str" + issue.getParentId() + "String_Node_Str";
  }
  xml+="String_Node_Str" + issue.getSubject() + "String_Node_Str";
  if (issue.getTracker() != null) {
    xml+="String_Node_Str" + issue.getTracker().getId() + "String_Node_Str";
  }
  if (issue.getStartDate() != null) {
    String strDate=sdf.format(issue.getStartDate());
    xml+="String_Node_Str" + strDate + "String_Node_Str";
  }
  if (issue.getDueDate() != null) {
    String strDate=sdf.format(issue.getDueDate());
    xml+="String_Node_Str" + strDate + "String_Node_Str";
  }
  User ass=issue.getAssignee();
  if (ass != null) {
    xml+="String_Node_Str" + ass.getId() + "String_Node_Str";
  }
  if (issue.getEstimatedHours() != null) {
    xml+="String_Node_Str" + issue.getEstimatedHours() + "String_Node_Str";
  }
  if (issue.getDescription() != null) {
    xml+="String_Node_Str" + issue.getDescription() + "String_Node_Str";
  }
  xml+="String_Node_Str";
  return xml;
}

Fixed version (ground truth):
private String getIssueXML(String projectKey,Issue issue){
  String xml="String_Node_Str";
  if (projectKey != null) {
    xml+="String_Node_Str" + projectKey + "String_Node_Str";
  }
  if (issue.getParentId() != null) {
    xml+="String_Node_Str" + issue.getParentId() + "String_Node_Str";
  }
  if (issue.getSubject() != null) {
    xml+="String_Node_Str" + issue.getSubject() + "String_Node_Str";
  }
  if (issue.getTracker() != null) {
    xml+="String_Node_Str" + issue.getTracker().getId() + "String_Node_Str";
  }
  if (issue.getStartDate() != null) {
    String strDate=sdf.format(issue.getStartDate());
    xml+="String_Node_Str" + strDate + "String_Node_Str";
  }
  if (issue.getDueDate() != null) {
    String strDate=sdf.format(issue.getDueDate());
    xml+="String_Node_Str" + strDate + "String_Node_Str";
  }
  User ass=issue.getAssignee();
  if (ass != null) {
    xml+="String_Node_Str" + ass.getId() + "String_Node_Str";
  }
  if (issue.getEstimatedHours() != null) {
    xml+="String_Node_Str" + issue.getEstimatedHours() + "String_Node_Str";
  }
  if (issue.getDescription() != null) {
    xml+="String_Node_Str" + issue.getDescription() + "String_Node_Str";
  }
  xml+="String_Node_Str";
  return xml;
}
Program: 99579
Project: 99579
Buggy source:
/** 
 * @param projectKey string key like "project-ABC", NOT a database numeric ID
 * @return Redmine's project
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given key is not found
 */
public Project getProjectByIdentifier(String projectKey) throws IOException, AuthenticationException, NotFoundException {
  String query=getURLProjectByKey(projectKey);
  query+="String_Node_Str";
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Project projectFromServer=RedmineXMLParser.parseProjectFromXML(response.getBody());
  return projectFromServer;
}

Fixed version (ground truth):
/** 
 * @param projectKey string key like "project-ABC", NOT a database numeric ID
 * @return Redmine's project
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given key is not found
 * @throws RedmineException 
 */
public Project getProjectByIdentifier(String projectKey) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getURLProjectByKey(projectKey);
  query+="String_Node_Str";
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Project projectFromServer=RedmineXMLParser.parseProjectFromXML(response.getBody());
  return projectFromServer;
}
Program: 99580
Project: 99580
Buggy source:
/** 
 * Load the list of users on the server.
 * @return list of User objects
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws URISyntaxException 
 * @throws NotFoundException 
 */
public List<User> getUsers() throws IOException, AuthenticationException, NotFoundException, URISyntaxException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  return getObjectsListV104(User.class,params);
}

Fixed version (ground truth):
/** 
 * Load the list of users on the server.
 * @return list of User objects
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws URISyntaxException 
 * @throws NotFoundException 
 * @throws RedmineException 
 */
public List<User> getUsers() throws IOException, AuthenticationException, NotFoundException, URISyntaxException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  return getObjectsListV104(User.class,params);
}
Program: 99581
Project: 99581
Buggy source:
/** 
 * Sample usage: <p> <pre>  {@code Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);}<p>
 * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.
 * @param issue the Issue object to create on the server.
 * @return the newly created Issue.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given projectKey is not found
 */
public Issue createIssue(String projectKey,Issue issue) throws IOException, AuthenticationException, NotFoundException {
  String query=getCreateIssueURI();
  HttpPost http=new HttpPost(query);
  String xmlBody=getIssueXML(projectKey,issue);
  setEntity(http,xmlBody);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Issue newIssue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return newIssue;
}

Fixed version (ground truth):
/** 
 * Sample usage: <p> <pre>  {@code Issue issueToCreate = new Issue(); issueToCreate.setSubject("This is the summary line 123"); Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate);}<p>
 * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID.
 * @param issue the Issue object to create on the server.
 * @return the newly created Issue.
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the project with the given projectKey is not found
 * @throws RedmineException 
 */
public Issue createIssue(String projectKey,Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getCreateIssueURI();
  HttpPost http=new HttpPost(query);
  String xmlBody=getIssueXML(projectKey,issue);
  setEntity(http,xmlBody);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
  Issue newIssue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return newIssue;
}
Program: 99582
Project: 99582
Buggy source:
/** 
 * Load the list of projects available to the user, which is represented by the API access key.
 * @return list of Project objects
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException 
 */
public List<Project> getProjects() throws IOException, AuthenticationException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  try {
    return getObjectsListV104(Project.class,params);
  }
 catch (  NotFoundException e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Load the list of projects available to the user, which is represented by the API access key.
 * @return list of Project objects
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws RedmineException 
 * @throws NotFoundException 
 */
public List<Project> getProjects() throws IOException, AuthenticationException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  try {
    return getObjectsListV104(Project.class,params);
  }
 catch (  NotFoundException e) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 99583
Project: 99583
Buggy source:
/** 
 * There could be several issues with the same summary, so the method returns List. 
 * @param summaryField
 * @return empty list if not issues with this summary field exist, never NULL
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws URISyntaxException 
 * @throws NotFoundException 
 */
public List<Issue> getIssuesBySummary(String projectKey,String summaryField) throws IOException, AuthenticationException, NotFoundException, URISyntaxException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",summaryField));
  if ((projectKey != null) && (!projectKey.isEmpty())) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",projectKey));
  }
  return getObjectsListV104(Issue.class,params);
}

Fixed version (ground truth):
/** 
 * There could be several issues with the same summary, so the method returns List. 
 * @param summaryField
 * @return empty list if not issues with this summary field exist, never NULL
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws URISyntaxException 
 * @throws NotFoundException 
 * @throws RedmineException 
 */
public List<Issue> getIssuesBySummary(String projectKey,String summaryField) throws IOException, AuthenticationException, NotFoundException, URISyntaxException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",summaryField));
  if ((projectKey != null) && (!projectKey.isEmpty())) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",projectKey));
  }
  return getObjectsListV104(Issue.class,params);
}
Program: 99584
Project: 99584
Buggy source:
/** 
 * This method cannot return the updated object from Redmine because the server does not provide any XML in response.
 * @param user
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 */
public void updateUser(User user) throws IOException, AuthenticationException {
  String query=buildUpdateUserQuery(user.getId());
  HttpPut httpRequest=new HttpPut(query);
  String projectXML=RedmineXMLParser.convertObjectToXML(user);
  setEntity(httpRequest,projectXML);
  sendRequest(httpRequest);
}

Fixed version (ground truth):
/** 
 * This method cannot return the updated object from Redmine because the server does not provide any XML in response.
 * @param user
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws RedmineException 
 */
public void updateUser(User user) throws IOException, AuthenticationException, RedmineException {
  String query=buildUpdateUserQuery(user.getId());
  HttpPut httpRequest=new HttpPut(query);
  String projectXML=RedmineXMLParser.convertObjectToXML(user);
  setEntity(httpRequest,projectXML);
  sendRequest(httpRequest);
}
Program: 99585
Project: 99585
Buggy source:
private <T>List<T> getObjectsListV104(Class<T> objectClass,Map<String,NameValuePair> params) throws IOException, AuthenticationException, NotFoundException {
  List<T> objects=new ArrayList<T>();
  final int FIRST_REDMINE_PAGE=1;
  int pageNum=FIRST_REDMINE_PAGE;
  String firstPage=null;
  addPagingParameters(params);
  addAuthParameters(params);
  do {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",String.valueOf(pageNum)));
    List<NameValuePair> paramsList=new ArrayList<NameValuePair>(params.values());
    URI uri;
    try {
      uri=URIUtils.createURI(getProtocol(),getHost(),getPort(),urls.get(objectClass),URLEncodedUtils.format(paramsList,CHARSET),null);
    }
 catch (    URISyntaxException e) {
      throw new RuntimeException("String_Node_Str" + e.getMessage());
    }
    HttpGet http=new HttpGet(uri);
    Response response=sendRequest(http);
    if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
      throw new NotFoundException("String_Node_Str" + response.getBody());
    }
    String body=response.getBody();
    if (pageNum == FIRST_REDMINE_PAGE) {
      firstPage=body;
    }
 else {
      if (firstPage.equals(body)) {
        break;
      }
    }
    List<T> foundItems=RedmineXMLParser.parseObjectsFromXML(objectClass,body);
    if (foundItems.size() == 0) {
      break;
    }
    objects.addAll(foundItems);
    pageNum++;
  }
 while (true);
  return objects;
}

Fixed version (ground truth):
private <T>List<T> getObjectsListV104(Class<T> objectClass,Map<String,NameValuePair> params) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  List<T> objects=new ArrayList<T>();
  final int FIRST_REDMINE_PAGE=1;
  int pageNum=FIRST_REDMINE_PAGE;
  String firstPage=null;
  addPagingParameters(params);
  addAuthParameters(params);
  do {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",String.valueOf(pageNum)));
    List<NameValuePair> paramsList=new ArrayList<NameValuePair>(params.values());
    URI uri;
    try {
      uri=URIUtils.createURI(getProtocol(),getHost(),getPort(),urls.get(objectClass),URLEncodedUtils.format(paramsList,CHARSET),null);
    }
 catch (    URISyntaxException e) {
      throw new RuntimeException("String_Node_Str" + e.getMessage());
    }
    HttpGet http=new HttpGet(uri);
    Response response=sendRequest(http);
    if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
      throw new NotFoundException("String_Node_Str" + response.getBody());
    }
    String body=response.getBody();
    if (pageNum == FIRST_REDMINE_PAGE) {
      firstPage=body;
    }
 else {
      if (firstPage.equals(body)) {
        break;
      }
    }
    List<T> foundItems=RedmineXMLParser.parseObjectsFromXML(objectClass,body);
    if (foundItems.size() == 0) {
      break;
    }
    objects.addAll(foundItems);
    pageNum++;
  }
 while (true);
  return objects;
}
Program: 99586
Project: 99586
Buggy source:
/** 
 * @param projectKey string key like "project-ABC", NOT a database numeric ID
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException if the project with the given key is not found
 */
public void deleteProject(String projectKey) throws IOException, AuthenticationException, NotFoundException {
  String query=getURLProjectByKey(projectKey);
  HttpDelete http=new HttpDelete(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param projectKey string key like "project-ABC", NOT a database numeric ID
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException if the project with the given key is not found
 * @throws RedmineException 
 */
public void deleteProject(String projectKey) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getURLProjectByKey(projectKey);
  HttpDelete http=new HttpDelete(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + projectKey + "String_Node_Str");
  }
}
Program: 99587
Project: 99587
Buggy source:
/** 
 * @param project
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 */
public void updateProject(Project project) throws IOException, AuthenticationException {
  String query=buildUpdateProjectURI(project.getIdentifier());
  HttpPut httpRequest=new HttpPut(query);
  String projectXML=RedmineXMLParser.convertObjectToXML(project);
  setEntity(httpRequest,projectXML);
  sendRequest(httpRequest);
}

Fixed version (ground truth):
/** 
 * @param project
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws RedmineException 
 */
public void updateProject(Project project) throws IOException, AuthenticationException, RedmineException {
  String query=buildUpdateProjectURI(project.getIdentifier());
  HttpPut httpRequest=new HttpPut(query);
  String projectXML=RedmineXMLParser.convertObjectToXML(project);
  setEntity(httpRequest,projectXML);
  sendRequest(httpRequest);
}
Program: 99588
Project: 99588
Buggy source:
public User createUser(User user) throws IOException, AuthenticationException {
  String query=buildCreateUserQuery();
  HttpPost httpPost=new HttpPost(query);
  String xml=RedmineXMLParser.convertObjectToXML(user);
  setEntity(httpPost,xml);
  Response response=sendRequest(httpPost);
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}

Fixed version (ground truth):
public User createUser(User user) throws IOException, AuthenticationException, RedmineException {
  String query=buildCreateUserQuery();
  HttpPost httpPost=new HttpPost(query);
  String xml=RedmineXMLParser.convertObjectToXML(user);
  setEntity(httpPost,xml);
  Response response=sendRequest(httpPost);
  return RedmineXMLParser.parseUserFromXML(response.getBody());
}
Program: 99589
Project: 99589
Buggy source:
private Response sendRequest(HttpRequest request) throws ClientProtocolException, IOException, AuthenticationException {
  System.out.println(request.getRequestLine());
  DefaultHttpClient httpclient=new DefaultHttpClient();
  wrapClient(httpclient);
  HttpResponse httpResponse=httpclient.execute((HttpUriRequest)request);
  System.out.println(httpResponse.getStatusLine());
  int responseCode=httpResponse.getStatusLine().getStatusCode();
  if (responseCode == HttpStatus.SC_UNAUTHORIZED) {
    throw new AuthenticationException("String_Node_Str" + apiAccessKey);
  }
  HttpEntity responseEntity=httpResponse.getEntity();
  String responseBody=EntityUtils.toString(responseEntity);
  Response r=new Response(responseCode,responseBody);
  httpclient.getConnectionManager().shutdown();
  return r;
}

Fixed version (ground truth):
private Response sendRequest(HttpRequest request) throws ClientProtocolException, IOException, AuthenticationException, RedmineException {
  System.out.println(request.getRequestLine());
  DefaultHttpClient httpclient=new DefaultHttpClient();
  wrapClient(httpclient);
  HttpResponse httpResponse=httpclient.execute((HttpUriRequest)request);
  System.out.println(httpResponse.getStatusLine());
  int responseCode=httpResponse.getStatusLine().getStatusCode();
  if (responseCode == HttpStatus.SC_UNAUTHORIZED) {
    throw new AuthenticationException("String_Node_Str");
  }
  HttpEntity responseEntity=httpResponse.getEntity();
  String responseBody=EntityUtils.toString(responseEntity);
  if (responseCode == HttpStatus.SC_UNPROCESSABLE_ENTITY) {
    List<String> errors=RedmineXMLParser.parseErrors(responseBody);
    throw new RedmineException(errors);
  }
  Response r=new Response(responseCode,responseBody);
  httpclient.getConnectionManager().shutdown();
  return r;
}
Program: 99590
Project: 99590
Buggy source:
/** 
 * @param id the Redmine issue ID
 * @return Issue object
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the given id is not found on the server
 */
public Issue getIssueById(Integer id) throws IOException, AuthenticationException, NotFoundException {
  String query=getURLIssueById(id);
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str");
  }
  Issue issue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return issue;
}

Fixed version (ground truth):
/** 
 * @param id the Redmine issue ID
 * @return Issue object
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws NotFoundException the issue with the given id is not found on the server
 * @throws RedmineException 
 */
public Issue getIssueById(Integer id) throws IOException, AuthenticationException, NotFoundException, RedmineException {
  String query=getURLIssueById(id);
  HttpGet http=new HttpGet(query);
  Response response=sendRequest(http);
  if (response.getCode() == HttpStatus.SC_NOT_FOUND) {
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str");
  }
  Issue issue=RedmineXMLParser.parseIssueFromXML(response.getBody());
  return issue;
}
Program: 99591
Project: 99591
Buggy source:
/** 
 * @param projectKey
 * @param queryId id of the saved query in Redmine. the query must be accessible to the user represented by the API access key (if the Redmine project requires authorization).  This parameter is <b>optional<b>, NULL can be provided to get all available issues.
 * @return list of Issue objects
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @see Issue
 */
public List<Issue> getIssues(String projectKey,Integer queryId) throws IOException, AuthenticationException, NotFoundException, URISyntaxException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  if (queryId != null) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",String.valueOf(queryId)));
  }
  if ((projectKey != null) && (!projectKey.isEmpty())) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",projectKey));
  }
  List<Issue> issues=getObjectsListV104(Issue.class,params);
  return issues;
}

Fixed version (ground truth):
/** 
 * @param projectKey
 * @param queryId id of the saved query in Redmine. the query must be accessible to the user represented by the API access key (if the Redmine project requires authorization).  This parameter is <b>optional<b>, NULL can be provided to get all available issues.
 * @return list of Issue objects
 * @throws IOException
 * @throws AuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.
 * @throws RedmineException 
 * @see Issue
 */
public List<Issue> getIssues(String projectKey,Integer queryId) throws IOException, AuthenticationException, NotFoundException, URISyntaxException, RedmineException {
  Map<String,NameValuePair> params=new HashMap<String,NameValuePair>();
  if (queryId != null) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",String.valueOf(queryId)));
  }
  if ((projectKey != null) && (!projectKey.isEmpty())) {
    params.put("String_Node_Str",new BasicNameValuePair("String_Node_Str",projectKey));
  }
  List<Issue> issues=getObjectsListV104(Issue.class,params);
  return issues;
}