nus-yam/ex-repair huggingface dataset:
Program: 155336
Project: 155336
Buggy source:
public List<byte[]> inventory(){
  int count=0;
  int window=0;
  byte[] response;
  boolean windowChange=true;
  while (count < STOPPING_CRITERIA) {
    if (windowChange)     response=sendQuery(window);
 else     response=sendQuery();
    if (response == null) {
      count+=window == 0 ? 0 : 1;
      window=Math.max(window / 2 - 1,0);
      windowChange=window != 0;
    }
 else     if (Arrays.equals(response,RFIDChannel.GARBLE)) {
      count=0;
      window=Math.min(window + 1,255);
      windowChange=true;
    }
 else {
      if (!currentInventory.contains(response)) {
        currentInventory.add(response);
      }
      sendAck();
      count=0;
      windowChange=false;
    }
  }
  return currentInventory;
}

Fixed version (ground truth):
public List<byte[]> inventory(){
  int count=0;
  int window=INITIAL_WINDOW;
  byte[] response;
  boolean windowChange=true;
  while (count < STOPPING_CRITERIA) {
    System.err.println("String_Node_Str" + count);
    if (windowChange)     response=sendQuery(window);
 else     response=sendQuery();
    if (response == null) {
      count+=window == 0 ? 1 : 0;
      window=Math.max(window / 2 - 1,0);
      windowChange=window != 0;
    }
 else     if (Arrays.equals(response,RFIDChannel.GARBLE)) {
      count=0;
      window=Math.min(window + 1,255);
      windowChange=true;
    }
 else {
      if (!currentInventory.contains(response)) {
        currentInventory.add(response);
      }
      sendAck();
      count=0;
      windowChange=false;
    }
  }
  return currentInventory;
}
Program: 155338
Project: 155338
Buggy source:
/** 
 * Places a variable at the current scope. The name passed in must be a valid identifier.
 * @param name The identifier to place at the current scope.
 * @param eo The value to place at the current scope.
 */
public static void putVariable(String name,EveObject eo){
  EveObject scope=getScopeForVariable(name);
  if (!inFunction()) {
    scope.putField(name,eo);
  }
 else {
    scope.putTempField(name,eo);
  }
}

Fixed version (ground truth):
/** 
 * Places a variable at the current scope. The name passed in must be a valid identifier.
 * @param name The identifier to place at the current scope.
 * @param eo The value to place at the current scope.
 */
public static void putVariable(String name,EveObject eo){
  EveObject scope=getScopeForVariable(name);
  if (!inFunction() && globalScopes.containsValue(scope) == false) {
    scope.putField(name,eo);
  }
 else {
    scope.putTempField(name,eo);
  }
}
Program: 155339
Project: 155339
Buggy source:
@Override public void updateVariable(EveObject value){
  EveObject eo=getExpression().execute();
  String ident=getIdentifier();
  if (eo != null && eo.isSealed()) {
    throw new EveError("String_Node_Str");
  }
  EveObject existingField=eo.getField(ident);
  if (existingField != null && existingField.isMarkedForClone()) {
    existingField.deepClone();
  }
  if (isUsingMutatorAccessor() && existingField != null && existingField.hasField("String_Node_Str") && existingField.getField("String_Node_Str").getType() == EveType.FUNCTION) {
    existingField.getField("String_Node_Str").invokeSelf(eo,value);
  }
 else {
    eo.putField(ident,value);
  }
}

Fixed version (ground truth):
@Override public void updateVariable(EveObject value){
  EveObject eo=getExpression().execute();
  String ident=getIdentifier();
  if (eo != null && eo.isSealed()) {
    throw new EveError("String_Node_Str");
  }
  EveObject existingField=eo.getField(ident);
  if (existingField != null && existingField.isMarkedForClone()) {
    existingField.deepClone();
  }
  if (isUsingMutatorAccessor() && existingField != null && existingField.hasField("String_Node_Str") && existingField.getField("String_Node_Str").getType() == EveType.FUNCTION) {
    existingField.getField("String_Node_Str").invokeSetter(eo,value);
  }
 else {
    eo.putField(ident,value);
  }
}
Program: 155340
Project: 155340
Buggy source:
private void createEJITypes(Set<Class<?>> types) throws InstantiationException, IllegalAccessException, IntrospectionException {
  for (  Class<?> type : types) {
    EJIType typeInfo=type.getAnnotation(EJIType.class);
    EveObject eo=EJIHelper.createEJIConstructor(type);
    BuiltinCommonsFactory.addType(typeInfo.value(),eo);
  }
}

Fixed version (ground truth):
private void createEJITypes(Set<Class<?>> types) throws InstantiationException, IllegalAccessException, IntrospectionException {
  for (  Class<?> type : types) {
    EJIType typeInfo=type.getAnnotation(EJIType.class);
    EveObject eo=EJIHelper.createEJIConstructor(type);
    BuiltinCommons.addType(typeInfo.value(),eo);
  }
}
Program: 155341
Project: 155341
Buggy source:
private EveObject resolveJavaPackageContainer(String fqcn){
  String[] split=fqcn.split("String_Node_Str");
  EveObject pkgContainer=ScopeManager.getGlobalScope().getField(split[0]);
  if (pkgContainer == null) {
    pkgContainer=EveObject.prototypeType(split[0]);
    BuiltinCommonsFactory.addType(split[0],pkgContainer);
  }
  EveObject prevContainer=pkgContainer;
  for (int c=1; c < split.length - 1; c++) {
    pkgContainer=pkgContainer.getField(split[c]);
    if (pkgContainer == null) {
      pkgContainer=EveObject.prototypeType(split[c]);
      prevContainer.putField(split[c],pkgContainer);
    }
    prevContainer=pkgContainer;
  }
  return pkgContainer;
}

