Program: 95868
Project: 95868
Buggy source:
/** 
 * @param repoLabel repoLabel
 * @param taskId the taskId
 * @param comments the comment entries
 * @param monitor the monitor to use
 * @return true if succeeded; false otherwise
 */
public static boolean createComment(String repoLabel,String taskId,List<CommentEntry> comments,IProgressMonitor monitor){
  boolean succeeded=false;
  TaskRepository repo=getRepositoryByLabel(repoLabel);
  try {
    TaskData taskData=getTaskDataByID(repo,taskId,monitor);
    if (taskData == null) {
      return succeeded;
    }
    ITask task=getTaskByID(repo,taskId,monitor);
    if (task != null) {
      ITaskDataManager taskDataManager=TasksUi.getTaskDataManager();
      ITaskDataWorkingCopy taskWorkingCopy=taskDataManager.createWorkingCopy(task,taskData);
      TaskDataModel taskModel=new TaskDataModel(repo,task,taskWorkingCopy);
      String connectorKind=repo.getConnectorKind();
      AbstractRepositoryConnector connector=TasksUi.getRepositoryConnector(connectorKind);
      AbstractTaskDataHandler taskDataHandler=connector.getTaskDataHandler();
      TaskAttribute rootData=taskModel.getTaskData().getRoot();
      CONNECTOR handle=determineConnectorHandling(connectorKind);
      TaskAttribute change=null;
switch (handle) {
case HP_ALM:
        change=hpAlmHandling(comments,rootData);
      break;
case DEFAULT:
default :
    change=defaultHandling(comments,rootData);
  break;
}
if (change == null) {
return succeeded;
}
taskModel.attributeChanged(change);
RepositoryResponse response=taskDataHandler.postTaskData(taskModel.getTaskRepository(),taskModel.getTaskData(),taskModel.getChangedOldAttributes(),monitor);
succeeded=RepositoryResponse.ResponseKind.TASK_UPDATED.equals(response.getReposonseKind());
}
}
 catch (CoreException e) {
LOG.error(e.getLocalizedMessage(),e);
}
return succeeded;
}

Fixed version (ground truth):
/** 
 * @param repoLabel repoLabel
 * @param taskId the taskId
 * @param comments the comment entries
 * @param monitor the monitor to use
 * @return true if succeeded; false otherwise
 */
public static boolean createComment(String repoLabel,String taskId,List<CommentEntry> comments,IProgressMonitor monitor){
  boolean succeeded=false;
  TaskRepository repo=getRepositoryByLabel(repoLabel);
  try {
    TaskData taskData=getTaskDataByID(repo,taskId,monitor);
    if (taskData == null) {
      return succeeded;
    }
    ITask task=getTaskByID(repo,taskData.getTaskId(),monitor);
    if (task != null) {
      ITaskDataManager taskDataManager=TasksUi.getTaskDataManager();
      ITaskDataWorkingCopy taskWorkingCopy=taskDataManager.createWorkingCopy(task,taskData);
      TaskDataModel taskModel=new TaskDataModel(repo,task,taskWorkingCopy);
      String connectorKind=repo.getConnectorKind();
      AbstractRepositoryConnector connector=TasksUi.getRepositoryConnector(connectorKind);
      AbstractTaskDataHandler taskDataHandler=connector.getTaskDataHandler();
      TaskAttribute rootData=taskModel.getTaskData().getRoot();
      CONNECTOR handle=determineConnectorHandling(connectorKind);
      TaskAttribute change=null;
switch (handle) {
case HP_ALM:
        change=hpAlmHandling(comments,rootData);
      break;
case DEFAULT:
default :
    change=defaultHandling(comments,rootData);
  break;
}
if (change == null) {
return succeeded;
}
taskModel.attributeChanged(change);
RepositoryResponse response=taskDataHandler.postTaskData(taskModel.getTaskRepository(),taskModel.getTaskData(),taskModel.getChangedOldAttributes(),monitor);
succeeded=RepositoryResponse.ResponseKind.TASK_UPDATED.equals(response.getReposonseKind());
}
}
 catch (CoreException e) {
LOG.error(e.getLocalizedMessage(),e);
}
return succeeded;
}