nus-yam/ex-repair huggingface dataset:
Program: 166438
Project: 166438
Buggy source:
private VXResponse generateResponseForTestConn(HashMap<String,Object> responseData,String msg){
  VXResponse vXResponse=new VXResponse();
  Long objId=(responseData.get("String_Node_Str") != null) ? Long.parseLong(responseData.get("String_Node_Str").toString()) : null;
  boolean connectivityStatus=(responseData.get("String_Node_Str") != null) ? Boolean.parseBoolean(responseData.get("String_Node_Str").toString()) : false;
  int statusCode=(connectivityStatus) ? VXResponse.STATUS_SUCCESS : VXResponse.STATUS_ERROR;
  String message=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : msg;
  String description=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : msg;
  String fieldName=(responseData.get("String_Node_Str") != null) ? responseData.get("String_Node_Str").toString() : null;
  VXMessage vXMsg=new VXMessage();
  List<VXMessage> vXMsgList=new ArrayList<VXMessage>();
  vXMsg.setFieldName(fieldName);
  vXMsg.setMessage(message);
  vXMsg.setObjectId(objId);
  vXMsgList.add(vXMsg);
  vXResponse.setMessageList(vXMsgList);
  vXResponse.setMsgDesc(description);
  vXResponse.setStatusCode(statusCode);
  return vXResponse;
}

Fixed version (ground truth):
private VXResponse generateResponseForTestConn(HashMap<String,Object> responseData,String msg){
  VXResponse vXResponse=new VXResponse();
  Long objId=null;
  boolean connectivityStatus=false;
  int statusCode=VXResponse.STATUS_ERROR;
  String message=msg;
  String description=msg;
  String fieldName=null;
  if (responseData != null) {
    if (responseData.get("String_Node_Str") != null) {
      objId=Long.parseLong(responseData.get("String_Node_Str").toString());
    }
    if (responseData.get("String_Node_Str") != null) {
      connectivityStatus=Boolean.parseBoolean(responseData.get("String_Node_Str").toString());
    }
    if (connectivityStatus) {
      statusCode=VXResponse.STATUS_SUCCESS;
    }
    if (responseData.get("String_Node_Str") != null) {
      message=responseData.get("String_Node_Str").toString();
    }
    if (responseData.get("String_Node_Str") != null) {
      description=responseData.get("String_Node_Str").toString();
    }
    if (responseData.get("String_Node_Str") != null) {
      fieldName=responseData.get("String_Node_Str").toString();
    }
  }
  VXMessage vXMsg=new VXMessage();
  List<VXMessage> vXMsgList=new ArrayList<VXMessage>();
  vXMsg.setFieldName(fieldName);
  vXMsg.setMessage(message);
  vXMsg.setObjectId(objId);
  vXMsgList.add(vXMsg);
  vXResponse.setMessageList(vXMsgList);
  vXResponse.setMsgDesc(description);
  vXResponse.setStatusCode(statusCode);
  return vXResponse;
}
Program: 166439
Project: 166439
Buggy source:
void init(RangerServiceDef serviceDef,List<RangerPolicy> policies){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceDef + "String_Node_Str"+ (policies == null ? 0 : policies.size())+ "String_Node_Str");
  }
  this.serviceDef=serviceDef;
  contextEnrichers=new ArrayList<RangerContextEnricher>();
  if (!CollectionUtils.isEmpty(serviceDef.getContextEnrichers())) {
    for (    RangerServiceDef.RangerContextEnricherDef enricherDef : serviceDef.getContextEnrichers()) {
      if (enricherDef == null) {
        continue;
      }
      RangerContextEnricher contextEnricher=buildContextEnricher(enricherDef);
      contextEnrichers.add(contextEnricher);
    }
  }
  policyEvaluators=new ArrayList<RangerPolicyEvaluatorFacade>();
  for (  RangerPolicy policy : policies) {
    if (!policy.getIsEnabled()) {
      continue;
    }
    RangerPolicyEvaluatorFacade evaluator=buildPolicyEvaluator(policy,serviceDef);
    if (evaluator != null) {
      policyEvaluators.add(evaluator);
    }
  }
  Collections.sort(policyEvaluators);
  String propertyName="String_Node_Str" + serviceName + "String_Node_Str";
  int auditResultCacheSize=RangerConfiguration.getInstance().getInt(propertyName,RANGER_POLICYENGINE_AUDITRESULT_CACHE_SIZE);
  accessAuditCache=new CacheMap<String,Boolean>(auditResultCacheSize);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceDef + "String_Node_Str"+ (policies == null ? 0 : policies.size())+ "String_Node_Str");
  }
}

