nus-yam/ex-repair huggingface dataset:
Program: 32229
Project: 32229
Buggy source:
private List<Double> getDataBin(int toBinningNum){
  int totalCnt=0;
  for (  HistogramUnit hu : this.histogram) {
    totalCnt+=hu.getHcnt();
  }
  List<Double> binBorders=new ArrayList<Double>();
  binBorders.add(Double.NEGATIVE_INFINITY);
  for (int j=1; j < toBinningNum; j++) {
    double s=(double)(j * totalCnt) / toBinningNum;
    int pos=locateHistogram(s);
    if (pos < 0) {
      break;
    }
    HistogramUnit chu=histogram.get(pos);
    HistogramUnit nhu=histogram.get(pos + 1);
    double d=s - sum(histogram.get(pos).getHval());
    double a=nhu.getHcnt() - chu.getHcnt();
    double b=2 * chu.getHcnt();
    double c=-2 * d;
    double z=0.0;
    if (Double.compare(a,0) == 0) {
      z=-1 * c / b;
    }
 else {
      z=(-1 * b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
    }
    double u=chu.getHval() + (nhu.getHval() - chu.getHval()) * z;
    binBorders.add(u);
  }
  return binBorders;
}

Fixed version (ground truth):
private List<Double> getDataBin(int toBinningNum){
  List<Double> binBorders=new ArrayList<Double>();
  binBorders.add(Double.NEGATIVE_INFINITY);
  if (histogram.size() <= toBinningNum) {
    for (int i=0; i < histogram.size() - 1; i++) {
      HistogramUnit chu=histogram.get(i);
      HistogramUnit nhu=histogram.get(i + 1);
      binBorders.add((chu.getHval() + nhu.getHval()) / 2);
    }
    return binBorders;
  }
  int totalCnt=0;
  for (  HistogramUnit hu : this.histogram) {
    totalCnt+=hu.getHcnt();
  }
  int currentPos=0;
  for (int j=1; j < toBinningNum; j++) {
    double s=(double)(j * totalCnt) / toBinningNum;
    int pos=locateHistogram(s,currentPos);
    if (pos < 0 || pos == currentPos) {
      continue;
    }
 else {
      HistogramUnit chu=histogram.get(pos);
      HistogramUnit nhu=histogram.get(pos + 1);
      double d=s - sum(histogram.get(pos).getHval());
      double a=nhu.getHcnt() - chu.getHcnt();
      double b=2 * chu.getHcnt();
      double c=-2 * d;
      double z=0.0;
      if (Double.compare(a,0) == 0) {
        z=-1 * c / b;
      }
 else {
        z=(-1 * b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
      }
      double u=chu.getHval() + (nhu.getHval() - chu.getHval()) * z;
      binBorders.add(u);
      currentPos=pos;
    }
  }
  return binBorders;
}
Program: 32230
Project: 32230
Buggy source:
@Override public void runVarStats(String binningInfo,DataBag databag) throws ExecException {
  String[] binningDataArr=StringUtils.split(binningInfo,CalculateStatsUDF.CATEGORY_VAL_SEPARATOR);
  log.info("String_Node_Str" + this.columnConfig.getColumnName() + "String_Node_Str"+ binningDataArr.length);
  columnConfig.setBinCategory(Arrays.asList(binningDataArr));
  statsCategoricalColumnInfo(databag,columnConfig);
}

Fixed version (ground truth):
@Override public void runVarStats(String binningInfo,DataBag databag) throws ExecException {
  String[] binningDataArr=StringUtils.split(binningInfo,CalculateStatsUDF.CATEGORY_VAL_SEPARATOR);
  log.info("String_Node_Str" + this.columnConfig.getColumnName() + "String_Node_Str"+ binningDataArr.length);
  columnConfig.setBinCategory(Arrays.asList(binningDataArr));
  categoricalBinMap=new HashMap<String,Integer>(columnConfig.getBinCategory().size());
  for (int i=0; i < columnConfig.getBinCategory().size(); i++) {
    categoricalBinMap.put(columnConfig.getBinCategory().get(i),Integer.valueOf(i));
  }
  statsCategoricalColumnInfo(databag,columnConfig);
}
Program: 32232
Project: 32232
Buggy source:
private String promptBranchName() throws MojoFailureException, CommandLineException {
  final String featureBranches=gitFindBranches(gitFlowConfig.getFeatureBranchPrefix(),false);
  if (StringUtils.isBlank(featureBranches)) {
    throw new MojoFailureException("String_Node_Str");
  }
  final String[] branches=featureBranches.split("String_Node_Str");
  List<String> numberedList=new ArrayList<String>();
  StringBuilder str=new StringBuilder("String_Node_Str").append(LS);
  for (int i=0; i < branches.length; i++) {
    str.append((i + 1) + "String_Node_Str" + branches[i]+ LS);
    numberedList.add(String.valueOf(i + 1));
  }
  str.append("String_Node_Str");
  String featureNumber=null;
  try {
    while (StringUtils.isBlank(featureNumber)) {
      featureNumber=prompter.prompt(str.toString(),numberedList);
    }
  }
 catch (  PrompterException e) {
    getLog().error(e);
  }
  String featureBranchName=null;
  if (featureNumber != null) {
    int num=Integer.parseInt(featureNumber);
    featureBranchName=branches[num - 1];
  }
  return featureBranchName;
}

Fixed version (ground truth):
private String promptBranchName() throws MojoFailureException, CommandLineException {
  final String featureBranches=gitFindBranches(gitFlowConfig.getFeatureBranchPrefix(),false);
  if (StringUtils.isBlank(featureBranches)) {
    throw new MojoFailureException("String_Node_Str");
  }
  final String[] branches=featureBranches.split("String_Node_Str");
  List<String> numberedList=new ArrayList<String>();
  StringBuilder str=new StringBuilder("String_Node_Str").append(LS);
  for (int i=0; i < branches.length; i++) {
    str.append((i + 1) + "String_Node_Str" + branches[i]+ LS);
    numberedList.add(String.valueOf(i + 1));
  }
  str.append("String_Node_Str");
  String featureNumber=null;
  try {
    while (StringUtils.isBlank(featureNumber)) {
      featureNumber=prompter.prompt(str.toString(),numberedList);
    }
  }
 catch (  PrompterException e) {
    throw new MojoFailureException("String_Node_Str",e);
  }
  String featureBranchName=null;
  if (featureNumber != null) {
    int num=Integer.parseInt(featureNumber);
    featureBranchName=branches[num - 1];
  }
  return featureBranchName;
}
Program: 32235
Project: 32235
Buggy source:
private String promptBranchName() throws MojoFailureException, CommandLineException {
  final String hotfixBranches=gitFindBranches(gitFlowConfig.getHotfixBranchPrefix(),false);
  if (StringUtils.isBlank(hotfixBranches)) {
    throw new MojoFailureException("String_Node_Str");
  }
  String[] branches=hotfixBranches.split("String_Node_Str");
  List<String> numberedList=new ArrayList<String>();
  StringBuilder str=new StringBuilder("String_Node_Str").append(LS);
  for (int i=0; i < branches.length; i++) {
    str.append((i + 1) + "String_Node_Str" + branches[i]+ LS);
    numberedList.add(String.valueOf(i + 1));
  }
  str.append("String_Node_Str");
  String hotfixNumber=null;
  try {
    while (StringUtils.isBlank(hotfixNumber)) {
      hotfixNumber=prompter.prompt(str.toString(),numberedList);
    }
  }
 catch (  PrompterException e) {
    getLog().error(e);
  }
  String hotfixBranchName=null;
  if (hotfixNumber != null) {
    int num=Integer.parseInt(hotfixNumber);
    hotfixBranchName=branches[num - 1];
  }
  return hotfixBranchName;
}

Fixed version (ground truth):
private String promptBranchName() throws MojoFailureException, CommandLineException {
  final String hotfixBranches=gitFindBranches(gitFlowConfig.getHotfixBranchPrefix(),false);
  if (StringUtils.isBlank(hotfixBranches)) {
    throw new MojoFailureException("String_Node_Str");
  }
  String[] branches=hotfixBranches.split("String_Node_Str");
  List<String> numberedList=new ArrayList<String>();
  StringBuilder str=new StringBuilder("String_Node_Str").append(LS);
  for (int i=0; i < branches.length; i++) {
    str.append((i + 1) + "String_Node_Str" + branches[i]+ LS);
    numberedList.add(String.valueOf(i + 1));
  }
  str.append("String_Node_Str");
  String hotfixNumber=null;
  try {
    while (StringUtils.isBlank(hotfixNumber)) {
      hotfixNumber=prompter.prompt(str.toString(),numberedList);
    }
  }
 catch (  PrompterException e) {
    throw new MojoFailureException("String_Node_Str",e);
  }
  String hotfixBranchName=null;
  if (hotfixNumber != null) {
    int num=Integer.parseInt(hotfixNumber);
    hotfixBranchName=branches[num - 1];
  }
  return hotfixBranchName;
}
Program: 32240
Project: 32240
Buggy source:
private String getReleaseVersion() throws MojoFailureException, VersionParseException, CommandLineException {
  final String currentVersion=getCurrentProjectVersion();
  String defaultVersion=null;
  if (tychoBuild) {
    defaultVersion=currentVersion;
  }
 else {
    defaultVersion=new GitFlowVersionInfo(currentVersion).getReleaseVersionString();
  }
  if (defaultVersion == null) {
    throw new MojoFailureException("String_Node_Str");
  }
  String version=null;
  if (settings.isInteractiveMode()) {
    try {
      while (version == null) {
        version=prompter.prompt("String_Node_Str" + defaultVersion + "String_Node_Str");
        if (!"String_Node_Str".equals(version) && (!GitFlowVersionInfo.isValidVersion(version) || !validBranchName(version))) {
          getLog().info("String_Node_Str");
          version=null;
        }
      }
    }
 catch (    PrompterException e) {
      getLog().error(e);
    }
  }
 else {
    version=releaseVersion;
  }
  if (StringUtils.isBlank(version)) {
    version=defaultVersion;
  }
  return version;
}

Fixed version (ground truth):
private String getReleaseVersion() throws MojoFailureException, VersionParseException, CommandLineException {
  final String currentVersion=getCurrentProjectVersion();
  String defaultVersion=null;
  if (tychoBuild) {
    defaultVersion=currentVersion;
  }
 else {
    defaultVersion=new GitFlowVersionInfo(currentVersion).getReleaseVersionString();
  }
  if (defaultVersion == null) {
    throw new MojoFailureException("String_Node_Str");
  }
  String version=null;
  if (settings.isInteractiveMode()) {
    try {
      while (version == null) {
        version=prompter.prompt("String_Node_Str" + defaultVersion + "String_Node_Str");
        if (!"String_Node_Str".equals(version) && (!GitFlowVersionInfo.isValidVersion(version) || !validBranchName(version))) {
          getLog().info("String_Node_Str");
          version=null;
        }
      }
    }
 catch (    PrompterException e) {
      throw new MojoFailureException("String_Node_Str",e);
    }
  }
 else {
    version=releaseVersion;
  }
  if (StringUtils.isBlank(version)) {
    version=defaultVersion;
  }
  return version;
}
Program: 32242
Project: 32242
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  validateConfiguration();
  try {
    initGitFlowConfig();
    checkUncommittedChanges();
    String tagsStr=gitFindTags();
    if (StringUtils.isBlank(tagsStr)) {
      throw new MojoFailureException("String_Node_Str");
    }
    String tagName=null;
    try {
      tagName=prompter.prompt("String_Node_Str",Arrays.asList(tagsStr.split("String_Node_Str")));
    }
 catch (    PrompterException e) {
      getLog().error(e);
    }
    final boolean supportBranchExists=gitCheckBranchExists(gitFlowConfig.getSupportBranchPrefix() + tagName);
    if (supportBranchExists) {
      throw new MojoFailureException("String_Node_Str");
    }
    gitCreateAndCheckout(gitFlowConfig.getSupportBranchPrefix() + tagName,tagName);
    if (installProject) {
      mvnCleanInstall();
    }
    if (pushRemote) {
      gitPush(gitFlowConfig.getSupportBranchPrefix() + tagName,false);
    }
  }
 catch (  CommandLineException e) {
    getLog().error(e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  validateConfiguration();
  try {
    initGitFlowConfig();
    checkUncommittedChanges();
    String tagsStr=gitFindTags();
    if (StringUtils.isBlank(tagsStr)) {
      throw new MojoFailureException("String_Node_Str");
    }
    String tagName=null;
    try {
      tagName=prompter.prompt("String_Node_Str",Arrays.asList(tagsStr.split("String_Node_Str")));
    }
 catch (    PrompterException e) {
      throw new MojoFailureException("String_Node_Str",e);
    }
    final boolean supportBranchExists=gitCheckBranchExists(gitFlowConfig.getSupportBranchPrefix() + tagName);
    if (supportBranchExists) {
      throw new MojoFailureException("String_Node_Str");
    }
    gitCreateAndCheckout(gitFlowConfig.getSupportBranchPrefix() + tagName,tagName);
    if (installProject) {
      mvnCleanInstall();
    }
    if (pushRemote) {
      gitPush(gitFlowConfig.getSupportBranchPrefix() + tagName,false);
    }
  }
 catch (  CommandLineException e) {
    throw new MojoFailureException("String_Node_Str",e);
  }
}
Program: 32246
Project: 32246
Buggy source:
/** 
 * Checks uncommitted changes.
 * @throws MojoFailureException
 */
protected void checkUncommittedChanges() throws MojoFailureException {
  if (executeGitHasUncommitted()) {
    throw new MojoFailureException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Checks uncommitted changes.
 * @throws MojoFailureException
 * @throws CommandLineException
 */
protected void checkUncommittedChanges() throws MojoFailureException, CommandLineException {
  if (executeGitHasUncommitted()) {
    throw new MojoFailureException("String_Node_Str");
  }
}
Program: 32247
Project: 32247
Buggy source:
/** 
 * Executes Git command.
 * @param args Git command line arguments.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected void executeGitCommand(final String... args) throws CommandLineException, MojoFailureException {
  executeCommand(cmdGit,false,args);
}

Fixed version (ground truth):
/** 
 * Executes Git command.
 * @param args Git command line arguments.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected void executeGitCommand(final String... args) throws CommandLineException, MojoFailureException {
  executeCommand(cmdGit,false,false,args);
}
Program: 32248
Project: 32248
Buggy source:
/** 
 * Executes Git command and returns output.
 * @param args Git command line arguments.
 * @return Command output.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected String executeGitCommandReturn(final String... args) throws CommandLineException, MojoFailureException {
  return executeCommand(cmdGit,true,args);
}

Fixed version (ground truth):
/** 
 * Executes Git command and returns output.
 * @param args Git command line arguments.
 * @return Command output.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected String executeGitCommandReturn(final String... args) throws CommandLineException, MojoFailureException {
  return executeCommand(cmdGit,true,false,args);
}
Program: 32249
Project: 32249
Buggy source:
/** 
 * Executes Git commands to check for uncommitted changes.
 * @return <code>true</code> when there are uncommitted changes,<code>false</code> otherwise.
 */
protected boolean executeGitHasUncommitted(){
  try {
    executeGitCommand("String_Node_Str","String_Node_Str","String_Node_Str");
    final String untracked=executeGitCommandReturn("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    if (StringUtils.isNotBlank(untracked)) {
      return true;
    }
  }
 catch (  Exception e) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Executes Git commands to check for uncommitted changes.
 * @return <code>true</code> when there are uncommitted changes,<code>false</code> otherwise.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected boolean executeGitHasUncommitted() throws MojoFailureException, CommandLineException {
  boolean uncommited=false;
  final String diffExitCode=executeGitCommandExitCode("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  if ("String_Node_Str".equals(diffExitCode)) {
    final String diffIndexExitCode=executeGitCommandExitCode("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    if (!"String_Node_Str".equals(diffIndexExitCode)) {
      uncommited=true;
    }
  }
 else {
    uncommited=true;
  }
  return uncommited;
}
Program: 32250
Project: 32250
Buggy source:
/** 
 * Executes Maven command.
 * @param args Maven command line arguments.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected void executeMvnCommand(final String... args) throws CommandLineException, MojoFailureException {
  executeCommand(cmdMvn,false,args);
}

Fixed version (ground truth):
/** 
 * Executes Maven command.
 * @param args Maven command line arguments.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
protected void executeMvnCommand(final String... args) throws CommandLineException, MojoFailureException {
  executeCommand(cmdMvn,false,false,args);
}
Program: 32251
Project: 32251
Buggy source:
/** 
 * Executes command line.
 * @param cmd Command line.
 * @param returnOut Whether to return output. When <code>true</code> the output will not be printed into the console and will be returned from this method.
 * @param args Command line arguments.
 * @return Output of the command or empty String depending on the @paramreturnOut value.
 * @throws CommandLineException
 * @throws MojoFailureException
 */
private String executeCommand(final Commandline cmd,final boolean returnOut,final String... args) throws CommandLineException, MojoFailureException {
  initExecutables();
  if (getLog().isDebugEnabled()) {
    getLog().debug(cmd.getExecutable() + "String_Node_Str" + StringUtils.join(args,"String_Node_Str"));
  }
  cmd.clearArgs();
  cmd.addArguments(args);
  StreamConsumer out=null;
  if (returnOut) {
    out=new CommandLineUtils.StringStreamConsumer();
  }
 else {
    out=new DefaultConsumer();
  }
  CommandLineUtils.StringStreamConsumer err=new CommandLineUtils.StringStreamConsumer();
  final int exitCode=CommandLineUtils.executeCommandLine(cmd,out,err);
  if (exitCode != 0) {
    throw new MojoFailureException(err.getOutput());
  }
  String ret="String_Node_Str";
  if (returnOut && out instanceof StringStreamConsumer) {
    ret=((StringStreamConsumer)out).getOutput();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Executes command line.
 * @param cmd Command line.
 * @param returnOut Whether to return output. When <code>true</code> the output will not be printed into the console and will be returned from this method.
 * @param returnExitCode If <code>true</code> the exit code of the command will be returned, if <code>false</code> the output of the command will be returned. Will not have effect if the <code>returnOut</code> parameter is set to <code>false</code>.
 * @param args Command line arguments.
 * @return Output of the command or exit code or empty String depending onthe parameters values.
 * @throws CommandLineException
 * @throws MojoFailureException If <code>returnExitCode</code> is <code>false</code> and command exit code is NOT equals to 0.
 */
private String executeCommand(final Commandline cmd,final boolean returnOut,final boolean returnExitCode,final String... args) throws CommandLineException, MojoFailureException {
  initExecutables();
  if (getLog().isDebugEnabled()) {
    getLog().debug(cmd.getExecutable() + "String_Node_Str" + StringUtils.join(args,"String_Node_Str"));
  }
  cmd.clearArgs();
  cmd.addArguments(args);
  StreamConsumer out=null;
  if (returnOut) {
    out=new CommandLineUtils.StringStreamConsumer();
  }
 else {
    out=new DefaultConsumer();
  }
  CommandLineUtils.StringStreamConsumer err=new CommandLineUtils.StringStreamConsumer();
  final int exitCode=CommandLineUtils.executeCommandLine(cmd,out,err);
  if (!returnExitCode && exitCode != 0) {
    throw new MojoFailureException(err.getOutput());
  }
  String ret="String_Node_Str";
  if (returnOut) {
    if (returnExitCode) {
      ret="String_Node_Str" + exitCode;
    }
 else     if (out instanceof StringStreamConsumer) {
      ret=((StringStreamConsumer)out).getOutput();
    }
  }
  return ret;
}
Program: 32252
Project: 32252
Buggy source:
@Override public void onSend(Device device,CommandType type,int frequency,int timezone,int radius,String phoneNumber,String message,String rawCommand){
  Command command=new Command();
  command.setType(type);
  command.setDeviceId((int)device.getId());
  command.setAttributes(new HashMap<String,Object>());
switch (type) {
case positionPeriodic:
    command.getAttributes().put(CommandType.KEY_FREQUENCY,frequency);
  break;
case setTimezone:
command.getAttributes().put(CommandType.KEY_TIMEZONE,timezone);
break;
case movementAlarm:
command.getAttributes().put(CommandType.KEY_RADIUS,radius);
break;
case sendSms:
command.getAttributes().put(CommandType.KEY_PHONE_NUMBER,phoneNumber);
command.getAttributes().put(CommandType.KEY_MESSAGE,message);
break;
case CUSTOM:
command.setCommand(rawCommand);
break;
}
final Messages i18n=GWT.create(Messages.class);
RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,"String_Node_Str");
try {
builder.sendRequest("String_Node_Str" + commandMapper.write(command) + "String_Node_Str",new RequestCallback(){
@Override public void onResponseReceived(Request request,Response response){
new LogViewDialog("String_Node_Str" + response.getText() + "String_Node_Str").show();
}
@Override public void onError(Request request,Throwable exception){
new AlertMessageBox(i18n.error(),i18n.errRemoteCall());
}
}
);
}
 catch (RequestException e) {
new AlertMessageBox(i18n.error(),e.getLocalizedMessage());
e.printStackTrace();
}
}

Fixed version (ground truth):
@Override public void onSend(Device device,CommandType type,int frequency,int timezone,int radius,String phoneNumber,String message,String rawCommand){
  Command command=new Command();
  command.setType(type);
  command.setDeviceId((int)device.getId());
  command.setAttributes(new HashMap<String,Object>());
switch (type) {
case positionPeriodic:
    command.getAttributes().put(CommandType.KEY_FREQUENCY,frequency);
  break;
case setTimezone:
command.getAttributes().put(CommandType.KEY_TIMEZONE,timezone);
break;
case movementAlarm:
command.getAttributes().put(CommandType.KEY_RADIUS,radius);
break;
case sendSms:
command.getAttributes().put(CommandType.KEY_PHONE_NUMBER,phoneNumber);
command.getAttributes().put(CommandType.KEY_MESSAGE,message);
break;
case custom:
command.setCommand(rawCommand);
break;
}
final Messages i18n=GWT.create(Messages.class);
RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,"String_Node_Str");
try {
builder.sendRequest("String_Node_Str" + commandMapper.write(command) + "String_Node_Str",new RequestCallback(){
@Override public void onResponseReceived(Request request,Response response){
new LogViewDialog("String_Node_Str" + response.getText() + "String_Node_Str").show();
}
@Override public void onError(Request request,Throwable exception){
new AlertMessageBox(i18n.error(),i18n.errRemoteCall());
}
}
);
}
 catch (RequestException e) {
new AlertMessageBox(i18n.error(),e.getLocalizedMessage());
e.printStackTrace();
}
}
Program: 32253
Project: 32253
Buggy source:
private void toggleUI(CommandType type){
  lblFrequency.setVisible(type == CommandType.positionPeriodic);
  frequency.setVisible(type == CommandType.positionPeriodic);
  frequencyUnit.setVisible(type == CommandType.positionPeriodic);
  lblCustomMessage.setVisible(type == CommandType.CUSTOM);
  customMessage.setVisible(type == CommandType.CUSTOM);
  lblTimeZone.setVisible(type == CommandType.setTimezone);
  timeZone.setVisible(type == CommandType.setTimezone);
  lblRadius.setVisible(type == CommandType.movementAlarm);
  radius.setVisible(type == CommandType.movementAlarm);
  lblPhoneNumber.setVisible(type == CommandType.sendSms);
  phoneNumber.setVisible(type == CommandType.sendSms);
  lblMessage.setVisible(type == CommandType.sendSms);
  message.setVisible(type == CommandType.sendSms);
  window.forceLayout();
}

Fixed version (ground truth):
private void toggleUI(CommandType type){
  lblFrequency.setVisible(type == CommandType.positionPeriodic);
  frequency.setVisible(type == CommandType.positionPeriodic);
  frequencyUnit.setVisible(type == CommandType.positionPeriodic);
  lblCustomMessage.setVisible(type == CommandType.custom);
  customMessage.setVisible(type == CommandType.custom);
  lblTimeZone.setVisible(type == CommandType.setTimezone);
  timeZone.setVisible(type == CommandType.setTimezone);
  lblRadius.setVisible(type == CommandType.movementAlarm);
  radius.setVisible(type == CommandType.movementAlarm);
  lblPhoneNumber.setVisible(type == CommandType.sendSms);
  phoneNumber.setVisible(type == CommandType.sendSms);
  lblMessage.setVisible(type == CommandType.sendSms);
  message.setVisible(type == CommandType.sendSms);
  window.forceLayout();
}
Program: 32254
Project: 32254
Buggy source:
private void initMapLayers(Map map){
  for (  UserSettings.MapType mapType : UserSettings.MapType.values()) {
    if (mapType.isBing() && (ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey() == null || ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey().trim().isEmpty())) {
      continue;
    }
    map.addLayer(createMap(mapType));
  }
}

Fixed version (ground truth):
private void initMapLayers(Map map){
  for (  UserSettings.MapType mapType : UserSettings.MapType.values()) {
    if (mapType.isBing() && (ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey() == null || ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey().trim().isEmpty())) {
      continue;
    }
    Layer mapLayer=createMap(mapType);
    try {
      map.addLayer(mapLayer);
    }
 catch (    Exception ex) {
      GWT.log("String_Node_Str" + mapType,ex);
      map.removeLayer(mapLayer);
    }
  }
}
Program: 32255
Project: 32255
Buggy source:
@Override public void serialize(DeviceIconType deviceIcon,JsonGenerator json,SerializerProvider serializerProvider) throws IOException {
  json.writeStartObject();
  for (  Position.Status status : Position.Status.values()) {
    json.writeObjectFieldStart(status.name());
    PositionIconType positionIcon=deviceIcon.getPositionIconType(status);
    json.writeNumberField("String_Node_Str",positionIcon.getWidth());
    json.writeNumberField("String_Node_Str",positionIcon.getHeight());
    json.writeArrayFieldStart("String_Node_Str");
    json.writeString(positionIcon.getURL(false));
    json.writeString(positionIcon.getURL(true));
    json.writeEndArray();
    json.writeEndObject();
  }
  json.writeEndObject();
}

Fixed version (ground truth):
@Override public void serialize(DeviceIconType deviceIcon,JsonGenerator json,SerializerProvider serializerProvider) throws IOException {
  json.writeStartObject();
  json.writeStringField("String_Node_Str",deviceIcon.name());
  for (  Position.Status status : Position.Status.values()) {
    json.writeObjectFieldStart(status.name());
    PositionIconType positionIcon=deviceIcon.getPositionIconType(status);
    json.writeNumberField("String_Node_Str",positionIcon.getWidth());
    json.writeNumberField("String_Node_Str",positionIcon.getHeight());
    json.writeArrayFieldStart("String_Node_Str");
    json.writeString(positionIcon.getURL(false));
    json.writeString(positionIcon.getURL(true));
    json.writeEndArray();
    json.writeEndObject();
  }
  json.writeEndObject();
}
Program: 32256
Project: 32256
Buggy source:
static ObjectMapper create(){
  ObjectMapper mapper=new ObjectMapper();
  mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
  mapper.enable(SerializationFeature.INDENT_OUTPUT);
  mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  mapper.setDateFormat(dateFormat);
  mapper.getDeserializationConfig().with(dateFormat);
  SimpleModule module=new SimpleModule();
  module.addSerializer(DeviceIconType.class,new DeviceIconTypeSerializer());
  mapper.registerModule(module);
  return mapper;
}

Fixed version (ground truth):
static ObjectMapper create(){
  ObjectMapper mapper=new ObjectMapper();
  mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
  mapper.enable(SerializationFeature.INDENT_OUTPUT);
  mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  mapper.setDateFormat(dateFormat);
  mapper.getDeserializationConfig().with(dateFormat);
  SimpleModule module=new SimpleModule();
  module.addSerializer(DeviceIconType.class,new DeviceIconTypeSerializer());
  module.addDeserializer(DeviceIconType.class,new DeviceIconTypeDeserializer());
  mapper.registerModule(module);
  return mapper;
}
Program: 32258
Project: 32258
Buggy source:
private void testDefaultPositionIconType(JsonNode jsonDeviceIconType,Position.Status status,String iconTypeString){
  PositionIconType positionIconType=DeviceIconType.DEFAULT.getPositionIconType(status);
  JsonNode jsonPositionIconType=jsonDeviceIconType.get(iconTypeString);
  assertEquals(positionIconType.getWidth(),jsonPositionIconType.get("String_Node_Str").asInt());
  assertEquals(positionIconType.getHeight(),jsonPositionIconType.get("String_Node_Str").asInt());
  Iterator<JsonNode> urls=jsonPositionIconType.get("String_Node_Str").elements();
  assertEquals(positionIconType.getURL(false),urls.next().asText());
  assertEquals(positionIconType.getURL(true),urls.next().asText());
}

Fixed version (ground truth):
private void testDefaultPositionIconType(JsonNode jsonDeviceIconType,Position.Status status,String iconTypeString){
  PositionIconType positionIconType=DeviceIconType.DEFAULT.getPositionIconType(status);
  JsonNode jsonPositionIconType=jsonDeviceIconType.get(iconTypeString);
  assertEquals(positionIconType.getWidth(),jsonPositionIconType.get("String_Node_Str").asInt());
  assertEquals(positionIconType.getHeight(),jsonPositionIconType.get("String_Node_Str").asInt());
  Iterator<JsonNode> urls=jsonPositionIconType.get("String_Node_Str").elements();
  assertEquals(positionIconType.getURL(false),urls.next().asText());
  assertEquals(positionIconType.getURL(true),urls.next().asText());
  assertEquals(DeviceIconType.DEFAULT.name(),jsonDeviceIconType.get("String_Node_Str").asText());
}
Program: 32261
Project: 32261
Buggy source:
public void flush(){
  if (iconModeIcon.getValue()) {
    device.setIconMode(DeviceIconMode.ICON);
  }
 else   if (iconModeArrow.getValue()) {
    device.setIconMode(DeviceIconMode.ARROW);
  }
  device.setIconRotation(iconRotation.getValue());
  device.setShowName(showName.getValue());
  for (  ColorSelector colorSelector : arrowColors) {
    colorSelector.flush(device);
  }
  selected=view.getSelectionModel().getSelectedItem();
  device.setIconType(selected.getBuiltInIcon());
  device.setIcon(selected.getDatabaseIcon());
}

Fixed version (ground truth):
public void flush(){
  if (iconModeIcon.getValue()) {
    device.setIconMode(DeviceIconMode.ICON);
  }
 else   if (iconModeArrow.getValue()) {
    device.setIconMode(DeviceIconMode.ARROW);
  }
  device.setIconRotation(iconRotation.getValue());
  device.setShowName(showName.getValue());
  for (  ColorSelector colorSelector : arrowColors) {
    colorSelector.flush(device);
  }
  selected=view.getSelectionModel().getSelectedItem();
  if (selected != null) {
    device.setIconType(selected.getBuiltInIcon());
    device.setIcon(selected.getDatabaseIcon());
  }
}
Program: 32262
Project: 32262
Buggy source:
List<Device> devices(GroupedDevice node){
  List<Device> result=new ArrayList<>();
  for (  GroupedDevice child : deviceStore.getAllChildren(node)) {
    if (child instanceof Device) {
      result.add((Device)child);
    }
  }
  return result;
}

Fixed version (ground truth):
List<Device> devices(GroupedDevice node){
  if (deviceStore.contains(node)) {
    List<Device> result=new ArrayList<>();
    for (    GroupedDevice child : deviceStore.getAllChildren(node)) {
      if (child instanceof Device) {
        result.add((Device)child);
      }
    }
    return result;
  }
 else {
    return Collections.emptyList();
  }
}
Program: 32263
Project: 32263
Buggy source:
@Override public void onRemove(StoreRemoveEvent event){
  pendingDevices.addAll(devices((GroupedDevice)event.getItem()));
  Group parent=(Group)deviceStore.getParent((GroupedDevice)event.getItem());
  deviceStore.remove((GroupedDevice)event.getItem());
  if (parent != null) {
    removeGroupsIfEmpty(parent);
  }
}

Fixed version (ground truth):
@Override public void onRemove(StoreRemoveEvent event){
  GroupedDevice node=(GroupedDevice)event.getItem();
  if (deviceStore.contains(node)) {
    pendingDevices.addAll(devices(node));
    Group parent=(Group)deviceStore.getParent(node);
    deviceStore.remove(node);
    if (parent != null) {
      removeGroupsIfEmpty(parent);
    }
  }
}
Program: 32264
Project: 32264
Buggy source:
public void setDescription(String description){
  this.description=description;
}

Fixed version (ground truth):
@JsonProperty public void setDescription(String description){
  this.description=description;
}
Program: 32265
Project: 32265
Buggy source:
public String getDescription(){
  return description;
}

Fixed version (ground truth):
@JsonIgnore public String getDescription(){
  return description;
}
Program: 32266
Project: 32266
Buggy source:
public void setRadius(float radius){
  this.radius=radius;
}

Fixed version (ground truth):
@JsonProperty public void setRadius(float radius){
  this.radius=radius;
}
Program: 32267
Project: 32267
Buggy source:
public String getPoints(){
  return points;
}

Fixed version (ground truth):
@JsonIgnore public String getPoints(){
  return points;
}
Program: 32268
Project: 32268
Buggy source:
public void setPoints(String points){
  this.points=points;
}

Fixed version (ground truth):
@JsonProperty public void setPoints(String points){
  this.points=points;
}
Program: 32269
Project: 32269
Buggy source:
public void setType(GeoFenceType type){
  this.type=type;
}

Fixed version (ground truth):
@JsonProperty public void setType(GeoFenceType type){
  this.type=type;
}
Program: 32270
Project: 32270
Buggy source:
public float getRadius(){
  return radius;
}

Fixed version (ground truth):
@JsonIgnore public float getRadius(){
  return radius;
}
Program: 32271
Project: 32271
Buggy source:
public GeoFenceType getType(){
  return type;
}

Fixed version (ground truth):
@JsonIgnore public GeoFenceType getType(){
  return type;
}
Program: 32272
Project: 32272
Buggy source:
@Override void before(){
  previousIdlePositions=new HashMap<>();
}

Fixed version (ground truth):
@Override void before(){
  if (previousIdlePositions == null) {
    previousIdlePositions=new HashMap<>();
  }
}
Program: 32273
Project: 32273
Buggy source:
@Transactional @Override public void doWork() throws Exception {
  if (lastScannedPositionId == null) {
    List<Long> latestPositionId=entityManager.get().createQuery("String_Node_Str",Long.class).getResultList();
    if (latestPositionId.isEmpty() || latestPositionId.get(0) == null) {
      return;
    }
 else {
      lastScannedPositionId=latestPositionId.get(0);
    }
  }
  List<Position> positions=entityManager.get().createQuery("String_Node_Str",Position.class).setParameter("String_Node_Str",lastScannedPositionId).getResultList();
  Date currentDate=new Date();
  for (  EventProducer eventProducer : eventProducers) {
    eventProducer.setCurrentDate(currentDate);
    eventProducer.before();
  }
  Position prevPosition=null;
  Device device=null;
  DeviceState state=null;
  for (  Position position : positions) {
    if (device == null || device.getId() != position.getDevice().getId()) {
      device=position.getDevice();
      state=deviceState.get(device.getId());
      if (state == null || state.latestPositionId == null) {
        state=new DeviceState();
        deviceState.put(device.getId(),state);
        prevPosition=null;
      }
 else {
        prevPosition=entityManager.get().find(Position.class,state.latestPositionId);
      }
    }
    for (int i=0; i < eventProducers.size(); i++) {
      eventProducers.get(i).positionScanned(prevPosition,position);
    }
    state.latestPositionId=position.getId();
    prevPosition=position;
    lastScannedPositionId=Math.max(lastScannedPositionId,position.getId());
  }
  for (  EventProducer eventProducer : eventProducers) {
    eventProducer.after();
  }
}

Fixed version (ground truth):
@Transactional @Override public void doWork() throws Exception {
  List<Position> positions=positionProvider.getPositions();
  Date currentDate=new Date();
  for (  EventProducer eventProducer : eventProducers) {
    eventProducer.setCurrentDate(currentDate);
    eventProducer.before();
  }
  Position prevPosition=null;
  Device device=null;
  DeviceState state=null;
  for (  Position position : positions) {
    if (device == null || device.getId() != position.getDevice().getId()) {
      device=position.getDevice();
      state=deviceState.get(device.getId());
      if (state == null || state.latestPositionId == null) {
        state=new DeviceState();
        deviceState.put(device.getId(),state);
        prevPosition=null;
      }
 else {
        prevPosition=entityManager.get().find(Position.class,state.latestPositionId);
      }
    }
    for (int i=0; i < eventProducers.size(); i++) {
      eventProducers.get(i).positionScanned(prevPosition,position);
    }
    state.latestPositionId=position.getId();
    prevPosition=position;
    positionProvider.setLastScannedPositionId(Math.max(positionProvider.getLastScannedPositionId(),position.getId()));
  }
  for (  EventProducer eventProducer : eventProducers) {
    eventProducer.after();
  }
}
Program: 32274
Project: 32274
Buggy source:
@Override void after(){
  previousIdlePositions=null;
}

Fixed version (ground truth):
@Override void after(){
}
Program: 32275
Project: 32275
Buggy source:
public User(User user){
  id=user.id;
  admin=user.admin;
  login=user.login;
  password=user.password;
  password_hash_method=user.password_hash_method;
  manager=user.manager;
  email=user.email;
  userSettings=user.userSettings;
  notifications=user.notifications;
  if (user.notificationEvents != null) {
    transferNotificationEvents=new HashSet<DeviceEventType>(user.notificationEvents);
  }
  maxNumOfDevices=user.maxNumOfDevices;
  readOnly=user.readOnly;
  archive=user.archive;
  companyName=user.companyName;
  firstName=user.firstName;
  lastName=user.lastName;
  phoneNumber=user.phoneNumber;
}

Fixed version (ground truth):
public User(User user){
  id=user.id;
  admin=user.admin;
  login=user.login;
  password=user.password;
  password_hash_method=user.password_hash_method;
  manager=user.manager;
  email=user.email;
  userSettings=user.userSettings;
  notifications=user.notifications;
  if (user.notificationEvents != null) {
    transferNotificationEvents=new HashSet<DeviceEventType>(user.notificationEvents);
  }
  maxNumOfDevices=user.maxNumOfDevices;
  expirationDate=user.expirationDate;
  blocked=user.blocked;
  readOnly=user.readOnly;
  archive=user.archive;
  companyName=user.companyName;
  firstName=user.firstName;
  lastName=user.lastName;
  phoneNumber=user.phoneNumber;
}
Program: 32277
Project: 32277
Buggy source:
@Override public void onSelectionChanged(SelectionChangedEvent<Report> event){
  if (event.getSelection().isEmpty()) {
    driver.edit(new Report());
  }
 else {
    driver.edit(event.getSelection().get(0));
  }
  removeButton.setEnabled(!event.getSelection().isEmpty());
}

Fixed version (ground truth):
@Override public void onSelectionChanged(SelectionChangedEvent<Report> event){
  Report report=event.getSelection().isEmpty() ? new Report() : event.getSelection().get(0);
  driver.edit(report);
  if (event.getSelection().isEmpty()) {
    period.selectFirst();
  }
 else {
    period.update();
  }
  updateGeoFencesListState();
  removeButton.setEnabled(!event.getSelection().isEmpty());
}
Program: 32278
Project: 32278
Buggy source:
@UiHandler("String_Node_Str") public void onGenerateClicked(SelectEvent event){
  reportHandler.onGenerate(driver.flush());
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") public void onGenerateClicked(SelectEvent event){
  Report report=driver.flush();
  if (!driver.hasErrors()) {
    reportHandler.onGenerate(report);
  }
}
Program: 32279
Project: 32279
Buggy source:
private List<Device> getDevices(boolean full){
  User user=getSessionUser();
  List<Device> devices;
  if (user.getAdmin()) {
    devices=getSessionEntityManager().createQuery("String_Node_Str",Device.class).getResultList();
  }
 else {
    devices=new LinkedList<Device>(user.getAllAvailableDevices());
  }
  if (full) {
    List<Maintenance> maintenaces=getSessionEntityManager().createQuery("String_Node_Str",Maintenance.class).setParameter("String_Node_Str",devices).getResultList();
    for (    Maintenance maintenance : maintenaces) {
      Device device=maintenance.getDevice();
      if (device.getMaintenances() == null) {
        device.setMaintenances(new ArrayList<Maintenance>());
      }
      device.getMaintenances().add(maintenance);
    }
    List<Sensor> sensors=getSessionEntityManager().createQuery("String_Node_Str",Sensor.class).setParameter("String_Node_Str",devices).getResultList();
    for (    Sensor sensor : sensors) {
      Device device=sensor.getDevice();
      if (device.getSensors() == null) {
        device.setSensors(new ArrayList<Sensor>());
      }
      device.getSensors().add(sensor);
    }
    for (    Device device : devices) {
      if (device.getMaintenances() == null) {
        device.setMaintenances(Collections.<Maintenance>emptyList());
      }
      if (device.getSensors() == null) {
        device.setSensors(Collections.<Sensor>emptyList());
      }
    }
  }
  return devices;
}

Fixed version (ground truth):
private List<Device> getDevices(boolean full){
  User user=getSessionUser();
  List<Device> devices;
  if (user.getAdmin()) {
    devices=getSessionEntityManager().createQuery("String_Node_Str",Device.class).getResultList();
  }
 else {
    devices=new LinkedList<Device>(user.getAllAvailableDevices());
  }
  if (full && !devices.isEmpty()) {
    List<Maintenance> maintenaces=getSessionEntityManager().createQuery("String_Node_Str",Maintenance.class).setParameter("String_Node_Str",devices).getResultList();
    for (    Maintenance maintenance : maintenaces) {
      Device device=maintenance.getDevice();
      if (device.getMaintenances() == null) {
        device.setMaintenances(new ArrayList<Maintenance>());
      }
      device.getMaintenances().add(maintenance);
    }
    List<Sensor> sensors=getSessionEntityManager().createQuery("String_Node_Str",Sensor.class).setParameter("String_Node_Str",devices).getResultList();
    for (    Sensor sensor : sensors) {
      Device device=sensor.getDevice();
      if (device.getSensors() == null) {
        device.setSensors(new ArrayList<Sensor>());
      }
      device.getSensors().add(sensor);
    }
    for (    Device device : devices) {
      if (device.getMaintenances() == null) {
        device.setMaintenances(Collections.<Maintenance>emptyList());
      }
      if (device.getSensors() == null) {
        device.setSensors(Collections.<Sensor>emptyList());
      }
    }
  }
  return devices;
}
Program: 32280
Project: 32280
Buggy source:
private User fillUserSettings(User user){
  if (user.getUserSettings() instanceof HibernateProxy) {
    UserSettings settings=(UserSettings)((HibernateProxy)user.getUserSettings()).getHibernateLazyInitializer().getImplementation();
    user.setUserSettings(settings);
  }
  return user;
}

Fixed version (ground truth):
private User fillUserSettings(User user){
  if (user.getUserSettings() instanceof HibernateProxy) {
    user.setUserSettings(unproxy(user.getUserSettings()));
  }
  return user;
}
Program: 32281
Project: 32281
Buggy source:
@Transactional @RequireUser(roles={Role.ADMIN,Role.MANAGER}) @Override public List<User> getUsers(){
  User currentUser=getSessionUser();
  List<User> users=new LinkedList<User>();
  if (currentUser.getAdmin()) {
    users.addAll(getSessionEntityManager().createQuery("String_Node_Str",User.class).getResultList());
  }
 else {
    users.addAll(currentUser.getAllManagedUsers());
  }
  for (  User user : users) {
    fillUserSettings(user);
  }
  return users;
}

Fixed version (ground truth):
@Transactional @RequireUser(roles={Role.ADMIN,Role.MANAGER}) @Override public List<User> getUsers(){
  User currentUser=getSessionUser();
  List<User> users=new LinkedList<User>();
  if (currentUser.getAdmin()) {
    users.addAll(getSessionEntityManager().createQuery("String_Node_Str",User.class).getResultList());
  }
 else {
    users.addAll(currentUser.getAllManagedUsers());
  }
  List<User> result=new ArrayList<User>(users.size());
  for (  User user : users) {
    result.add(fillUserSettings(unproxy(user)));
  }
  return result;
}
Program: 32282
Project: 32282
Buggy source:
public void showAlerts(List<Position> positions){
  for (  VectorFeature alert : alertMap.values()) {
    getVectorLayer().removeFeature(alert);
    alert.destroy();
  }
  alertMap.clear();
  if (positions != null) {
    for (    Position position : positions) {
      drawAlert(position);
    }
  }
}

Fixed version (ground truth):
public void showAlerts(List<Position> positions){
  if (positions != null) {
    for (    Position position : positions) {
      drawAlert(position);
    }
  }
}
Program: 32283
Project: 32283
Buggy source:
private void drawAlert(Position position){
  int iconWidthHalf=position.getIconType().getWidth() / 2;
  int iconHeight=position.getIconType().getHeight();
  Style alertCircleStyle=new org.gwtopenmaps.openlayers.client.Style();
  alertCircleStyle.setPointRadius(Math.sqrt(iconWidthHalf * iconWidthHalf + iconHeight * iconHeight) + 1);
  alertCircleStyle.setFillOpacity(0d);
  alertCircleStyle.setStrokeWidth(2d);
  alertCircleStyle.setStrokeColor("String_Node_Str");
  VectorFeature alertCircle=new VectorFeature(mapView.createPoint(position.getLongitude(),position.getLatitude()),alertCircleStyle);
  getVectorLayer().addFeature(alertCircle);
  alertMap.put(position.getDevice().getId(),alertCircle);
}

Fixed version (ground truth):
private void drawAlert(Position position){
  DeviceData deviceData=getDeviceData(position.getDevice());
  int iconWidthHalf=position.getIcon().getWidth() / 2;
  int iconHeight=position.getIcon().getHeight();
  Style alertCircleStyle=new org.gwtopenmaps.openlayers.client.Style();
  alertCircleStyle.setPointRadius(Math.sqrt(iconWidthHalf * iconWidthHalf + iconHeight * iconHeight) + 1);
  alertCircleStyle.setFillOpacity(0d);
  alertCircleStyle.setStrokeWidth(2d);
  alertCircleStyle.setStrokeColor("String_Node_Str");
  VectorFeature alertCircle=new VectorFeature(mapView.createPoint(position.getLongitude(),position.getLatitude()),alertCircleStyle);
  getVectorLayer().addFeature(alertCircle);
  deviceData.alert=alertCircle;
}
Program: 32284
Project: 32284
Buggy source:
public void updateAlert(Device device,boolean show){
  VectorFeature alert=alertMap.remove(device.getId());
  if (alert != null) {
    getVectorLayer().removeFeature(alert);
    alert.destroy();
  }
  if (show) {
    Long latestPositionId=deviceMap.get(device.getId());
    Position latestPosition=positionMap.get(latestPositionId);
    if (latestPosition != null) {
      drawAlert(latestPosition);
    }
  }
}

Fixed version (ground truth):
public void updateAlert(Device device,boolean show){
  DeviceData deviceData=getDeviceData(device);
  if (deviceData.alert != null) {
    getVectorLayer().removeFeature(deviceData.alert);
    deviceData.alert.destroy();
  }
  if (show) {
    Position latestPosition=deviceData.getLatestPosition();
    if (latestPosition != null) {
      drawAlert(latestPosition);
    }
  }
}
Program: 32285
Project: 32285
Buggy source:
public void clearLatestPositions(){
  latestPositionRenderer.clearPositionsAndTitles();
}

Fixed version (ground truth):
public void clearLatestPositions(){
  latestPositionRenderer.clearPositionsAndTitlesAndAlerts();
}