Fixed version (ground truth):
private EveObject resolveJavaPackageContainer(String fqcn){
  String[] split=fqcn.split("String_Node_Str");
  EveObject pkgContainer=BuiltinCommons.getType(split[0]);
  if (pkgContainer == null) {
    pkgContainer=EveObject.prototypeType(split[0]);
    BuiltinCommons.addType(split[0],pkgContainer);
  }
  EveObject prevContainer=pkgContainer;
  for (int c=1; c < split.length - 1; c++) {
    pkgContainer=pkgContainer.getField(split[c]);
    if (pkgContainer == null) {
      pkgContainer=EveObject.prototypeType(split[c]);
      prevContainer.putField(split[c],pkgContainer);
    }
    prevContainer=pkgContainer;
  }
  return pkgContainer;
}
Program: 155342
Project: 155342
Buggy source:
@Override public EveObject execute(Map<String,EveObject> parameters){
  String className=parameters.get("String_Node_Str").getStringValue();
  try {
    Class<?> cl=Class.forName(className);
    EveObject ctorFunc=EJIHelper.createEJIConstructor(cl);
    EveObject pkgContainer=resolveJavaPackageContainer(className);
    if (cl.isAnonymousClass()) {
      throw new EveError("String_Node_Str");
    }
    String simpleName=cl.getSimpleName();
    if (cl.isArray()) {
      simpleName=simpleName.substring(0,simpleName.indexOf("String_Node_Str"));
      simpleName+="String_Node_Str";
    }
    pkgContainer.putField(simpleName,ctorFunc);
    if (exposeType) {
      BuiltinCommonsFactory.addType(simpleName,ctorFunc);
    }
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public EveObject execute(Map<String,EveObject> parameters){
  String className=parameters.get("String_Node_Str").getStringValue();
  try {
    Class<?> cl=Class.forName(className);
    EveObject ctorFunc=EJIHelper.createEJIConstructor(cl);
    EveObject pkgContainer=resolveJavaPackageContainer(className);
    if (cl.isAnonymousClass()) {
      throw new EveError("String_Node_Str");
    }
    String simpleName=cl.getSimpleName();
    if (cl.isArray()) {
      simpleName=simpleName.substring(0,simpleName.indexOf("String_Node_Str"));
      simpleName+="String_Node_Str";
    }
    pkgContainer.putField(simpleName,ctorFunc);
    if (exposeType) {
      BuiltinCommons.addType(simpleName,ctorFunc);
    }
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 155343
Project: 155343
Buggy source:
public static EveObject getScopeForVariable(String name){
  EveObject eo=null;
  if (getNamespace().equals("String_Node_Str")) {
    setNamespace(previousNamespace);
    eo=getGlobalScope();
    revertNamespace();
    return eo;
  }
  if (closureScope != null) {
    for (    EveObject closure : closureScope) {
      eo=closure.getField(name);
      if (eo != null) {
        return closure;
      }
    }
  }
  for (  EveObject scope : getScopeStack()) {
    if (scope != getGlobalScope()) {
      eo=scope.getField(name);
      if (eo != null) {
        return scope;
      }
    }
 else {
      if (getNamespace().equals("String_Node_Str")) {
        eo=scope.getField(name);
        if (eo != null) {
          return scope;
        }
      }
    }
  }
  eo=BuiltinCommonsFactory.getType(name);
  if (eo != null) {
    return getGlobalScope();
  }
  return getCurrentScope();
}

Fixed version (ground truth):
public static EveObject getScopeForVariable(String name){
  EveObject eo=null;
  if (getNamespace().equals("String_Node_Str")) {
    setNamespace(previousNamespace);
    eo=getGlobalScope();
    revertNamespace();
    return eo;
  }
  if (closureScope != null) {
    for (    EveObject closure : closureScope) {
      eo=closure.getField(name);
      if (eo != null) {
        return closure;
      }
    }
  }
  for (  EveObject scope : getScopeStack()) {
    if (scope != getGlobalScope()) {
      eo=scope.getField(name);
      if (eo != null) {
        return scope;
      }
    }
 else {
      if (getNamespace().equals("String_Node_Str")) {
        eo=scope.getField(name);
        if (eo != null) {
          return scope;
        }
      }
    }
  }
  eo=BuiltinCommons.getType(name);
  if (eo != null) {
    return getGlobalScope();
  }
  return getCurrentScope();
}
Program: 155344
Project: 155344
Buggy source:
private static EveObject getObject(String name){
  EveObject eo=null;
  if (getNamespace().equals("String_Node_Str")) {
    setNamespace(previousNamespace);
    eo=getGlobalScope().getField(name);
    revertNamespace();
    return eo;
  }
  if (closureScope != null) {
    for (    EveObject closure : closureScope) {
      eo=closure.getField(name);
      if (eo != null) {
        return eo;
      }
    }
  }
  for (  EveObject scope : getScopeStack()) {
    if (scope != getGlobalScope()) {
      eo=scope.getField(name);
      if (eo != null) {
        return eo;
      }
    }
 else {
      if (getNamespace().equals("String_Node_Str")) {
        eo=scope.getField(name);
        if (eo != null) {
          return eo;
        }
      }
    }
  }
  if (getCurrentScope() != null && getCurrentScope() == getGlobalScope()) {
    eo=getCurrentScope().getField(name);
  }
  if (eo == null) {
    eo=BuiltinCommonsFactory.getType(name);
  }
  return eo;
}

Fixed version (ground truth):
private static EveObject getObject(String name){
  EveObject eo=null;
  if (getNamespace().equals("String_Node_Str")) {
    setNamespace(previousNamespace);
    eo=getGlobalScope().getField(name);
    revertNamespace();
    return eo;
  }
  if (closureScope != null) {
    for (    EveObject closure : closureScope) {
      eo=closure.getField(name);
      if (eo != null) {
        return eo;
      }
    }
  }
  for (  EveObject scope : getScopeStack()) {
    if (scope != getGlobalScope()) {
      eo=scope.getField(name);
      if (eo != null) {
        return eo;
      }
    }
 else {
      if (getNamespace().equals("String_Node_Str")) {
        eo=scope.getField(name);
        if (eo != null) {
          return eo;
        }
      }
    }
  }
  if (getCurrentScope() != null && getCurrentScope() == getGlobalScope()) {
    eo=getCurrentScope().getField(name);
  }
  if (eo == null) {
    eo=BuiltinCommons.getType(name);
  }
  return eo;
}
Program: 155345
Project: 155345
Buggy source:
@Override public EveObject getField(String name){
  EveObject eo=typePool.get(name);
  if (typePool != null) {
    return eo;
  }
 else {
    return super.getField(name);
  }
}

Fixed version (ground truth):
@Override public EveObject getField(String name){
  EveObject eo=typePool.get(name);
  if (eo != null) {
    return eo;
  }
 else {
    return super.getField(name);
  }
}
Program: 155346
Project: 155346
Buggy source:
/** 
 * Places a variable at the current scope. The name passed in must be a valid identifier.
 * @param name The identifier to place at the current scope.
 * @param eo The value to place at the current scope.
 */
public static void putVariable(String name,EveObject eo){
  getCurrentScope().putField(name,eo);
}

Fixed version (ground truth):
/** 
 * Places a variable at the current scope. The name passed in must be a valid identifier.
 * @param name The identifier to place at the current scope.
 * @param eo The value to place at the current scope.
 */
public static void putVariable(String name,EveObject eo){
  EveObject scope=getScopeForVariable(name);
  scope.putField(name,eo);
}
Program: 155347
Project: 155347
Buggy source:
public void putField(String name,EveObject eo){
  this.fields.put(name,eo);
}

Fixed version (ground truth):
public void putField(String name,EveObject eo){
  if (this.isMarkedForClone()) {
  }
  this.fields.put(name,eo);
}
Program: 155348
Project: 155348
Buggy source:
/** 
 * Removes [index]s from the given identifier. The name is assumed to be in the correct format.
 * @param name
 * @return The name without any index properties.
 */
private static String stripIndices(String name){
  return name.substring(0,name.indexOf("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Removes [index]s from the given identifier. The name is assumed to be in the correct format. If there are no index accessors, it just returns the name that was passed in.
 * @param name
 * @return The name without any index properties.
 */
private static String stripIndices(String name){
  if (name.contains("String_Node_Str")) {
    return name.substring(0,name.indexOf("String_Node_Str"));
  }
 else {
    return name;
  }
}
Program: 155351
Project: 155351
Buggy source:
private void sendMails(String from,Collection<Integer> userIds,String body,List<String> attachments){
  if (StringUtil.isEmpty(from) || ListUtil.isEmpty(userIds)) {
    return;
  }
  MessageParameters parameters=new MessageParameters();
  parameters.setFrom(from);
  ArrayList<String> recipients=new ArrayList<String>(userIds.size());
  UserBusiness userbusiness=this.getUserBusiness();
  for (  Integer userId : userIds) {
    User user=null;
    try {
      user=userbusiness.getUser(Integer.valueOf(userId));
    }
 catch (    RemoteException e) {
      this.getLogger().log(Level.WARNING,"String_Node_Str" + userId,e);
    }
    UserDataBean userInfo=userApplicationEngine.getUserInfo(user);
    recipients.add(userInfo.getEmail());
  }
  parameters.setAttachments(attachments);
  parameters.setMessage(body);
  String recipientsString=recipients.toString();
  parameters.setRecipientTo(recipientsString);
  this.emailSenderHelper.sendMessage(parameters);
}

Fixed version (ground truth):
private void sendMails(String from,Collection<Integer> userIds,String subject,String body,List<String> attachments){
  if (StringUtil.isEmpty(from) || ListUtil.isEmpty(userIds))   return;
  MessageParameters parameters=new MessageParameters();
  parameters.setFrom(from);
  List<String> recipients=new ArrayList<String>(userIds.size());
  UserBusiness userBusiness=this.getUserBusiness();
  for (  Integer userId : userIds) {
    Email email=null;
    try {
      email=userBusiness.getUserMail(userId);
    }
 catch (    Exception e) {
      this.getLogger().log(Level.WARNING,"String_Node_Str" + userId,e);
    }
    if (email == null)     continue;
    recipients.add(email.getEmailAddress());
  }
  if (ListUtil.isEmpty(recipients)) {
    getLogger().warning("String_Node_Str");
    return;
  }
  parameters.setAttachments(attachments);
  parameters.setSubject(subject);
  parameters.setMessage(body);
  StringBuilder emails=new StringBuilder();
  for (Iterator<String> mailsIter=recipients.iterator(); mailsIter.hasNext(); ) {
    emails.append(mailsIter.next());
    if (mailsIter.hasNext())     emails.append(CoreConstants.COMMA);
  }
  parameters.setRecipientTo(emails.toString());
  this.emailSenderHelper.sendMessage(parameters);
}
Program: 155353
Project: 155353
Buggy source:
@SuppressWarnings("String_Node_Str") private Collection<String> getGroupsRolesForPostsAccess(Collection<Integer> groupIds){
  ArrayList<String> roles=new ArrayList<String>(groupIds.size());
  String[] ids=new String[groupIds.size()];
  int i=0;
  for (  Integer id : groupIds) {
    ids[i++]=id.toString();
  }
  GroupBusiness groupBusiness=this.getGroupBusiness();
  Collection<Group> groups=null;
  try {
    groups=groupBusiness.getGroups(ids);
  }
 catch (  RemoteException e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
  }
catch (  FinderException e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
  }
  if (ListUtil.isEmpty(groups)) {
    return Collections.emptyList();
  }
  for (  Group group : groups) {
    roles.add(PostBusiness.getGroupRoleForPostsAccess(group));
  }
  return roles;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Collection<String> getGroupsRolesForPostsAccess(Collection<Integer> groupIds){
  List<String> roles=new ArrayList<String>(groupIds.size());
  String[] ids=new String[groupIds.size()];
  int i=0;
  for (  Integer id : groupIds) {
    ids[i++]=id.toString();
  }
  GroupBusiness groupBusiness=this.getGroupBusiness();
  Collection<Group> groups=null;
  try {
    groups=groupBusiness.getGroups(ids);
  }
 catch (  RemoteException e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
  }
catch (  FinderException e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
  }
  if (ListUtil.isEmpty(groups)) {
    return Collections.emptyList();
  }
  for (  Group group : groups) {
    roles.add(PostBusiness.getGroupRoleForPostsAccess(group));
  }
  return roles;
}
Program: 155354
Project: 155354
Buggy source:
public Group getSocialRootGroup(){
  try {
    @SuppressWarnings("String_Node_Str") Collection<Group> socialRootGroups=getGroupBusiness().getGroupsByGroupName(Constants.SOCIAL_ROOT_GROUP_NAME);
    return socialRootGroups.iterator().next();
  }
 catch (  Exception e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public Group getSocialRootGroup(){
  try {
    @SuppressWarnings("String_Node_Str") Collection<Group> socialRootGroups=getGroupBusiness().getGroupsByGroupName(SocialConstants.SOCIAL_ROOT_GROUP_NAME);
    return socialRootGroups.iterator().next();
  }
 catch (  Exception e) {
    this.getLogger().log(Level.WARNING,"String_Node_Str",e);
    return null;
  }
}
Program: 155355
Project: 155355
Buggy source:
@RemoteMethod public String getGroupSearchResults(String request,Integer amount){
  if (amount == null) {
    amount=-1;
  }
  ArrayList<String> types=null;
  Collection<Group> groups=getGroupBusiness().getGroupsBySearchRequest(request,types,amount);
  if (ListUtil.isEmpty(groups)) {
    return "String_Node_Str" + this.getResourceBundle().getLocalizedString("String_Node_Str","String_Node_Str") + "String_Node_Str";
  }
  UIComponent groupList=WhatsNewView.getGroupListView(groups);
  String html=BuilderLogic.getInstance().getRenderedComponent(groupList,null).getHtml();
  return html;
}

Fixed version (ground truth):
@RemoteMethod public String getGroupSearchResults(String request,Integer amount){
  if (amount == null) {
    amount=-1;
  }
  List<String> types=null;
  Collection<Group> groups=getGroupBusiness().getGroupsBySearchRequest(request,types,amount);
  if (ListUtil.isEmpty(groups)) {
    return "String_Node_Str" + this.getResourceBundle().getLocalizedString("String_Node_Str","String_Node_Str") + "String_Node_Str";
  }
  UIComponent groupList=WhatsNewView.getGroupListView(groups);
  String html=BuilderLogic.getInstance().getRenderedComponent(groupList,null).getHtml();
  return html;
}
Program: 155356
Project: 155356
Buggy source:
@RemoteMethod public String savePost(Map<String,ArrayList<String>> parameters){
  return this.postBusiness.savePost(parameters);
}

Fixed version (ground truth):
@RemoteMethod public String savePost(Map<String,List<String>> parameters){
  return this.postBusiness.savePost(parameters);
}
Program: 155357
Project: 155357
Buggy source:
@SuppressWarnings("String_Node_Str") @RemoteMethod public Collection<String> getSagaGroupSearchResultsAsAutoComplete(String request){
  request=CoreConstants.PERCENT + request.toLowerCase() + CoreConstants.PERCENT;
  Collection<Group> foundGroups=null;
  try {
    foundGroups=this.getGroupHome().findGroupsByGroupTypeAndLikeName(Constants.SOCIAL_TYPE,request);
  }
 catch (  FinderException e) {
    this.getLogger().log(Level.WARNING,CoreConstants.EMPTY,e);
    return Collections.emptyList();
  }
  if (ListUtil.isEmpty(foundGroups)) {
    return Collections.emptyList();
  }
  int groupsAmmount=foundGroups.size();
  ArrayList<String> strings=new ArrayList<String>(groupsAmmount);
  for (  Group group : foundGroups) {
    StringBuilder responseItem=new StringBuilder("String_Node_Str").append(PostBusiness.ParameterNames.GROUP_RECEIVERS_PARAMETER_NAME).append("String_Node_Str").append(group.getId()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
    String groupName=group.getName();
    responseItem.append(groupName);
    responseItem.append("String_Node_Str");
    strings.add(responseItem.toString());
    strings.add(groupName != null ? groupName.toString() : CoreConstants.EMPTY);
  }
  return strings;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @RemoteMethod public Collection<String> getSagaGroupSearchResultsAsAutoComplete(String request){
  request=CoreConstants.PERCENT + request.toLowerCase() + CoreConstants.PERCENT;
  Collection<Group> foundGroups=null;
  try {
    foundGroups=this.getGroupHome().findGroupsByGroupTypeAndLikeName(SocialConstants.SOCIAL_TYPE,request);
  }
 catch (  FinderException e) {
    this.getLogger().log(Level.WARNING,CoreConstants.EMPTY,e);
    return Collections.emptyList();
  }
  if (ListUtil.isEmpty(foundGroups)) {
    return Collections.emptyList();
  }
  int groupsAmmount=foundGroups.size();
  List<String> strings=new ArrayList<String>(groupsAmmount);
  for (  Group group : foundGroups) {
    StringBuilder responseItem=new StringBuilder("String_Node_Str").append(PostBusiness.ParameterNames.GROUP_RECEIVERS_PARAMETER_NAME).append("String_Node_Str").append(group.getId()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
    String groupName=group.getName();
    responseItem.append(groupName);
    responseItem.append("String_Node_Str");
    strings.add(responseItem.toString());
    strings.add(groupName != null ? groupName.toString() : CoreConstants.EMPTY);
  }
  return strings;
}
Program: 155359
Project: 155359
Buggy source:
protected IWResourceBundle getResourceBundle(){
  return this.getResourceBundle(this.getBundle(Constants.IW_BUNDLE_IDENTIFIER));
}

Fixed version (ground truth):
protected IWResourceBundle getResourceBundle(){
  return this.getResourceBundle(this.getBundle(SocialConstants.IW_BUNDLE_IDENTIFIER));
}
Program: 155360
Project: 155360
Buggy source:
@Override public Photos<Photo> getPhotoList(HashMap<String,Object> paramMap){
  List<HashMap<String,Object>> results=articleDao.getPhotoList(paramMap);
  Photos<Photo> photos=new Photos<Photo>();
  String content="String_Node_Str";
  if (!results.isEmpty()) {
    for (    HashMap<String,Object> result : results) {
      Photo photo=new Photo();
      photo.setId((Long)result.get("String_Node_Str"));
      photo.setPId((Long)result.get("String_Node_Str"));
      photo.setLanguage(result.get("String_Node_Str").toString());
      photo.setLangSetId((Integer)result.get("String_Node_Str"));
      photo.setUname(result.get("String_Node_Str").toString());
      photo.setTitle(result.get("String_Node_Str").toString());
      photo.setTimeStamp((Long)result.get("String_Node_Str"));
      photo.setThumbUrl(looahCommon.makeImageUrl((Long)result.get("String_Node_Str"),LooahAPIConfig.THUMBNAIL_SIZE));
      photo.setTwiceThumbUrl(looahCommon.makeImageUrl((Long)result.get("String_Node_Str"),LooahAPIConfig.TWICE_THUMBNAIL_SIZE));
      photo.setXcompleted(result.get("String_Node_Str").equals(1));
      content=result.get("String_Node_Str").toString();
      if (result.get("String_Node_Str") != null) {
        content=result.get("String_Node_Str").toString();
      }
      photo.setContent(looahCommon.cutText(content,50));
      photos.add(photo);
    }
  }
  return photos.setCount();
}

Fixed version (ground truth):
@Override public Photos<Photo> getPhotoList(HashMap<String,Object> paramMap){
  List<HashMap<String,Object>> results=articleDao.getPhotoList(paramMap);
  Photos<Photo> photos=new Photos<Photo>();
  String content="String_Node_Str";
  if (!results.isEmpty()) {
    for (    HashMap<String,Object> result : results) {
      Photo photo=new Photo();
      photo.setId((Long)result.get("String_Node_Str"));
      photo.setPId((Long)result.get("String_Node_Str"));
      photo.setLanguage(result.get("String_Node_Str").toString());
      photo.setLangSetId((Integer)result.get("String_Node_Str"));
      photo.setUname(result.get("String_Node_Str").toString());
      photo.setTitle(result.get("String_Node_Str").toString());
      photo.setTimeStamp((Long)result.get("String_Node_Str"));
      photo.setThumbUrl(looahCommon.makeImageUrl((Long)result.get("String_Node_Str"),LooahAPIConfig.THUMBNAIL_SIZE));
      photo.setTwiceThumbUrl(looahCommon.makeImageUrl((Long)result.get("String_Node_Str"),LooahAPIConfig.TWICE_THUMBNAIL_SIZE));
      photo.setXcompleted(result.get("String_Node_Str").toString().equals("String_Node_Str"));
      content=result.get("String_Node_Str").toString();
      if (result.get("String_Node_Str") != null) {
        content=result.get("String_Node_Str").toString();
      }
      photo.setContent(looahCommon.cutText(content,50));
      photos.add(photo);
    }
  }
  return photos.setCount();
}
Program: 155362
Project: 155362
Buggy source:
public static boolean intersect(Point a1,Point a2,Point b1,Point b2){
  int direction1=a1.getOrientation(a2,b1);
  int direction2=a1.getOrientation(a2,b2);
  int direction3=b1.getOrientation(b2,a1);
  int direction4=b1.getOrientation(b2,a2);
  boolean straddleOne=(direction1 > 0 && direction2 < 0) || (direction1 < 0 && direction2 > 0);
  boolean straddleTwo=(direction3 > 0 && direction4 < 0) || (direction3 < 0 && direction4 > 0);
  if (straddleOne && straddleTwo)   return true;
  if (direction1 == 0 && pointOnLine(a1,a2,b1))   return true;
  if (direction2 == 0 && pointOnLine(a1,a2,b2))   return true;
  if (direction3 == 0 && pointOnLine(b1,b2,a1))   return true;
  if (direction1 == 0 && pointOnLine(b1,b2,a2))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean intersect(Point a1,Point a2,Point b1,Point b2){
  int direction1=a1.getOrientation(a2,b1);
  int direction2=a1.getOrientation(a2,b2);
  int direction3=b1.getOrientation(b2,a1);
  int direction4=b1.getOrientation(b2,a2);
  boolean straddleOne=(direction1 > 0 && direction2 < 0) || (direction1 < 0 && direction2 > 0);
  boolean straddleTwo=(direction3 > 0 && direction4 < 0) || (direction3 < 0 && direction4 > 0);
  if (straddleOne && straddleTwo)   return true;
  if (direction1 == 0 && pointOnLine(a1,a2,b1))   return true;
  if (direction2 == 0 && pointOnLine(a1,a2,b2))   return true;
  if (direction3 == 0 && pointOnLine(b1,b2,a1))   return true;
  if (direction4 == 0 && pointOnLine(b1,b2,a2))   return true;
  return false;
}
Program: 155364
Project: 155364
Buggy source:
public static DHCPPacket getDiscover(DHCPPacket discover,HashMap<byte[],IPTime> reserved,Random randomIP,IPAddress subnetmask){
  DHCPPacket offer=discover;
  Option offerOption=new Option((byte)53,(byte)2);
  offer.getOptions().add(offerOption);
  byte first=(byte)randomIP.nextInt((256 - subnetmask.getFirst()) + subnetmask.getFirst());
  byte second=(byte)randomIP.nextInt((256 - subnetmask.getSecond()) + subnetmask.getSecond());
  byte third=(byte)randomIP.nextInt((256 - subnetmask.getThird()) + subnetmask.getThird());
  byte forth=(byte)randomIP.nextInt((256 - subnetmask.getForth()) + subnetmask.getForth());
  IPAddress offeredIP=new IPAddress(first,second,third,forth);
  byte[] mac=Utility.readNByte(6,offer.getChaddr(),0);
  Timestamp now=Utility.getCurrentTimeStamp();
  IPTime reservedIPTime=new IPTime(offeredIP,now.getTime());
  reserved.put(mac,reservedIPTime);
  offer.setYiaddr(offeredIP.IPAddressToByte());
  return offer;
}

Fixed version (ground truth):
public static DHCPPacket getDiscover(DHCPPacket discover,HashMap<byte[],IPTime> db,HashMap<byte[],IPTime> reserved,Random randomIP,IPAddress subnetmask){
  DHCPPacket offer=discover;
  Option offerOption=new Option((byte)53,(byte)2);
  offer.getOptions().add(offerOption);
  IPAddress offeredIP;
  do {
    offeredIP=Utility.RandomIPGenerator(subnetmask,randomIP);
  }
 while (Utility.HasIPAdress(offeredIP,reserved) || Utility.HasIPAdress(offeredIP,db));
  byte[] mac=Utility.readNByte(6,offer.getChaddr(),0);
  Timestamp now=Utility.getCurrentTimeStamp();
  IPTime reservedIPTime=new IPTime(offeredIP,now.getTime());
  reserved.put(mac,reservedIPTime);
  offer.setYiaddr(offeredIP.IPAddressToByte());
  return offer;
}
Program: 155365
Project: 155365
Buggy source:
/** 
 * Automatically generated by the SimView program. Do not edit this manually, as such changes will get overwritten.
 */
public void layoutForSimView(){
  preferredSize=new Dimension(610,471);
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(258,299));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(16,54));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(21,331));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(183,149));
}

Fixed version (ground truth):
/** 
 * Automatically generated by the SimView program. Do not edit this manually, as such changes will get overwritten.
 */
public void layoutForSimView(){
  preferredSize=new Dimension(610,471);
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(168,128));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(0,73));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(10,294));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(222,337));
}
Program: 155366
Project: 155366
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void deltext(double e,message x){
  Continue(e);
  checkForHalt(x);
  if (phaseIs(RECEIVE_CAT)) {
    for (int i=0; i < x.size(); i++) {
      queueCatFile(x,i,e);
    }
  }
  checkForStartInput(x);
  checkForFlatFile(x);
  checkForCatFile(x);
  checkForDPDone(x);
  for (int i=0; i < x.size(); i++) {
    if (messageOnPort(x,LDR_DONE,i)) {
      entity value=x.getValOnPort(LDR_DONE,i);
      Pair pair=(Pair)value;
      loadersQueue.add(pair.getKey());
      CatFile aCatFile=(CatFile)pair.getValue();
      completedCatQueue.add(aCatFile);
      holdIn(SEND_CAT,0);
      this.setBackgroundColor(Color.GREEN);
      sendCatFilesToLoaders();
    }
  }
  if (phaseIs(PASSIVE) && doneDPReceived) {
    holdIn(SEND_CAT,0);
    this.setBackgroundColor(Color.GREEN);
    sendCatFilesToLoaders();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void deltext(double e,message x){
  Continue(e);
  checkForHalt(x);
  if (phaseIs(RECEIVE_CAT)) {
    for (int i=0; i < x.size(); i++) {
      queueCatFile(x,i,e);
    }
  }
  checkForStartInput(x);
  checkForFlatFile(x);
  checkForCatFile(x);
  checkForDPDone(x);
  for (int i=0; i < x.size(); i++) {
    if (messageOnPort(x,LDR_DONE,i)) {
      entity value=x.getValOnPort(LDR_DONE,i);
      Pair pair=(Pair)value;
      loadersQueue.add(pair.getKey());
      CatFile aCatFile=(CatFile)pair.getValue();
      completedCatQueue.add(aCatFile);
      holdIn(SEND_CAT,0);
      this.setBackgroundColor(Color.GREEN);
    }
  }
  if (phaseIs(PASSIVE) && doneDPReceived) {
    holdIn(SEND_CAT,0);
    this.setBackgroundColor(Color.GREEN);
  }
}
Program: 155367
Project: 155367
Buggy source:
/** 
 * Creates the messages for the loaders 
 */
private void sendCatFilesToLoaders(){
  catFilesOutMessage=new message();
  while (!loadersQueue.isEmpty() && !workingCatFileQueue.isEmpty()) {
    Loader_0_0 aLoader=(Loader_0_0)loadersQueue.remove();
    CatFile aCatFile=(CatFile)workingCatFileQueue.remove();
    Pair aPair=new Pair(aLoader.getName(),aCatFile);
    catFilesOutMessage.add(makeContent(CAT_OUT,aPair));
  }
}

Fixed version (ground truth):
/** 
 * Creates the messages for the loaders 
 */
private void sendCatFilesToLoaders(){
  if (catFilesOutMessage == null)   catFilesOutMessage=new message();
  while (!loadersQueue.isEmpty() && !workingCatFileQueue.isEmpty()) {
    Loader_0_0 aLoader=(Loader_0_0)loadersQueue.remove();
    CatFile aCatFile=(CatFile)workingCatFileQueue.remove();
    Pair aPair=new Pair(aLoader.getName(),aCatFile);
    catFilesOutMessage.add(makeContent(CAT_OUT,aPair));
  }
}
Program: 155368
Project: 155368
Buggy source:
@Override public message out(){
  if (phaseIs(HALTING)) {
    return haltMessage;
  }
  if (phaseIs(NOTIFY_CA)) {
    return loadFileMessage;
  }
  if (phaseIs(SEND_FF)) {
    return partitionFileMessage;
  }
  if (phaseIs(SEND_CAT)) {
    return catFilesOutMessage;
  }
  if (phaseIs(LDRS_DONE)) {
    loadersDoneMessage=new message();
    loadersDoneMessage.add(makeContent(LOAD,new entity("String_Node_Str")));
    return loadersDoneMessage;
  }
  return NULL_MESSAGE;
}

Fixed version (ground truth):
@Override public message out(){
  message theMessage=NULL_MESSAGE;
  if (phaseIs(HALTING)) {
    theMessage=haltMessage;
  }
  if (phaseIs(NOTIFY_CA)) {
    theMessage=loadFileMessage;
  }
  if (phaseIs(SEND_FF)) {
    theMessage=partitionFileMessage;
  }
  if (phaseIs(SEND_CAT)) {
    sendCatFilesToLoaders();
    theMessage=catFilesOutMessage;
    catFilesOutMessage=null;
  }
  if (phaseIs(LDRS_DONE)) {
    loadersDoneMessage=new message();
    loadersDoneMessage.add(makeContent(LOAD,new entity("String_Node_Str")));
    theMessage=loadersDoneMessage;
  }
  return theMessage;
}
Program: 155369
Project: 155369
Buggy source:
/** 
 * Automatically generated by the SimView program. Do not edit this manually, as such changes will get overwritten.
 */
public void layoutForSimView(){
  preferredSize=new Dimension(475,473);
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(41,108));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(55,297));
}

Fixed version (ground truth):
/** 
 * Automatically generated by the SimView program. Do not edit this manually, as such changes will get overwritten.
 */
public void layoutForSimView(){
  preferredSize=new Dimension(475,473);
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(58,367));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(41,108));
  ((ViewableComponent)withName("String_Node_Str")).setPreferredLocation(new Point(55,297));
}
Program: 155370
Project: 155370
Buggy source:
@SuppressWarnings("String_Node_Str") private void sendExtCatToWriters(){
  if (outputMessage == null) {
    outputMessage=new message();
  }
  if (currentCatFile == null && !workingCatFileQueue.isEmpty()) {
    currentCatFile=(CatFile)workingCatFileQueue.remove();
    if (currentCatFile.getProcessedExtCatList().isEmpty()) {
      workingExtCatFileQueue.addAll(currentCatFile.getExtCatList());
    }
  }
  while (!writersQueue.isEmpty() && !workingExtCatFileQueue.isEmpty()) {
    Writer_0_0 aWriter=(Writer_0_0)writersQueue.remove();
    ExtCatFile aCatFile=(ExtCatFile)workingExtCatFileQueue.remove();
    Pair aPair=new Pair(aWriter.getName(),aCatFile);
    outputMessage.add(makeContent(EXT_CAT_OUT,aPair));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void sendExtCatToWriters(){
  if (outputMessage == null) {
    outputMessage=new message();
  }
  if (currentCatFile == null && !workingCatFileQueue.isEmpty()) {
    currentCatFile=(CatFile)workingCatFileQueue.remove();
    while (workingExtCatFileQueue.size() <= writersQueue.size()) {
      if (currentCatFile.getProcessedExtCatList().isEmpty()) {
        workingExtCatFileQueue.addAll(currentCatFile.getExtCatList());
      }
    }
  }
  while (!writersQueue.isEmpty() && !workingExtCatFileQueue.isEmpty()) {
    Writer_0_0 aWriter=(Writer_0_0)writersQueue.remove();
    ExtCatFile aCatFile=(ExtCatFile)workingExtCatFileQueue.remove();
    Pair aPair=new Pair(aWriter.getName(),aCatFile);
    outputMessage.add(makeContent(EXT_CAT_OUT,aPair));
  }
}
Program: 155372
Project: 155372
Buggy source:
private void move(int diff_x,int diff_y){
  Boolean moving_allowed=false;
  if (Math.abs(diff_x) + Math.abs(diff_y) == 1) {
    moving_allowed=true;
  }
  int target_x=this.position_x + diff_x;
  int target_y=this.position_y + diff_y;
  int target_index=target_x + Server.board.getCols() * target_y;
  if (Server.board.getElements().get(target_index) instanceof Wall || Server.board.getElements().get(target_index) instanceof Bomb) {
    moving_allowed=false;
  }
  if (moving_allowed) {
    this.position_x+=diff_x;
    this.position_y+=diff_y;
    ArrayList<Integer> move=new ArrayList<Integer>();
    move.add(this.client_id);
    move.add(this.position_x);
    move.add(this.position_y);
    ArrayList<Integer> exceptions=new ArrayList<Integer>();
    exceptions.add(this.client_id);
    Server.sendAllBut("String_Node_Str",move,exceptions);
  }
 else {
    ArrayList<Integer> position=new ArrayList<Integer>();
    position.add(this.client_id);
    position.add(this.position_x);
    position.add(this.position_y);
    this.send("String_Node_Str",position);
  }
}

Fixed version (ground truth):
private void move(int diff_x,int diff_y){
  Boolean moving_allowed=false;
  if (Math.abs(diff_x) + Math.abs(diff_y) == 1) {
    moving_allowed=true;
  }
  int target_x=this.position_x + diff_x;
  int target_y=this.position_y + diff_y;
  int target_index=target_x + Server.board.getCols() * target_y;
  Element target_element=Server.board.getElements().get(target_index);
  if (target_element != null && !(target_element.isActive() && target_element.isWalkable())) {
    moving_allowed=false;
  }
  if (moving_allowed) {
    this.position_x+=diff_x;
    this.position_y+=diff_y;
    ArrayList<Integer> move=new ArrayList<Integer>();
    move.add(this.client_id);
    move.add(this.position_x);
    move.add(this.position_y);
    ArrayList<Integer> exceptions=new ArrayList<Integer>();
    exceptions.add(this.client_id);
    Server.sendAllBut("String_Node_Str",move,exceptions);
  }
 else {
    ArrayList<Integer> position=new ArrayList<Integer>();
    position.add(this.client_id);
    position.add(this.position_x);
    position.add(this.position_y);
    this.send("String_Node_Str",position);
  }
}
Program: 155373
Project: 155373
Buggy source:
public void setRandomPosition(){
  double nb_cases=Server.board.getCols() * Server.board.getRows();
  int i, x, y;
  Map<Integer,Integer> players_positions=Server.getPlayersPositions();
  do {
    i=(int)Math.round(Math.random() * nb_cases);
    x=i % Server.board.getCols();
    y=(int)Math.ceil(i / Server.board.getCols());
  }
 while (Server.board.getElements().get(i) != null || players_positions.containsKey(x) && players_positions.get(x) == y);
  this.position_x=x;
  this.position_y=y;
}

Fixed version (ground truth):
public void setRandomPosition(){
  double nb_cases=Server.board.getCols() * Server.board.getRows();
  int i, x, y;
  Map<Integer,Integer> players_positions=Server.getPlayersPositions();
  Element element;
  do {
    i=(int)Math.round(Math.random() * nb_cases);
    x=i % Server.board.getCols();
    y=(int)Math.ceil(i / Server.board.getCols());
    element=Server.board.getElements().get(i);
  }
 while ((element != null && !element.isWalkable()) || players_positions.containsKey(x) && players_positions.get(x) == y);
  this.position_x=x;
  this.position_y=y;
}
Program: 155374
Project: 155374
Buggy source:
public void run(){
  try {
    ArrayList<Integer> bomb_position=new ArrayList<Integer>();
    bomb_position.add(bomb.getX());
    bomb_position.add(bomb.getY());
    Thread.sleep(bomb.getSleepingTime());
    HashMap<Integer,ServerThread> players_threads=Server.getPlayersThreads();
    for (int i=1; i < Server.board.getCols() - 1; i++) {
      int index=i + Server.board.getCols() * bomb.getY();
      Element element=Server.board.getElements().get(index);
      if (element != null) {
        element.setActive(false);
      }
      for (      ServerThread thread : players_threads.values()) {
        if (thread.getPostionX() == i && thread.getPositionY() == bomb.getY()) {
          Server.killPlayer(thread.getClientId());
        }
      }
    }
    for (int i=1; i < Server.board.getRows() - 1; i++) {
      int index=bomb.getX() + Server.board.getCols() * i;
      Element element=Server.board.getElements().get(index);
      if (element != null) {
        element.setActive(false);
      }
      for (      ServerThread thread : players_threads.values()) {
        if (thread.getPostionX() == bomb.getX() && thread.getPositionY() == i) {
          Server.killPlayer(thread.getClientId());
        }
      }
    }
    Server.sendAll("String_Node_Str",bomb_position);
    thread.nb_bombs--;
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    ArrayList<Integer> bomb_position=new ArrayList<Integer>();
    bomb_position.add(bomb.getX());
    bomb_position.add(bomb.getY());
    Thread.sleep(bomb.getSleepingTime());
    HashMap<Integer,ServerThread> players_threads=Server.getPlayersThreads();
    for (int i=1; i < Server.board.getCols() - 1; i++) {
      int index=i + Server.board.getCols() * bomb.getY();
      Element element=Server.board.getElements().get(index);
      if (element != null) {
        if (element instanceof Bomb) {
          Server.board.setElement(index,null);
        }
 else {
          element.setActive(false);
        }
      }
      for (      ServerThread thread : players_threads.values()) {
        if (thread.getPostionX() == i && thread.getPositionY() == bomb.getY()) {
          Server.killPlayer(thread.getClientId());
        }
      }
    }
    for (int i=1; i < Server.board.getRows() - 1; i++) {
      int index=bomb.getX() + Server.board.getCols() * i;
      Element element=Server.board.getElements().get(index);
      if (element != null) {
        if (element instanceof Bomb) {
          Server.board.setElement(index,null);
        }
 else {
          element.setActive(false);
        }
      }
      for (      ServerThread thread : players_threads.values()) {
        if (thread.getPostionX() == bomb.getX() && thread.getPositionY() == i) {
          Server.killPlayer(thread.getClientId());
        }
      }
    }
    Server.sendAll("String_Node_Str",bomb_position);
    current_thread.nb_bombs--;
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 155375
Project: 155375
Buggy source:
private void dropBomb(){
  Bomb bomb=new Bomb();
  bomb.setX(this.position_x);
  bomb.setY(this.position_y);
  bomb.setSleepingTime(this.bomb_sleeping_time);
  ArrayList<Integer> bomb_position=new ArrayList<Integer>();
  bomb_position.add(bomb.getX());
  bomb_position.add(bomb.getY());
  int target_index=bomb.getX() + Server.board.getCols() * bomb.getY();
  Server.board.setElement(target_index,bomb);
  Server.sendAll("String_Node_Str",bomb_position);
  this.nb_bombs++;
  this.burstBomb(bomb,this);
}

Fixed version (ground truth):
private void dropBomb(){
  Bomb bomb=new Bomb();
  bomb.setX(this.position_x);
  bomb.setY(this.position_y);
  bomb.setSleepingTime(this.bomb_sleeping_time);
  ArrayList<Integer> bomb_position=new ArrayList<Integer>();
  bomb_position.add(bomb.getX());
  bomb_position.add(bomb.getY());
  int target_index=bomb.getX() + Server.board.getCols() * bomb.getY();
  Server.board.setElement(target_index,bomb);
  Server.sendAll("String_Node_Str",bomb_position);
  this.nb_bombs++;
  this.burstBomb(bomb);
}
Program: 155376
Project: 155376
Buggy source:
public void run(){
  try {
    Thread.sleep(fire_duration);
  }
 catch (  InterruptedException e) {
    System.out.println(e.getMessage());
  }
  for (  int i : add_fire) {
    int pos=fire.indexOf(i);
    if (pos != -1) {
      fire.remove(pos);
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Thread.sleep(fire_duration);
  }
 catch (  InterruptedException e) {
    System.out.println(e.getMessage());
  }
  for (  Integer i : add_fire) {
    fire.remove(i);
  }
}
Program: 155377
Project: 155377
Buggy source:
public void addFire(final List<Integer> add_fire){
  this.fire.addAll(add_fire);
  new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(fire_duration);
      }
 catch (      InterruptedException e) {
        System.out.println(e.getMessage());
      }
      for (      int i : add_fire) {
        int pos=fire.indexOf(i);
        if (pos != -1) {
          fire.remove(pos);
        }
      }
    }
  }
).start();
}

Fixed version (ground truth):
public void addFire(final List<Integer> add_fire){
  this.fire.addAll(add_fire);
  new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(fire_duration);
      }
 catch (      InterruptedException e) {
        System.out.println(e.getMessage());
      }
      for (      Integer i : add_fire) {
        fire.remove(i);
      }
    }
  }
).start();
}
Program: 155378
Project: 155378
Buggy source:
public void burstBomb(int x,int y){
  for (int i=1; i < this.getBoard().getCols() - 1; i++) {
    int index=i * this.getBoard().getRows() + y;
    this.getBoard().setElement(index,null);
  }
  for (int i=1; i < this.getBoard().getRows() - 1; i++) {
    int index=x * this.getBoard().getRows() + i;
    this.getBoard().setElement(index,null);
  }
}

Fixed version (ground truth):
public void burstBomb(int x,int y){
  for (int i=0; i < this.board.getCols(); i++) {
    int index=i + this.board.getCols() * y;
    Element element=this.board.getElements().get(index);
    if (element != null && element.isBreakable()) {
      this.board.setElement(index,null);
    }
  }
  for (int i=0; i < this.board.getRows(); i++) {
    int index=x + this.board.getCols() * i;
    Element element=this.board.getElements().get(index);
    if (element != null && element.isBreakable()) {
      this.board.setElement(index,null);
    }
  }
}
Program: 155379
Project: 155379
Buggy source:
public static Element factory(Map data) throws Exception {
  if (data == null) {
    return null;
  }
  Element element=null;
  if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Wall();
  }
 else   if (data.get("String_Node_Str").equals("String_Node_Str")) {
    Wall wall=new Wall();
    wall.setBreakable(false);
    element=wall;
  }
 else   if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Bomb();
  }
 else   if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Bonus();
  }
  if (element == null) {
    throw new Exception("String_Node_Str");
  }
  return element;
}

Fixed version (ground truth):
public static Element factory(Map data) throws Exception {
  if (data == null) {
    return null;
  }
  Element element=null;
  if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Wall();
  }
 else   if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Bomb();
  }
 else   if (data.get("String_Node_Str").equals("String_Node_Str")) {
    element=new Bonus();
  }
  if (data.containsKey("String_Node_Str")) {
    element.setBreakable((Boolean)data.get("String_Node_Str"));
  }
  if (data.containsKey("String_Node_Str")) {
    element.setWalkable((Boolean)data.get("String_Node_Str"));
  }
  if (element == null) {
    throw new Exception("String_Node_Str");
  }
  return element;
}
Program: 155380
Project: 155380
Buggy source:
public boolean isSquareWalkable(int i,int j){
  Element element=this.getElements().get(i * this.cols + j);
  if (element == null) {
    return true;
  }
  return element.isWalkable();
}

Fixed version (ground truth):
public boolean isSquareWalkable(int i,int j){
  Element element=this.getElements().get(j * this.cols + i);
  if (element == null) {
    return true;
  }
  return element.isWalkable();
}