Fixed version (ground truth):
void init(RangerServiceDef serviceDef,List<RangerPolicy> policies){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceDef + "String_Node_Str"+ policies.size()+ "String_Node_Str");
  }
  this.serviceDef=serviceDef;
  contextEnrichers=new ArrayList<RangerContextEnricher>();
  if (!CollectionUtils.isEmpty(serviceDef.getContextEnrichers())) {
    for (    RangerServiceDef.RangerContextEnricherDef enricherDef : serviceDef.getContextEnrichers()) {
      if (enricherDef == null) {
        continue;
      }
      RangerContextEnricher contextEnricher=buildContextEnricher(enricherDef);
      contextEnrichers.add(contextEnricher);
    }
  }
  policyEvaluators=new ArrayList<RangerPolicyEvaluatorFacade>();
  for (  RangerPolicy policy : policies) {
    if (!policy.getIsEnabled()) {
      continue;
    }
    RangerPolicyEvaluatorFacade evaluator=buildPolicyEvaluator(policy,serviceDef);
    if (evaluator != null) {
      policyEvaluators.add(evaluator);
    }
  }
  Collections.sort(policyEvaluators);
  String propertyName="String_Node_Str" + serviceName + "String_Node_Str";
  int auditResultCacheSize=RangerConfiguration.getInstance().getInt(propertyName,RANGER_POLICYENGINE_AUDITRESULT_CACHE_SIZE);
  accessAuditCache=new CacheMap<String,Boolean>(auditResultCacheSize);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + serviceDef + "String_Node_Str"+ policies.size()+ "String_Node_Str");
  }
}
Program: 166440
Project: 166440
Buggy source:
public boolean isSingleAndExactMatch(RangerAccessResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  boolean ret=false;
  RangerServiceDef serviceDef=getServiceDef();
  if (serviceDef != null && serviceDef.getResources() != null) {
    Collection<String> resourceKeys=resource == null ? null : resource.getKeys();
    Collection<String> policyKeys=matchers == null ? null : matchers.keySet();
    boolean keysMatch=CollectionUtils.isEqualCollection(resourceKeys,policyKeys);
    if (keysMatch) {
      for (      RangerResourceDef resourceDef : serviceDef.getResources()) {
        String resourceName=resourceDef.getName();
        String resourceValue=resource == null ? null : resource.getValue(resourceName);
        RangerResourceMatcher matcher=matchers == null ? null : matchers.get(resourceName);
        if (StringUtils.isEmpty(resourceValue)) {
          ret=matcher == null || matcher.isSingleAndExactMatch(resourceValue);
        }
 else {
          ret=matcher != null && matcher.isSingleAndExactMatch(resourceValue);
        }
        if (!ret) {
          break;
        }
      }
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + resourceKeys + "String_Node_Str"+ policyKeys);
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
public boolean isSingleAndExactMatch(RangerAccessResource resource){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str");
  }
  boolean ret=false;
  RangerServiceDef serviceDef=getServiceDef();
  if (serviceDef != null && serviceDef.getResources() != null) {
    Collection<String> resourceKeys=resource == null ? null : resource.getKeys();
    Collection<String> policyKeys=matchers == null ? null : matchers.keySet();
    boolean keysMatch=false;
    if (resourceKeys != null && policyKeys != null) {
      keysMatch=CollectionUtils.isEqualCollection(resourceKeys,policyKeys);
    }
    if (keysMatch) {
      for (      RangerResourceDef resourceDef : serviceDef.getResources()) {
        String resourceName=resourceDef.getName();
        String resourceValue=resource == null ? null : resource.getValue(resourceName);
        RangerResourceMatcher matcher=matchers == null ? null : matchers.get(resourceName);
        if (StringUtils.isEmpty(resourceValue)) {
          ret=matcher == null || matcher.isSingleAndExactMatch(resourceValue);
        }
 else {
          ret=matcher != null && matcher.isSingleAndExactMatch(resourceValue);
        }
        if (!ret) {
          break;
        }
      }
    }
 else {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + resourceKeys + "String_Node_Str"+ policyKeys);
      }
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + resource + "String_Node_Str"+ ret);
  }
  return ret;
}
Program: 166441
Project: 166441
Buggy source:
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (resourceDef != null) {
    resourceDef.toString(sb);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (policyResource != null) {
    policyResource.toString(sb);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(optionsString).append("String_Node_Str");
  sb.append("String_Node_Str").append(optIgnoreCase).append("String_Node_Str");
  sb.append("String_Node_Str").append(optWildCard).append("String_Node_Str");
  sb.append("String_Node_Str").append(StringUtils.join(policyValues,"String_Node_Str")).append("String_Node_Str");
  sb.append("String_Node_Str").append(policyIsExcludes).append("String_Node_Str");
  sb.append("String_Node_Str").append(isMatchAny).append("String_Node_Str");
  sb.append("String_Node_Str");
  if (options != null) {
    for (    Map.Entry<String,String> e : options.entrySet()) {
      sb.append(e.getKey()).append("String_Node_Str").append(e.getValue()).append(OPTIONS_SEP);
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (resourceDef != null) {
    resourceDef.toString(sb);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  if (policyResource != null) {
    policyResource.toString(sb);
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(optionsString).append("String_Node_Str");
  sb.append("String_Node_Str").append(optIgnoreCase).append("String_Node_Str");
  sb.append("String_Node_Str").append(optWildCard).append("String_Node_Str");
  sb.append("String_Node_Str");
  if (policyValues != null) {
    for (    String value : policyValues) {
      sb.append(value).append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(policyIsExcludes).append("String_Node_Str");
  sb.append("String_Node_Str").append(isMatchAny).append("String_Node_Str");
  sb.append("String_Node_Str");
  if (options != null) {
    for (    Map.Entry<String,String> e : options.entrySet()) {
      sb.append(e.getKey()).append("String_Node_Str").append(e.getValue()).append(OPTIONS_SEP);
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}
Program: 166442
Project: 166442
Buggy source:
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str");
  if (policyValues != null) {
    for (    String value : policyValues) {
      sb.append(value).append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(policyIsExcludes).append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str");
  return sb;
}
Program: 166443
Project: 166443
Buggy source:
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str");
  if (policyValues != null) {
    for (    String value : policyValues) {
      sb.append(value).append("String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(policyIsExcludes).append("String_Node_Str");
  sb.append("String_Node_Str").append(policyIsRecursive).append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}

Fixed version (ground truth):
public StringBuilder toString(StringBuilder sb){
  sb.append("String_Node_Str");
  super.toString(sb);
  sb.append("String_Node_Str").append(policyIsRecursive).append("String_Node_Str");
  sb.append("String_Node_Str");
  return sb;
}
Program: 166444
Project: 166444
Buggy source:
public synchronized void init(RangerPolicyEngine policyEngine){
  cleanup();
  RangerConfiguration.getInstance().addResourcesForServiceType(serviceType);
  RangerConfiguration.getInstance().initAudit(appId);
  String propertyPrefix="String_Node_Str" + serviceType;
  long pollingIntervalMs=RangerConfiguration.getInstance().getLong(propertyPrefix + "String_Node_Str",30 * 1000);
  String cacheDir=RangerConfiguration.getInstance().get(propertyPrefix + "String_Node_Str");
  serviceName=RangerConfiguration.getInstance().get(propertyPrefix + "String_Node_Str");
  RangerAdminClient admin=createAdminClient(propertyPrefix);
  refresher=new PolicyRefresher(policyEngine,serviceType,appId,serviceName,admin,pollingIntervalMs,cacheDir);
  refresher.startRefresher();
  this.policyEngine=policyEngine;
}

Fixed version (ground truth):
public void init(RangerPolicyEngine policyEngine){
  cleanup();
  RangerConfiguration.getInstance().addResourcesForServiceType(serviceType);
  RangerConfiguration.getInstance().initAudit(appId);
  String propertyPrefix="String_Node_Str" + serviceType;
  long pollingIntervalMs=RangerConfiguration.getInstance().getLong(propertyPrefix + "String_Node_Str",30 * 1000);
  String cacheDir=RangerConfiguration.getInstance().get(propertyPrefix + "String_Node_Str");
  serviceName=RangerConfiguration.getInstance().get(propertyPrefix + "String_Node_Str");
  RangerAdminClient admin=createAdminClient(propertyPrefix);
  refresher=new PolicyRefresher(policyEngine,serviceType,appId,serviceName,admin,pollingIntervalMs,cacheDir);
  refresher.startRefresher();
  this.policyEngine=policyEngine;
}
Program: 166445
Project: 166445
Buggy source:
public synchronized void cleanup(){
  PolicyRefresher refresher=this.refresher;
  this.serviceName=null;
  this.policyEngine=null;
  this.refresher=null;
  if (refresher != null) {
    refresher.stopRefresher();
  }
}

Fixed version (ground truth):
public void cleanup(){
  PolicyRefresher refresher=this.refresher;
  this.serviceName=null;
  this.policyEngine=null;
  this.refresher=null;
  if (refresher != null) {
    refresher.stopRefresher();
  }
}
Program: 166446
Project: 166446
Buggy source:
RangerAccessResult buildResult(boolean allowed,boolean audited,String reason){
  RangerAccessResult result=_authorizer.createAccessResult(_request);
  result.setIsAllowed(allowed);
  result.setReason(reason);
  result.setIsAudited(audited);
  return result;
}

Fixed version (ground truth):
RangerAccessResult buildResult(boolean allowed,boolean audited,String reason){
  RangerAccessResult result=_authorizer.createAccessResult(_request);
  if (result != null) {
    result.setIsAllowed(allowed);
    result.setReason(reason);
    result.setIsAudited(audited);
  }
  return result;
}
Program: 166447
Project: 166447
Buggy source:
protected void requireSystemOrSuperUser(Configuration conf) throws IOException {
  User user=User.getCurrent();
  if (user == null) {
    throw new IOException("String_Node_Str");
  }
  String currentUser=user.getShortName();
  List<String> superusers=Lists.asList(currentUser,conf.getStrings(SUPERUSER_CONFIG_PROP,new String[0]));
  User activeUser=getActiveUser();
  if (!(superusers.contains(activeUser.getShortName()))) {
    throw new AccessDeniedException("String_Node_Str" + (user != null ? user.getShortName() : "String_Node_Str") + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void requireSystemOrSuperUser(Configuration conf) throws IOException {
  User user=User.getCurrent();
  if (user == null) {
    throw new IOException("String_Node_Str");
  }
  String currentUser=user.getShortName();
  List<String> superusers=Lists.asList(currentUser,conf.getStrings(SUPERUSER_CONFIG_PROP,new String[0]));
  User activeUser=getActiveUser();
  if (!(superusers.contains(activeUser.getShortName()))) {
    throw new AccessDeniedException("String_Node_Str" + user.getShortName() + "String_Node_Str");
  }
}
Program: 166449
Project: 166449
Buggy source:
public static boolean AuthorizeAccessForUser(String aPathName,String aPathOwnerName,FsAction access,String user,Set<String> groups) throws RangerAccessControlException {
  boolean accessGranted=false;
  if (aPathName != null && aPathOwnerName != null && access != null && user != null && groups != null) {
    if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(aPathName)) {
      aPathName=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
    }
    RangerHdfsPlugin plugin=rangerPlugin;
    if (plugin == null) {
synchronized (RangerFSPermissionChecker.class) {
        plugin=rangerPlugin;
        if (plugin == null) {
          try {
            plugin=new RangerHdfsPlugin();
            plugin.init();
            rangerPlugin=plugin;
          }
 catch (          Throwable t) {
            LOG.error("String_Node_Str",t);
          }
        }
      }
    }
    if (rangerPlugin != null) {
      Set<String> accessTypes=access2ActionListMapper.get(access);
      boolean isAllowed=true;
      for (      String accessType : accessTypes) {
        RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(aPathName,aPathOwnerName,access,accessType,user,groups);
        RangerAccessResult result=rangerPlugin.isAccessAllowed(request,getCurrentAuditHandler());
        isAllowed=result.getIsAllowed();
        if (!isAllowed) {
          break;
        }
      }
      accessGranted=isAllowed;
    }
  }
  return accessGranted;
}

Fixed version (ground truth):
public static boolean AuthorizeAccessForUser(String aPathName,String aPathOwnerName,FsAction access,String user,Set<String> groups) throws RangerAccessControlException {
  boolean accessGranted=false;
  if (aPathName != null && aPathOwnerName != null && access != null && user != null && groups != null) {
    if (RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH_ALT.equals(aPathName)) {
      aPathName=RangerHadoopConstants.HDFS_ROOT_FOLDER_PATH;
    }
    RangerHdfsPlugin plugin=rangerPlugin;
    if (plugin == null) {
synchronized (RangerFSPermissionChecker.class) {
        plugin=rangerPlugin;
        if (plugin == null) {
          try {
            plugin=new RangerHdfsPlugin();
            plugin.init();
            rangerPlugin=plugin;
          }
 catch (          Throwable t) {
            LOG.error("String_Node_Str",t);
          }
        }
      }
    }
    if (rangerPlugin != null) {
      Set<String> accessTypes=access2ActionListMapper.get(access);
      boolean isAllowed=true;
      for (      String accessType : accessTypes) {
        RangerHdfsAccessRequest request=new RangerHdfsAccessRequest(aPathName,aPathOwnerName,access,accessType,user,groups);
        RangerAccessResult result=rangerPlugin.isAccessAllowed(request,getCurrentAuditHandler());
        isAllowed=result != null && result.getIsAllowed();
        if (!isAllowed) {
          break;
        }
      }
      accessGranted=isAllowed;
    }
  }
  return accessGranted;
}
Program: 166455
Project: 166455
Buggy source:
@Override public KeyVersion getKeyVersion(String versionName) throws IOException {
  SecretKeySpec key=null;
  try {
    if (!dbStore.engineContainsAlias(versionName)) {
      return null;
    }
    key=(SecretKeySpec)dbStore.engineGetKey(versionName,masterKey);
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str" + key,e);
  }
catch (  UnrecoverableKeyException e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str" + key,e);
  }
  return new KeyVersion(getBaseName(versionName),versionName,key.getEncoded());
}

Fixed version (ground truth):
@Override public KeyVersion getKeyVersion(String versionName) throws IOException {
  SecretKeySpec key=null;
  try {
    if (!dbStore.engineContainsAlias(versionName)) {
      return null;
    }
    key=(SecretKeySpec)dbStore.engineGetKey(versionName,masterKey);
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str" + key,e);
  }
catch (  UnrecoverableKeyException e) {
    e.printStackTrace();
    throw new IOException("String_Node_Str" + key,e);
  }
  if (key == null) {
    return null;
  }
 else {
    return new KeyVersion(getBaseName(versionName),versionName,key.getEncoded());
  }
}
Program: 166459
Project: 166459
Buggy source:
@Override public KeyVersion getKeyVersion(String versionName) throws IOException {
  return null;
}

Fixed version (ground truth):
@Override public KeyVersion getKeyVersion(String versionName) throws IOException {
  KeyVersion version=null;
  return version;
}
Program: 166460
Project: 166460
Buggy source:
@Override public Metadata getMetadata(String name) throws IOException {
  new KeyProvider.Metadata(null);
  return null;
}

Fixed version (ground truth):
@Override public Metadata getMetadata(String name) throws IOException {
  Metadata metadata=null;
  return metadata;
}
Program: 166461
Project: 166461
Buggy source:
@Override public List<KeyVersion> getKeyVersions(String name) throws IOException {
  return null;
}

Fixed version (ground truth):
@Override public List<KeyVersion> getKeyVersions(String name) throws IOException {
  List<KeyVersion> keys=null;
  return keys;
}
Program: 166462
Project: 166462
Buggy source:
@Override public KeyVersion createKey(String name,byte[] material,Options options) throws IOException {
  return null;
}

Fixed version (ground truth):
@Override public KeyVersion createKey(String name,byte[] material,Options options) throws IOException {
  KeyVersion version=null;
  return version;
}
Program: 166463
Project: 166463
Buggy source:
@Override public List<String> getKeys() throws IOException {
  return null;
}

Fixed version (ground truth):
@Override public List<String> getKeys() throws IOException {
  List<String> keys=null;
  return keys;
}
Program: 166464
Project: 166464
Buggy source:
@Override public KeyVersion rollNewVersion(String name,byte[] material) throws IOException {
  return null;
}

Fixed version (ground truth):
@Override public KeyVersion rollNewVersion(String name,byte[] material) throws IOException {
  KeyVersion version=null;
  return version;
}
Program: 166465
Project: 166465
Buggy source:
public void shutdownServer(){
  int timeWaitForShutdownInSeconds=getIntConfig("String_Node_Str",120);
  if (timeWaitForShutdownInSeconds > 0) {
    long endTime=System.currentTimeMillis() + (timeWaitForShutdownInSeconds * 1000L);
    LOG.info("String_Node_Str" + new Date(endTime));
    while (System.currentTimeMillis() < endTime) {
      int activeCount=Thread.activeCount();
      if (activeCount == 0) {
        LOG.info("String_Node_Str" + activeCount + "String_Node_Str");
        break;
      }
 else {
        LOG.info("String_Node_Str" + activeCount + "String_Node_Str");
        try {
          Thread.sleep(5000L);
        }
 catch (        InterruptedException e) {
          LOG.warning("String_Node_Str" + e);
          break;
        }
      }
    }
  }
  LOG.info("String_Node_Str");
  System.exit(0);
}

Fixed version (ground truth):
public void shutdownServer(){
  int timeWaitForShutdownInSeconds=getIntConfig("String_Node_Str",0);
  if (timeWaitForShutdownInSeconds > 0) {
    long endTime=System.currentTimeMillis() + (timeWaitForShutdownInSeconds * 1000L);
    LOG.info("String_Node_Str" + new Date(endTime));
    while (System.currentTimeMillis() < endTime) {
      int activeCount=Thread.activeCount();
      if (activeCount == 0) {
        LOG.info("String_Node_Str" + activeCount + "String_Node_Str");
        break;
      }
 else {
        LOG.info("String_Node_Str" + activeCount + "String_Node_Str");
        try {
          Thread.sleep(5000L);
        }
 catch (        InterruptedException e) {
          LOG.warning("String_Node_Str" + e);
          break;
        }
      }
    }
  }
  LOG.info("String_Node_Str");
  System.exit(0);
}
Program: 166467
Project: 166467
Buggy source:
protected String getConfig(String key,String defaultValue){
  String ret=getConfig(key);
  if (key == null) {
    ret=defaultValue;
  }
  return ret;
}

Fixed version (ground truth):
protected String getConfig(String key,String defaultValue){
  String ret=getConfig(key);
  if (ret == null) {
    ret=defaultValue;
  }
  return ret;
}
Program: 166468
Project: 166468
Buggy source:
/** 
 * Check if user has privileges to do this action on these objects
 * @param hiveOpType
 * @param inputsHObjs
 * @param outputHObjs
 * @param context
 * @throws HiveAuthzPluginException
 * @throws HiveAccessControlException
 */
@Override public List<HivePrivilegeObject> filterListCmdObjects(List<HivePrivilegeObject> objs,HiveAuthzContext context) throws HiveAuthzPluginException, HiveAccessControlException {
  List<HivePrivilegeObject> ret=null;
  ret=objs;
  return ret;
}

Fixed version (ground truth):
/** 
 * Check if user has privileges to do this action on these objects
 * @param hiveOpType
 * @param inputsHObjs
 * @param outputHObjs
 * @param context
 * @throws HiveAuthzPluginException
 * @throws HiveAccessControlException
 */
public List<HivePrivilegeObject> filterListCmdObjects(List<HivePrivilegeObject> objs,HiveAuthzContext context) throws HiveAuthzPluginException, HiveAccessControlException {
  List<HivePrivilegeObject> ret=null;
  ret=objs;
  return ret;
}
Program: 166469
Project: 166469
Buggy source:
public static void createParents(File file){
  if (file != null) {
    String parentName=file.getParent();
    if (parentName != null) {
      File parentDir=new File(parentName);
      if (!parentDir.exists()) {
        parentDir.mkdirs();
      }
    }
  }
}

Fixed version (ground truth):
public static void createParents(File file){
  if (file != null) {
    String parentName=file.getParent();
    if (parentName != null) {
      File parentDir=new File(parentName);
      if (!parentDir.exists()) {
        if (!parentDir.mkdirs()) {
          LogLog.warn("String_Node_Str" + parentName + "String_Node_Str");
        }
      }
    }
  }
}
Program: 166470
Project: 166470
Buggy source:
public static void init(MasterServices master) throws IOException {
  try {
    AccessControlLists.init(master);
  }
 catch (  TableExistsException excp) {
  }
}

Fixed version (ground truth):
public static void init(MasterServices master) throws IOException {
  Class<AccessControlLists> accessControlListsClass=AccessControlLists.class;
  String cName=accessControlListsClass.getName();
  Class<?>[] params=new Class[1];
  params[0]=MasterServices.class;
  for (  String mname : new String[]{"String_Node_Str","String_Node_Str"}) {
    try {
      try {
        Method m=accessControlListsClass.getDeclaredMethod(mname,params);
        if (m != null) {
          try {
            try {
              m.invoke(null,master);
              logInfo("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str");
            }
 catch (            InvocationTargetException e) {
              Throwable cause=e;
              boolean tableExistsExceptionFound=false;
              if (e != null) {
                Throwable ecause=e.getTargetException();
                if (ecause != null) {
                  cause=ecause;
                  if (ecause instanceof TableExistsException) {
                    tableExistsExceptionFound=true;
                  }
                }
              }
              if (!tableExistsExceptionFound) {
                logError("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str",cause);
                throw new IOException(cause);
              }
            }
            return;
          }
 catch (          IllegalArgumentException e) {
            logError("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str",e);
            throw new IOException(e);
          }
catch (          IllegalAccessException e) {
            logError("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str",e);
            throw new IOException(e);
          }
        }
      }
 catch (      NoSuchMethodException nsme) {
        logInfo("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str");
      }
    }
 catch (    SecurityException e) {
      logError("String_Node_Str" + mname + "String_Node_Str"+ cName+ "String_Node_Str",e);
      throw new IOException(e);
    }
  }
  throw new IOException("String_Node_Str" + cName + "String_Node_Str");
}
Program: 166471
Project: 166471
Buggy source:
public void print(){
  for (  String user : userList) {
    LOG.debug("String_Node_Str" + user);
    List<String> groups=user2GroupListMap.get(user);
    if (groups != null) {
      for (      String group : groups) {
        LOG.debug("String_Node_Str" + group);
      }
    }
  }
}

Fixed version (ground truth):
private void print(){
  for (  String user : user2GroupListMap.keySet()) {
    LOG.debug("String_Node_Str" + user);
    List<String> groups=user2GroupListMap.get(user);
    if (groups != null) {
      for (      String group : groups) {
        LOG.debug("String_Node_Str" + group);
      }
    }
  }
}
Program: 166472
Project: 166472
Buggy source:
private void buildUnixUserList() throws Throwable {
  File f=new File(UNIX_USER_PASSWORD_FILE);
  if (f.exists()) {
    BufferedReader reader=null;
    reader=new BufferedReader(new FileReader(f));
    String line=null;
    while ((line=reader.readLine()) != null) {
      if (line.trim().isEmpty())       continue;
      String[] tokens=line.split("String_Node_Str");
      int len=tokens.length;
      if (len < 2) {
        continue;
      }
      String userName=tokens[0];
      String userId=tokens[2];
      String groupId=tokens[3];
      int numUserId=-1;
      try {
        numUserId=Integer.parseInt(userId);
      }
 catch (      NumberFormatException nfe) {
        LOG.warn("String_Node_Str" + userId + "String_Node_Str",nfe);
        numUserId=-1;
      }
      if (numUserId >= minimumUserId) {
        userList.add(userName);
        String groupName=groupId2groupNameMap.get(groupId);
        if (groupName != null) {
          List<String> groupList=user2GroupListMap.get(userName);
          if (groupList == null) {
            groupList=new ArrayList<String>();
            user2GroupListMap.put(userName,groupList);
          }
          if (!groupList.contains(groupName)) {
            groupList.add(groupName);
          }
        }
 else {
          LOG.warn("String_Node_Str" + groupId + "String_Node_Str");
        }
      }
    }
    reader.close();
    passwordFileModiiedAt=f.lastModified();
  }
}

Fixed version (ground truth):
private void buildUnixUserList() throws Throwable {
  File f=new File(UNIX_USER_PASSWORD_FILE);
  if (f.exists()) {
    BufferedReader reader=null;
    reader=new BufferedReader(new FileReader(f));
    String line=null;
    while ((line=reader.readLine()) != null) {
      if (line.trim().isEmpty())       continue;
      String[] tokens=line.split("String_Node_Str");
      int len=tokens.length;
      if (len < 2) {
        continue;
      }
      String userName=tokens[0];
      String userId=tokens[2];
      String groupId=tokens[3];
      int numUserId=-1;
      try {
        numUserId=Integer.parseInt(userId);
      }
 catch (      NumberFormatException nfe) {
        LOG.warn("String_Node_Str" + userId + "String_Node_Str",nfe);
        numUserId=-1;
      }
      if (numUserId >= minimumUserId) {
        String groupName=groupId2groupNameMap.get(groupId);
        if (groupName != null) {
          List<String> groupList=new ArrayList<String>();
          groupList.add(groupName);
          if (internalUser2GroupListMap.containsKey(userName)) {
            groupList.addAll(internalUser2GroupListMap.get(userName));
          }
          user2GroupListMap.put(userName,groupList);
        }
 else {
          LOG.warn("String_Node_Str" + groupId + "String_Node_Str"+ userName+ "String_Node_Str"+ userId+ "String_Node_Str");
        }
      }
 else {
        LOG.debug("String_Node_Str" + userName + "String_Node_Str"+ userId+ "String_Node_Str"+ minimumUserId+ "String_Node_Str");
      }
    }
    reader.close();
    passwordFileModiiedAt=f.lastModified();
  }
}
Program: 166473
Project: 166473
Buggy source:
private void buildUnixGroupList() throws Throwable {
  File f=new File(UNIX_GROUP_FILE);
  if (f.exists()) {
    BufferedReader reader=null;
    reader=new BufferedReader(new FileReader(f));
    String line=null;
    while ((line=reader.readLine()) != null) {
      if (line.trim().isEmpty())       continue;
      String[] tokens=line.split("String_Node_Str");
      int len=tokens.length;
      if (len < 2) {
        continue;
      }
      String groupName=tokens[0];
      String groupId=tokens[2];
      String groupMembers=null;
      if (tokens.length > 3) {
        groupMembers=tokens[3];
      }
      if (groupId2groupNameMap.containsKey(groupId)) {
        groupId2groupNameMap.remove(groupId);
      }
      groupId2groupNameMap.put(groupId,groupName);
      if (groupMembers != null && !groupMembers.trim().isEmpty()) {
        for (        String user : groupMembers.split("String_Node_Str")) {
          List<String> groupList=user2GroupListMap.get(user);
          if (groupList == null) {
            groupList=new ArrayList<String>();
            user2GroupListMap.put(user,groupList);
          }
          if (!groupList.contains(groupName)) {
            groupList.add(groupName);
          }
        }
      }
    }
    reader.close();
    groupFileModifiedAt=f.lastModified();
  }
}

Fixed version (ground truth):
private void buildUnixGroupList() throws Throwable {
  File f=new File(UNIX_GROUP_FILE);
  if (f.exists()) {
    BufferedReader reader=null;
    reader=new BufferedReader(new FileReader(f));
    String line=null;
    while ((line=reader.readLine()) != null) {
      if (line.trim().isEmpty())       continue;
      String[] tokens=line.split("String_Node_Str");
      int len=tokens.length;
      if (len < 2) {
        continue;
      }
      String groupName=tokens[0];
      String groupId=tokens[2];
      String groupMembers=null;
      if (tokens.length > 3) {
        groupMembers=tokens[3];
      }
      if (groupId2groupNameMap.containsKey(groupId)) {
        groupId2groupNameMap.remove(groupId);
      }
      groupId2groupNameMap.put(groupId,groupName);
      if (groupMembers != null && !groupMembers.trim().isEmpty()) {
        for (        String user : groupMembers.split("String_Node_Str")) {
          List<String> groupList=internalUser2GroupListMap.get(user);
          if (groupList == null) {
            groupList=new ArrayList<String>();
            internalUser2GroupListMap.put(user,groupList);
          }
          if (!groupList.contains(groupName)) {
            groupList.add(groupName);
          }
        }
      }
    }
    reader.close();
    groupFileModifiedAt=f.lastModified();
  }
}
Program: 166474
Project: 166474
Buggy source:
private void buildUserGroupInfo() throws Throwable {
  user2GroupListMap=new HashMap<String,List<String>>();
  groupId2groupNameMap=new HashMap<String,String>();
  userList=new ArrayList<String>();
  buildUnixGroupList();
  buildUnixUserList();
  if (LOG.isDebugEnabled()) {
    print();
  }
}

Fixed version (ground truth):
private void buildUserGroupInfo() throws Throwable {
  user2GroupListMap=new HashMap<String,List<String>>();
  groupId2groupNameMap=new HashMap<String,String>();
  buildUnixGroupList();
  buildUnixUserList();
  if (LOG.isDebugEnabled()) {
    print();
  }
}
Program: 166476
Project: 166476
Buggy source:
public StormClient(String aStormUIUrl,String aUserName,String aPassword){
  this.stormUIUrl=aStormUIUrl;
  this.userName=aUserName;
  this.password=aPassword;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + aStormUIUrl + "String_Node_Str"+ aUserName+ "String_Node_Str"+ aPassword+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public StormClient(String aStormUIUrl,String aUserName,String aPassword){
  this.stormUIUrl=aStormUIUrl;
  this.userName=aUserName;
  this.password=aPassword;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + aStormUIUrl + "String_Node_Str"+ aUserName+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 166482
Project: 166482
Buggy source:
public XAHdfsAuditEventDao getXAHdfsAuditEvent(){
  return new XAHdfsAuditEventDao(this);
}

Fixed version (ground truth):
public XAHdfsAuditEventDao getXAHdfsAuditEvent(){
  if (mHdfsDao == null) {
    mHdfsDao=new XAHdfsAuditEventDao(this);
  }
  return mHdfsDao;
}
Program: 166483
Project: 166483
Buggy source:
public XAHiveAuditEventDao getXAHiveAuditEvent(){
  return new XAHiveAuditEventDao(this);
}

Fixed version (ground truth):
public XAHiveAuditEventDao getXAHiveAuditEvent(){
  if (mHiveDao == null) {
    mHiveDao=new XAHiveAuditEventDao(this);
  }
  return mHiveDao;
}
Program: 166484
Project: 166484
Buggy source:
public XAStormAuditEventDao getXAStormAuditEvent(){
  return new XAStormAuditEventDao(this);
}

Fixed version (ground truth):
public XAStormAuditEventDao getXAStormAuditEvent(){
  if (mStormDao == null) {
    mStormDao=new XAStormAuditEventDao(this);
  }
  return mStormDao;
}
Program: 166485
Project: 166485
Buggy source:
public XAHBaseAuditEventDao getXAHBaseAuditEvent(){
  return new XAHBaseAuditEventDao(this);
}

Fixed version (ground truth):
public XAHBaseAuditEventDao getXAHBaseAuditEvent(){
  if (mHBaseDao == null) {
    mHBaseDao=new XAHBaseAuditEventDao(this);
  }
  return mHBaseDao;
}
Program: 166486
Project: 166486
Buggy source:
public XAKnoxAuditEventDao getXAKnoxAuditEvent(){
  return new XAKnoxAuditEventDao(this);
}

Fixed version (ground truth):
public XAKnoxAuditEventDao getXAKnoxAuditEvent(){
  if (mKnoxDao == null) {
    mKnoxDao=new XAKnoxAuditEventDao(this);
  }
  return mKnoxDao;
}
Program: 166487
Project: 166487
Buggy source:
public KnoxAuditEvent(){
}

Fixed version (ground truth):
public KnoxAuditEvent(){
  this.repositoryType=EnumRepositoryType.KNOX;
}
Program: 166488
Project: 166488
Buggy source:
public StormAuditEvent(){
}

Fixed version (ground truth):
public StormAuditEvent(){
  this.repositoryType=EnumRepositoryType.STORM;
}
Program: 166489
Project: 166489
Buggy source:
@Override public void log(HiveAuditEvent event){
  LOG.debug("String_Node_Str");
  queueEvent(event);
}

Fixed version (ground truth):
@Override public void log(AuditEventBase event){
  LOG.debug("String_Node_Str");
  queueEvent(event);
}
Program: 166490
Project: 166490
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  try {
    while (!mStopThread) {
      AuditEventBase event=dequeueEvent();
      if (event != null) {
        logEvent(event);
      }
 else {
        flush();
      }
    }
    flush();
  }
 catch (  Exception excp) {
    LOG.error("String_Node_Str",excp);
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str");
  try {
    while (!mStopThread) {
      AuditEventBase event=dequeueEvent();
      if (event != null) {
        super.log(event);
      }
 else {
        flush();
      }
    }
    flush();
  }
 catch (  Exception excp) {
    LOG.error("String_Node_Str",excp);
  }
  LOG.info("String_Node_Str");
}
Program: 166491
Project: 166491
Buggy source:
public void log(StormAuditEvent event);

Fixed version (ground truth):
public void log(AuditEventBase event);
Program: 166492
Project: 166492
Buggy source:
@Override public void log(StormAuditEvent event){
  LOG.debug("String_Node_Str");
  if (preCreate(event)) {
    stormDao.create(new XXStormAuditEvent(event));
    postCreate(event);
  }
}

Fixed version (ground truth):
@Override public void log(AuditEventBase event){
  LOG.debug("String_Node_Str");
  if (preCreate(event)) {
    event.persist(daoManager);
    postCreate(event);
  }
}
Program: 166494
Project: 166494
Buggy source:
public void initHBase(){
  try {
    if (UserGroupInformation.isSecurityEnabled()) {
      if (getConfigHolder().getKeyTabFile() == null) {
        subj=SecureClientLogin.loginUserWithPassword(getConfigHolder().getUserName(),getConfigHolder().getPassword());
      }
 else {
        subj=SecureClientLogin.loginUserFromKeytab(getConfigHolder().getUserName(),getConfigHolder().getKeyTabFile());
      }
    }
 else {
      subj=SecureClientLogin.login(getConfigHolder().getUserName());
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + getConfigHolder().getDatasourceName() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void initHBase(){
  try {
    if (UserGroupInformation.isSecurityEnabled()) {
      LOG.info("String_Node_Str");
      if (getConfigHolder().getKeyTabFile() == null) {
        LOG.info("String_Node_Str");
        subj=SecureClientLogin.loginUserWithPassword(getConfigHolder().getUserName(),getConfigHolder().getPassword());
      }
 else {
        LOG.info("String_Node_Str");
        subj=SecureClientLogin.loginUserFromKeytab(getConfigHolder().getUserName(),getConfigHolder().getKeyTabFile());
      }
    }
 else {
      LOG.info("String_Node_Str");
      subj=SecureClientLogin.login(getConfigHolder().getUserName());
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + getConfigHolder().getDatasourceName() + "String_Node_Str",e);
  }
}
Program: 166496
Project: 166496
Buggy source:
@Override protected void onDialogClosed(final boolean positiveResult){
  super.onDialogClosed(positiveResult);
  mSelectedValue=mNumberPicker.getValue();
  if (positiveResult) {
    if (this.callChangeListener(mSelectedValue)) {
      this.persistInt(mSelectedValue);
      this.updateSummary();
    }
  }
}

Fixed version (ground truth):
@Override protected void onDialogClosed(final boolean positiveResult){
  super.onDialogClosed(positiveResult);
  if (positiveResult) {
    final int selectedValue=mNumberPicker.getValue();
    if (this.callChangeListener(selectedValue)) {
      mSelectedValue=selectedValue;
      this.persistInt(mSelectedValue);
      this.updateSummary();
    }
  }
}
Program: 166497
Project: 166497
Buggy source:
protected RowScroller next(boolean dragCol){
  if (current < children.size() - 1) {
    RowScroller scroller0=(RowScroller)children.get(current);
    RowScroller scroller1=(RowScroller)children.get(current + 1);
    scroller0.setActive(false,false);
    scroller1.setActive(true);
    intf.selectWidget(scroller1);
    if (scroller1 == varScroller) {
      showColumnLabels();
      vbar.setX(-mira.browser.scrollSize);
      vbar.setHeight(vbar.height() - mira.browser.scrollSize);
    }
 else {
      hideColumnLabels();
      hbar.hide(false);
      vbar.setX(-mira.browser.scrollSize - padding - mira.browser.width() + mira.varWidth);
      vbar.setHeight(vbar.height() + mira.browser.scrollSize);
    }
    for (    Widget wt : children) {
      float x=wt.targetX();
      wt.targetX(x - width);
    }
    current++;
    vbar.hide(false);
    animating=true;
    return scroller1;
  }
 else {
    if (dragCol)     mira.browser.dragColumns(mira.plotWidth);
    return (RowScroller)children.get(children.size() - 1);
  }
}

Fixed version (ground truth):
protected RowScroller next(boolean dragCol){
  if (current < children.size() - 1) {
    RowScroller scroller0=(RowScroller)children.get(current);
    RowScroller scroller1=(RowScroller)children.get(current + 1);
    scroller0.setActive(false,false);
    scroller1.setActive(true);
    intf.selectWidget(scroller1);
    if (scroller1 == varScroller) {
      showColumnLabels();
      vbar.setX(-mira.browser.scrollSize);
      vbar.setHeight(vbar.height() - mira.browser.scrollSize);
    }
 else {
      hideColumnLabels();
      hbar.hide(false);
      vbar.setX(-mira.browser.scrollSize - padding - mira.browser.width() + mira.varWidth);
      vbar.setHeight(vbar.height() + mira.browser.scrollSize);
    }
    int i=scroller0.getFirstIndex();
    int idx=scroller0.items.get(i).getFirstChild();
    scroller1.setNextIndex(idx);
    for (    Widget wt : children) {
      float x=wt.targetX();
      wt.targetX(x - width);
    }
    vbar.hide(false);
    animating=true;
    current++;
    return scroller1;
  }
 else {
    if (dragCol)     mira.browser.dragColumns(mira.plotWidth);
    return (RowScroller)children.get(children.size() - 1);
  }
}
Program: 166498
Project: 166498
Buggy source:
protected RowScroller prev(boolean dragCol){
  if (dragCol && 0 < mira.browser.getFirstColumn()) {
    mira.browser.dragColumns(-mira.plotWidth);
    return (RowScroller)children.get(current);
  }
  if (0 < current) {
    RowScroller scroller0=(RowScroller)children.get(current);
    RowScroller scroller1=(RowScroller)children.get(current - 1);
    scroller0.setActive(false);
    scroller1.setActive(true,false);
    intf.selectWidget(scroller1);
    if (scroller1 == varScroller) {
      showColumnLabels();
      vbar.setX(-mira.browser.scrollSize);
      vbar.setHeight(vbar.height() - mira.browser.scrollSize);
    }
 else {
      hideColumnLabels();
      hbar.hide(false);
      vbar.setX(-mira.browser.scrollSize - padding - mira.browser.width() + mira.varWidth);
      vbar.setHeight(vbar.height() + mira.browser.scrollSize);
    }
    for (    Widget wt : children) {
      float x=wt.targetX();
      wt.targetX(x + width);
    }
    current--;
    vbar.hide(false);
    animating=true;
    return scroller1;
  }
 else {
    return (RowScroller)children.get(0);
  }
}

Fixed version (ground truth):
protected RowScroller prev(boolean dragCol){
  if (dragCol && 0 < mira.browser.getFirstColumn()) {
    mira.browser.dragColumns(-mira.plotWidth);
    return (RowScroller)children.get(current);
  }
  if (0 < current) {
    RowScroller scroller0=(RowScroller)children.get(current);
    RowScroller scroller1=(RowScroller)children.get(current - 1);
    scroller0.setActive(false);
    scroller1.setActive(true,false);
    intf.selectWidget(scroller1);
    if (scroller1 == varScroller) {
      showColumnLabels();
      vbar.setX(-mira.browser.scrollSize);
      vbar.setHeight(vbar.height() - mira.browser.scrollSize);
    }
 else {
      hideColumnLabels();
      hbar.hide(false);
      vbar.setX(-mira.browser.scrollSize - padding - mira.browser.width() + mira.varWidth);
      vbar.setHeight(vbar.height() + mira.browser.scrollSize);
    }
    for (    Widget wt : children) {
      float x=wt.targetX();
      wt.targetX(x + width);
    }
    vbar.hide(false);
    animating=true;
    updateVertScrollbar();
    current--;
    return scroller1;
  }
 else {
    return (RowScroller)children.get(0);
  }
}
Program: 166499
Project: 166499
Buggy source:
public void mouseReleased(MiraWidget wt){
  if (active) {
    if (canOpen(wt.idx)) {
      if (isOpen(wt.idx)) {
        close(wt.idx);
        wt.targetHeight(heightClose);
      }
 else {
        open(wt.idx);
        wt.targetHeight(heightOpen);
      }
      updatePositions(wt);
    }
 else {
      next(wt.idx);
      row.updateVertScrollbar();
    }
  }
}

Fixed version (ground truth):
public void mouseReleased(MiraWidget wt){
  if (active) {
    if (canOpen(wt.idx)) {
      if (isOpen(wt.idx)) {
        close(wt.idx);
        wt.targetHeight(heightClose);
      }
 else {
        open(wt.idx);
        wt.targetHeight(heightOpen);
      }
      updatePositions(wt);
    }
 else {
      next(wt.idx);
    }
  }
}
Program: 166500
Project: 166500
Buggy source:
public void keyPressed(MiraWidget wt){
  if (active) {
    if (key == CODED) {
      boolean move=false;
      if (keyCode == LEFT) {
        prev();
        move=true;
      }
 else       if (keyCode == RIGHT) {
        next();
        move=true;
      }
 else       if (keyCode == UP) {
        up();
        move=true;
      }
 else       if (keyCode == DOWN) {
        down();
        move=true;
      }
      if (move)       row.updateVertScrollbar();
    }
  }
}

Fixed version (ground truth):
public void keyPressed(MiraWidget wt){
  if (active) {
    if (key == CODED) {
      if (keyCode == LEFT) {
        prev();
      }
 else       if (keyCode == RIGHT) {
        next();
      }
 else       if (keyCode == UP) {
        up();
        row.updateVertScrollbar();
      }
 else       if (keyCode == DOWN) {
        down();
        row.updateVertScrollbar();
      }
    }
  }
}