nus-yam/ex-repair huggingface dataset:
Program: 93931
Project: 93931
Buggy source:
@Override public void filterMatches(BundleRevision requirer,Collection<Capability> candidates){
  if (isMember(requirer.getBundle())) {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      Bundle providerBundle=c.getProviderRevision().getBundle();
      if (!isMember(providerBundle)) {
        String namespace=c.getNamespace();
        if (Capability.BUNDLE_CAPABILITY.equals(namespace)) {
          i.remove();
        }
        if (Capability.PACKAGE_CAPABILITY.equals(namespace)) {
          if (!imported((String)c.getAttributes().get(Capability.PACKAGE_CAPABILITY),c.getAttributes(),c.getDirectives())) {
            i.remove();
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void filterMatches(BundleRevision requirer,Collection<Capability> candidates){
  if (isMember(requirer.getBundle())) {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      Bundle providerBundle=c.getProviderRevision().getBundle();
      if (!isMember(providerBundle)) {
        String namespace=c.getNamespace();
        if (Capability.BUNDLE_CAPABILITY.equals(namespace)) {
          i.remove();
        }
        if (Capability.PACKAGE_CAPABILITY.equals(namespace)) {
          if (!imported((String)c.getAttributes().get(Capability.PACKAGE_CAPABILITY),c.getAttributes(),c.getDirectives())) {
            i.remove();
          }
        }
      }
    }
  }
 else {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      Bundle providerBundle=c.getProviderRevision().getBundle();
      if (!isMember(providerBundle)) {
        i.remove();
      }
    }
  }
}
Program: 93933
Project: 93933
Buggy source:
private BundleDescription createBundleDescription(ArtifactDescriptor artifact,State state) throws BundleException {
  Dictionary<String,String> manifest=BundleBridge.convertToDictionary(artifact);
  try {
    URI uri=artifact.getUri();
    if ("String_Node_Str".equals(uri.getScheme())) {
      return this.stateObjectFactory.createBundleDescription(state,manifest,new File(uri).getAbsolutePath(),this.bundleId.getAndIncrement());
    }
 else {
      return this.stateObjectFactory.createBundleDescription(state,manifest,uri.toString(),this.bundleId.getAndIncrement());
    }
  }
 catch (  RuntimeException e) {
    throw new BundleException("String_Node_Str" + artifact.getUri() + "String_Node_Str",e);
  }
catch (  BundleException be) {
    throw new BundleException("String_Node_Str" + artifact.getUri() + "String_Node_Str",be);
  }
}

Fixed version (ground truth):
private BundleDescription createBundleDescription(ArtifactDescriptor artifact,State state) throws BundleException {
  Dictionary<String,String> manifest=BundleBridge.convertToDictionary(artifact);
  try {
    URI uri=artifact.getUri();
    String installLocation="String_Node_Str".equals(uri.getScheme()) ? new File(uri).getAbsolutePath() : uri.toString();
    return this.stateObjectFactory.createBundleDescription(state,manifest,USER_REGION_TAG + installLocation,this.bundleId.getAndIncrement());
  }
 catch (  RuntimeException e) {
    throw new BundleException("String_Node_Str" + artifact.getUri() + "String_Node_Str",e);
  }
catch (  BundleException be) {
    throw new BundleException("String_Node_Str" + artifact.getUri() + "String_Node_Str",be);
  }
}
Program: 93934
Project: 93934
Buggy source:
private StandardQuasiBundle doInstall(URI location,BundleManifest bundleManifest) throws BundleException {
  try {
    Dictionary<String,String> manifest=bundleManifest.toDictionary();
    String installLocation="String_Node_Str".equals(location.getScheme()) ? new File(location).getAbsolutePath() : location.toString();
    BundleDescription bundleDescription=this.stateObjectFactory.createBundleDescription(this.state,manifest,installLocation,nextBundleId());
    this.state.addBundle(bundleDescription);
    return new StandardQuasiBundle(bundleDescription,bundleManifest,this.stateHelper);
  }
 catch (  RuntimeException e) {
    throw new BundleException("String_Node_Str" + location + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private StandardQuasiBundle doInstall(URI location,BundleManifest bundleManifest) throws BundleException {
  try {
    Dictionary<String,String> manifest=bundleManifest.toDictionary();
    String installLocation="String_Node_Str".equals(location.getScheme()) ? new File(location).getAbsolutePath() : location.toString();
    BundleDescription bundleDescription=this.stateObjectFactory.createBundleDescription(this.state,manifest,USER_REGION_TAG + installLocation,nextBundleId());
    this.state.addBundle(bundleDescription);
    return new StandardQuasiBundle(bundleDescription,bundleManifest,this.stateHelper);
  }
 catch (  RuntimeException e) {
    throw new BundleException("String_Node_Str" + location + "String_Node_Str",e);
  }
}
Program: 93935
Project: 93935
Buggy source:
private void createAndPublishUserRegion() throws BundleException {
  registerRegionService(new ImmutableRegion(REGION_KERNEL,this.bundleContext));
  String userRegionImportsProperty=this.regionImports != null ? this.regionImports : this.bundleContext.getProperty(USER_REGION_PACKAGE_IMPORTS_PROPERTY);
  String expandedUserRegionImportsProperty=null;
  if (userRegionImportsProperty != null) {
    expandedUserRegionImportsProperty=PackageImportWildcardExpander.expandPackageImportsWildcards(userRegionImportsProperty,this.bundleContext);
  }
  RegionMembership regionMembership=new RegionMembership(){
    @Override public boolean contains(    Bundle bundle){
      long bundleId=bundle.getBundleId();
      return bundleId > bundleContext.getBundle().getBundleId() || bundleId == 0L;
    }
  }
;
  registerResolverHookFactory(new RegionResolverHookFactory(regionMembership,expandedUserRegionImportsProperty));
  registerBundleEventHook(new RegionBundleEventHook(regionMembership));
  registerBundleFindHook(new RegionBundleFindHook(regionMembership));
  BundleContext userRegionBundleContext=initialiseUserRegionBundles();
  registerRegionService(new ImmutableRegion(REGION_USER,userRegionBundleContext));
  publishUserRegionBundleContext(userRegionBundleContext);
}

Fixed version (ground truth):
private void createAndPublishUserRegion() throws BundleException {
  registerRegionService(new ImmutableRegion(REGION_KERNEL,this.bundleContext));
  String userRegionImportsProperty=this.regionImports != null ? this.regionImports : this.bundleContext.getProperty(USER_REGION_PACKAGE_IMPORTS_PROPERTY);
  String expandedUserRegionImportsProperty=null;
  if (userRegionImportsProperty != null) {
    expandedUserRegionImportsProperty=PackageImportWildcardExpander.expandPackageImportsWildcards(userRegionImportsProperty,this.bundleContext);
  }
  RegionMembership regionMembership=new RegionMembership(){
    @Override public boolean contains(    Bundle bundle){
      long bundleId=bundle.getBundleId();
      return contains(bundleId);
    }
    @Override public boolean contains(    Long bundleId){
      return bundleId > bundleContext.getBundle().getBundleId() || bundleId == 0L;
    }
  }
;
  registerResolverHookFactory(new RegionResolverHookFactory(regionMembership,expandedUserRegionImportsProperty));
  registerBundleEventHook(new RegionBundleEventHook(regionMembership));
  registerBundleFindHook(new RegionBundleFindHook(regionMembership));
  BundleContext userRegionBundleContext=initialiseUserRegionBundles();
  registerRegionService(new ImmutableRegion(REGION_USER,userRegionBundleContext));
  publishUserRegionBundleContext(userRegionBundleContext);
}
Program: 93936
Project: 93936
Buggy source:
@Override public boolean contains(Bundle bundle){
  long bundleId=bundle.getBundleId();
  return bundleId > bundleContext.getBundle().getBundleId() || bundleId == 0L;
}

Fixed version (ground truth):
@Override public boolean contains(Long bundleId){
  return bundleId > bundleContext.getBundle().getBundleId() || bundleId == 0L;
}
Program: 93937
Project: 93937
Buggy source:
/** 
 * Determines whether or not the specified bundle belongs to the region represented by this   {@link RegionMembership}.
 * @param bundle the {@link Bundle} to be checked for membership
 * @return <code>true</code> if and only if the specified bundle belongs to the region
 */
boolean contains(Bundle bundle);

Fixed version (ground truth):
/** 
 * Determines whether or not the bundle with the specified bundle id belongs to the region represented by this  {@link RegionMembership}.
 * @param bundleId the id of the {@link Bundle} to be checked for membership
 * @return <code>true</code> if and only if the specified bundle belongs to the region
 */
boolean contains(Long bundleId);
Program: 93938
Project: 93938
Buggy source:
@Override public void filterResolvable(Collection<BundleRevision> candidates){
  Iterator<BundleRevision> i=candidates.iterator();
  while (i.hasNext()) {
    if (!isMember(i.next().getBundle())) {
      i.remove();
    }
  }
}

Fixed version (ground truth):
@Override public void filterResolvable(Collection<BundleRevision> candidates){
  if (!this.triggerInRegion) {
    Iterator<BundleRevision> i=candidates.iterator();
    while (i.hasNext()) {
      if (isMember(i.next())) {
        i.remove();
      }
    }
  }
}
Program: 93939
Project: 93939
Buggy source:
private boolean isMember(Bundle bundle){
  return this.regionMembership.contains(bundle);
}

Fixed version (ground truth):
private boolean isMember(BundleRevision bundleRevision){
  Bundle bundle=bundleRevision.getBundle();
  if (bundle != null) {
    return this.regionMembership.contains(bundle);
  }
  if (bundleRevision instanceof ResolverBundle) {
    ResolverBundle resolverBundle=(ResolverBundle)bundleRevision;
    return this.regionMembership.contains(resolverBundle.getBundleDescription().getBundleId());
  }
  Assert.isTrue(false,"String_Node_Str",bundleRevision);
  return true;
}
Program: 93940
Project: 93940
Buggy source:
@Override public void filterMatches(BundleRevision requirer,Collection<Capability> candidates){
  if (isMember(requirer.getBundle())) {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      Bundle providerBundle=c.getProviderRevision().getBundle();
      if (!isMember(providerBundle)) {
        String namespace=c.getNamespace();
        if (Capability.BUNDLE_CAPABILITY.equals(namespace)) {
          i.remove();
        }
        if (Capability.PACKAGE_CAPABILITY.equals(namespace)) {
          if (!imported((String)c.getAttributes().get(Capability.PACKAGE_CAPABILITY),c.getAttributes(),c.getDirectives())) {
            i.remove();
          }
        }
      }
    }
  }
 else {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      Bundle providerBundle=c.getProviderRevision().getBundle();
      if (!isMember(providerBundle)) {
        i.remove();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void filterMatches(BundleRevision requirer,Collection<Capability> candidates){
  if (isMember(requirer)) {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      if (!isMember(c.getProviderRevision())) {
        String namespace=c.getNamespace();
        if (Capability.BUNDLE_CAPABILITY.equals(namespace)) {
          i.remove();
        }
        if (Capability.PACKAGE_CAPABILITY.equals(namespace)) {
          if (!imported((String)c.getAttributes().get(Capability.PACKAGE_CAPABILITY),c.getAttributes(),c.getDirectives())) {
            i.remove();
          }
        }
      }
    }
  }
 else {
    Iterator<Capability> i=candidates.iterator();
    while (i.hasNext()) {
      Capability c=i.next();
      if (!isMember(c.getProviderRevision())) {
        i.remove();
      }
    }
  }
}
Program: 93941
Project: 93941
Buggy source:
RegionResolverHook(RegionMembership regionMembership,List<ImportedPackage> importedPackages){
  this.regionMembership=regionMembership;
  this.importedPackages=importedPackages;
}

Fixed version (ground truth):
RegionResolverHook(RegionMembership regionMembership,List<ImportedPackage> importedPackages,Collection<BundleRevision> triggers){
  this.regionMembership=regionMembership;
  this.importedPackages=importedPackages;
  this.triggerInRegion=triggerInRegion(triggers);
}
Program: 93942
Project: 93942
Buggy source:
@Override public ResolverHook begin(Collection<BundleRevision> triggers){
  boolean triggerInRegion=triggerInRegion(triggers);
  return triggerInRegion ? new RegionResolverHook(this.regionMembership,this.importedPackages) : null;
}

Fixed version (ground truth):
@Override public ResolverHook begin(Collection<BundleRevision> triggers){
  return new RegionResolverHook(this.regionMembership,this.importedPackages,triggers);
}
Program: 93943
Project: 93943
Buggy source:
private Set<Long> installQuasiBundles() throws BundleException {
  Set<Long> installed=new HashSet<Long>();
  for (  StandardQuasiBundle quasiBundle : this.installedQuasiBundles) {
    BundleDescription description=quasiBundle.getBundleDescription();
    String location=description.getLocation();
    ManifestTransformer manifestTransformer=new QuasiManifestTransformer(quasiBundle.getBundleManifest());
    this.bundleTransformationHandler.pushManifestTransformer(manifestTransformer);
    try {
      URI locationUri=new File(location).toURI();
      Bundle bundle=doInstallBundleInternal(locationUri.toString());
      quasiBundle.setBundle(bundle);
      installed.add(description.getBundleId());
    }
  finally {
      this.bundleTransformationHandler.popManifestTransformer();
    }
  }
  return installed;
}

Fixed version (ground truth):
private Set<Long> installQuasiBundles() throws BundleException {
  Set<Long> installed=new HashSet<Long>();
  for (  StandardQuasiBundle quasiBundle : this.installedQuasiBundles) {
    BundleDescription description=quasiBundle.getBundleDescription();
    String location=description.getLocation();
    ManifestTransformer manifestTransformer=new QuasiManifestTransformer(quasiBundle.getBundleManifest());
    this.bundleTransformationHandler.pushManifestTransformer(manifestTransformer);
    try {
      URI locationUri=new File(stripRegionTag(location)).toURI();
      Bundle bundle=doInstallBundleInternal(locationUri.toString());
      quasiBundle.setBundle(bundle);
      installed.add(description.getBundleId());
    }
  finally {
      this.bundleTransformationHandler.popManifestTransformer();
    }
  }
  return installed;
}
Program: 93944
Project: 93944
Buggy source:
private Bundle installBundleDescription(BundleDescription description) throws BundleException {
  String location=description.getLocation();
  String installLocation=location.startsWith("String_Node_Str") ? location : new File(location).toURI().toString();
  return doInstallBundleInternal(installLocation);
}

Fixed version (ground truth):
private Bundle installBundleDescription(BundleDescription description) throws BundleException {
  String location=stripRegionTag(description.getLocation());
  String installLocation=location.startsWith("String_Node_Str") ? location : new File(location).toURI().toString();
  return doInstallBundleInternal(installLocation);
}
Program: 93945
Project: 93945
Buggy source:
StandardQuasiFramework(BundleContext bundleContext,State state,PlatformAdmin platformAdmin,ResolutionFailureDetective detective,Repository repository,TransformedManifestProvidingBundleFileWrapper bundleTransformationHandler){
  this.bundleContext=bundleContext;
  this.state=state;
  this.stateObjectFactory=platformAdmin.getFactory();
  this.detective=detective;
  this.dependencyCalculator=new DependencyCalculator(platformAdmin.getFactory(),this.detective,repository,this.bundleContext);
  this.stateHelper=platformAdmin.getStateHelper();
  this.bundleTransformationHandler=bundleTransformationHandler;
}

Fixed version (ground truth):
StandardQuasiFramework(BundleContext bundleContext,State state,PlatformAdmin platformAdmin,ResolutionFailureDetective detective,Repository repository,TransformedManifestProvidingBundleFileWrapper bundleTransformationHandler){
  this.bundleContext=bundleContext;
  this.state=state;
  this.stateObjectFactory=platformAdmin.getFactory();
  this.detective=detective;
  this.dependencyCalculator=new DependencyCalculator(platformAdmin.getFactory(),this.detective,repository,this.bundleContext);
  this.stateHelper=platformAdmin.getStateHelper();
  this.bundleTransformationHandler=bundleTransformationHandler;
  setResolverHookFactory();
}
Program: 93946
Project: 93946
Buggy source:
private TracingService getTracingService(){
  TracingService localTracingService=this.tracingService;
  if (localTracingService != null && NO_OP_TRACING_SERVICE.equals(localTracingService)) {
    return localTracingService;
  }
  ServiceReference serviceReference=this.bundleContext.getServiceReference(TracingService.class.getName());
  if (serviceReference != null) {
    localTracingService=(TracingService)this.bundleContext.getService(serviceReference);
  }
  if (localTracingService == null) {
    localTracingService=NO_OP_TRACING_SERVICE;
  }
  this.tracingService=localTracingService;
  return localTracingService;
}

Fixed version (ground truth):
private TracingService getTracingService(){
  TracingService localTracingService=this.tracingService;
  if (localTracingService != null && NO_OP_TRACING_SERVICE.equals(localTracingService)) {
    return localTracingService;
  }
  ServiceReference<TracingService> serviceReference=this.bundleContext.getServiceReference(TracingService.class);
  if (serviceReference != null) {
    localTracingService=(TracingService)this.bundleContext.getService(serviceReference);
  }
  if (localTracingService == null) {
    localTracingService=NO_OP_TRACING_SERVICE;
  }
  this.tracingService=localTracingService;
  return localTracingService;
}
Program: 93947
Project: 93947
Buggy source:
public KernelConfiguration start(BundleContext context,EventLogger eventLogger) throws IOException {
  ServiceReference configurationAdminReference=context.getServiceReference(ConfigurationAdmin.class.getName());
  ConfigurationAdmin configAdmin=null;
  if (configurationAdminReference != null) {
    configAdmin=(ConfigurationAdmin)context.getService(configurationAdminReference);
  }
  if (configAdmin == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  KernelConfiguration configuration=new KernelConfiguration(context);
  publishConfiguration(context,eventLogger,configuration,configAdmin);
  this.configAdminExporter=initializeConfigAdminExporter(context,configuration,configAdmin);
  initializeDumpContributor(context,configAdmin);
  return configuration;
}

Fixed version (ground truth):
public KernelConfiguration start(BundleContext context,EventLogger eventLogger) throws IOException {
  ServiceReference<ConfigurationAdmin> configurationAdminReference=context.getServiceReference(ConfigurationAdmin.class);
  ConfigurationAdmin configAdmin=null;
  if (configurationAdminReference != null) {
    configAdmin=(ConfigurationAdmin)context.getService(configurationAdminReference);
  }
  if (configAdmin == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  KernelConfiguration configuration=new KernelConfiguration(context);
  publishConfiguration(context,eventLogger,configuration,configAdmin);
  this.configAdminExporter=initializeConfigAdminExporter(context,configuration,configAdmin);
  initializeDumpContributor(context,configAdmin);
  return configuration;
}
Program: 93949
Project: 93949
Buggy source:
/** 
 * Simple getter used when this class is created as a bean and placed in the service registry.
 * @return String or String[] of the types this converter can convert
 */
public static String[] getTypes(){
  return TYPES;
}

Fixed version (ground truth):
/** 
 * Simple getter used when this class is created as a bean and placed in the service registry.
 * @return String or String[] of the types this converter can convert
 */
public static String[] getTypes(){
  return TYPES.clone();
}
Program: 93950
Project: 93950
Buggy source:
public static void sync(String player){
  try {
    if (!Config.database_keepalive) {
      Util.databaseManager.connect();
    }
    EBean eBeanClass=checkPlayer(player,true);
    String registered=eBeanClass.getRegistered();
    if (!Util.checkOtherName(player).equals(player)) {
      eBeanClass.setRegistered("String_Node_Str");
      save(eBeanClass);
      registered="String_Node_Str";
    }
 else     if (Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null)) {
      eBeanClass.setRegistered("String_Node_Str");
      save(eBeanClass);
      registered="String_Node_Str";
    }
 else {
      if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
        Util.logging.Debug("String_Node_Str" + player + "String_Node_Str");
        eBeanClass.setRegistered("String_Node_Str");
        save(eBeanClass);
        registered="String_Node_Str";
      }
    }
    if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
    }
    if (!Config.database_keepalive) {
      Util.databaseManager.close();
    }
  }
 catch (  SQLException e) {
  }
}

Fixed version (ground truth):
public static void sync(String player){
  SyncThread s=new SyncThread(player);
  s.start();
}
Program: 93954
Project: 93954
Buggy source:
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p,false);
  }
  Util.logging.Info(pluginVersion + "String_Node_Str");
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_GUI_ScreenIDs.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_JoinTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  Util.databaseManager.close();
}

Fixed version (ground truth):
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
      Processes.Logout(p,false);
    }
 else     if (isRegistered("String_Node_Str",p.getName()) && AuthDB_loggedOut.containsKey(p.getName()) && stop) {
      Util.craftFirePlayer.setInventoryFromStorage(p);
    }
 else {
      Processes.Logout(p,false);
    }
  }
  Util.logging.Info(pluginVersion + "String_Node_Str");
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_GUI_ScreenIDs.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_JoinTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  AuthDB_loggedOut.clear();
  Util.databaseManager.close();
}
Program: 93958
Project: 93958
Buggy source:
public static void sync(String player){
  try {
    Util.logging.Debug("String_Node_Str" + player);
    if (!Config.database_keepalive) {
      Util.databaseManager.connect();
    }
    EBean eBeanClass=EBean.checkPlayer(player,true);
    String registered=eBeanClass.getRegistered();
    if (!Util.checkOtherName(player).equals(player)) {
      eBeanClass.setRegistered("String_Node_Str");
      eBeanClass.save(eBeanClass);
      registered="String_Node_Str";
    }
 else     if (Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null)) {
      eBeanClass.setRegistered("String_Node_Str");
      eBeanClass.save(eBeanClass);
      registered="String_Node_Str";
    }
 else {
      if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
        Util.logging.Debug("String_Node_Str" + player + "String_Node_Str");
        eBeanClass.setRegistered("String_Node_Str");
        eBeanClass.save(eBeanClass);
        registered="String_Node_Str";
      }
    }
    if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
    }
    if (!Config.database_keepalive) {
      Util.databaseManager.close();
    }
  }
 catch (  SQLException e) {
  }
}

Fixed version (ground truth):
public static void sync(String player){
  try {
    Util.logging.Debug("String_Node_Str" + player);
    if (!Config.database_keepalive) {
      Util.databaseManager.connect();
    }
    EBean eBeanClass=EBean.checkPlayer(player,true);
    String registered=eBeanClass.getRegistered();
    if (!Util.checkOtherName(player).equals(player)) {
      eBeanClass.setRegistered("String_Node_Str");
      AuthDB.database.save(eBeanClass);
      registered="String_Node_Str";
    }
 else     if (Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null)) {
      eBeanClass.setRegistered("String_Node_Str");
      AuthDB.database.save(eBeanClass);
      registered="String_Node_Str";
    }
 else {
      if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
        Util.logging.Debug("String_Node_Str" + player + "String_Node_Str");
        eBeanClass.setRegistered("String_Node_Str");
        AuthDB.database.save(eBeanClass);
        registered="String_Node_Str";
      }
    }
    if (registered != null && registered.equalsIgnoreCase("String_Node_Str")) {
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
      Util.checkScript("String_Node_Str",Config.script_name,Util.checkOtherName(player),null,null,null);
    }
    if (!Config.database_keepalive) {
      Util.databaseManager.close();
    }
  }
 catch (  SQLException e) {
  }
}
Program: 93959
Project: 93959
Buggy source:
public static String SHA512(String text){
  StringBuffer sb=new StringBuffer();
  try {
    MessageDigest messageDigest=MessageDigest.getInstance("String_Node_Str");
    messageDigest.update(text.getBytes("String_Node_Str"));
    byte[] digestBytes=messageDigest.digest();
    String hex=null;
    for (int i=0; i < digestBytes.length; i++) {
      hex=Integer.toHexString(0xFF & digestBytes[i]);
      if (hex.length() < 2) {
        sb.append("String_Node_Str");
      }
      sb.append(hex);
    }
  }
 catch (  Exception ex) {
    System.out.println(ex.getMessage());
  }
  return new String(sb);
}

Fixed version (ground truth):
public static String SHA512(String text){
  byte[] sha1hash=new byte[40];
  try {
    MessageDigest md=MessageDigest.getInstance("String_Node_Str");
    md.update(text.getBytes("String_Node_Str"),0,text.length());
    sha1hash=md.digest();
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  return convertToHex(sha1hash);
}
Program: 93960
Project: 93960
Buggy source:
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  EBean.sync(player);
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug("String_Node_Str");
    }
    if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
      Messages.sendMessage(Message.filter_username,player,event);
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}

Fixed version (ground truth):
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  EBean.sync(player);
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug(name + "String_Node_Str");
      if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
        Messages.sendMessage(Message.filter_username,player,event);
      }
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}
Program: 93961
Project: 93961
Buggy source:
public static boolean checkFilter(String what,String string){
  if (what.equalsIgnoreCase("String_Node_Str")) {
    logging.Debug("String_Node_Str" + Config.filter_username);
    int lengtha=string.length();
    int lengthb=Config.filter_username.length();
    int i=0;
    char thechar1, thechar2;
    while (i < lengtha) {
      thechar1=string.charAt(i);
      int a=0;
      while (a < lengthb) {
        thechar2=Config.filter_username.charAt(a);
        if (thechar1 == thechar2 || thechar1 == '\'' || thechar1 == '\"') {
          logging.Debug("String_Node_Str" + thechar2);
          Config.has_badcharacters=true;
          return false;
        }
        a++;
      }
      i++;
    }
    Config.has_badcharacters=false;
    return true;
  }
 else   if (what.equalsIgnoreCase("String_Node_Str")) {
    logging.Debug("String_Node_Str" + Config.filter_password);
    int lengtha=string.length();
    int lengthb=Config.filter_password.length();
    int i=0;
    char thechar1, thechar2;
    while (i < lengtha) {
      thechar1=string.charAt(i);
      int a=0;
      while (a < lengthb) {
        thechar2=Config.filter_password.charAt(a);
        if (thechar1 == thechar2 || thechar1 == '\'' || thechar1 == '\"') {
          logging.Debug("String_Node_Str" + thechar2);
          return false;
        }
        a++;
      }
      i++;
    }
    return true;
  }
  return true;
}

Fixed version (ground truth):
public static boolean checkFilter(String what,String string){
  if (what.equalsIgnoreCase("String_Node_Str")) {
    logging.Debug("String_Node_Str" + Config.filter_username);
    int lengtha=string.length();
    int lengthb=Config.filter_username.length();
    int i=0;
    char thechar1, thechar2;
    while (i < lengtha) {
      thechar1=string.charAt(i);
      int a=0;
      while (a < lengthb) {
        thechar2=Config.filter_username.charAt(a);
        if (thechar1 == thechar2 || thechar1 == '\'' || thechar1 == '\"') {
          Util.logging.Info(string + "String_Node_Str" + thechar2);
          Config.has_badcharacters=true;
          return false;
        }
        a++;
      }
      i++;
    }
    Config.has_badcharacters=false;
    Util.logging.Debug(string + "String_Node_Str");
    return true;
  }
 else   if (what.equalsIgnoreCase("String_Node_Str")) {
    logging.Debug("String_Node_Str" + Config.filter_password);
    int lengtha=string.length();
    int lengthb=Config.filter_password.length();
    int i=0;
    char thechar1, thechar2;
    while (i < lengtha) {
      thechar1=string.charAt(i);
      int a=0;
      while (a < lengthb) {
        thechar2=Config.filter_password.charAt(a);
        if (thechar1 == thechar2 || thechar1 == '\'' || thechar1 == '\"') {
          logging.Debug("String_Node_Str" + thechar2);
          return false;
        }
        a++;
      }
      i++;
    }
    return true;
  }
  return true;
}
Program: 93964
Project: 93964
Buggy source:
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  AuthDBPlayer aPlayer=new AuthDBPlayer(event.getPlayer());
  Util.logging.Debug("String_Node_Str" + aPlayer.getEmail());
  aPlayer.setEmail("String_Node_Str" + test);
  test++;
  Util.logging.Debug("String_Node_Str" + aPlayer.getEmail());
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  EBean.sync(player);
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug(name + "String_Node_Str");
      if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
        Messages.sendMessage(Message.filter_username,player,event);
      }
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}

Fixed version (ground truth):
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  EBean.sync(player);
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug(name + "String_Node_Str");
      if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
        Messages.sendMessage(Message.filter_username,player,event);
      }
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}
Program: 93965
Project: 93965
Buggy source:
public static boolean checkIfLoggedIn(Player player){
  for (  Player p : player.getServer().getOnlinePlayers()) {
    if (p.getName().equals(player.getName()) && AuthDB.isAuthorized(p)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean checkIfLoggedIn(Player player){
  for (  Player p : player.getServer().getOnlinePlayers()) {
    if (p.getName().equalsIgnoreCase(player.getName()) && AuthDB.isAuthorized(p)) {
      return true;
    }
  }
  return false;
}
Program: 93966
Project: 93966
Buggy source:
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  EBean.sync(player);
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug(name + "String_Node_Str");
      if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
        Messages.sendMessage(Message.filter_username,player,event);
      }
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}

Fixed version (ground truth):
public void onPlayerLogin(PlayerLoginEvent event){
  Player player=event.getPlayer();
  if (!MySQL.isConnected()) {
    event.disallow(Result.KICK_OTHER,"String_Node_Str");
    return;
  }
  if (Config.session_protect && Util.checkIfLoggedIn(player)) {
    Messages.sendMessage(Message.session_protected,player,event);
    return;
  }
 else {
    EBean.sync(player);
  }
  if (Config.filter_action.equalsIgnoreCase("String_Node_Str") || Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
    String name=player.getName();
    if (Util.checkFilter("String_Node_Str",name) == false && Util.checkWhitelist("String_Node_Str",player) == false) {
      Util.logging.Debug(name + "String_Node_Str");
      if (Config.filter_action.equalsIgnoreCase("String_Node_Str")) {
        Messages.sendMessage(Message.filter_username,player,event);
        return;
      }
    }
  }
  if (player.getName().length() < Integer.parseInt(Config.username_minimum)) {
    Messages.sendMessage(Message.username_minimum,player,event);
  }
 else   if (player.getName().length() > Integer.parseInt(Config.username_maximum)) {
    Messages.sendMessage(Message.username_maximum,player,event);
  }
  if (Config.link_rename && !Util.checkOtherName(player.getName()).equals(player.getName())) {
    Util.craftFirePlayer.renamePlayer(player,Util.checkOtherName(player.getName()));
  }
}
Program: 93967
Project: 93967
Buggy source:
public static void checkIP(String player,String IP){
  EBean eBeanClass=checkPlayer(player,true);
  if (eBeanClass.getIp() == null || eBeanClass.getIp().equals(IP) == false) {
    Util.logging.Debug("String_Node_Str");
    eBeanClass.setIp(IP);
    AuthDB.database.save(eBeanClass);
  }
}

Fixed version (ground truth):
public static void checkIP(String player,String IP){
  EBean eBeanClass=checkPlayer(player,true);
  if (eBeanClass.getIp() == null || eBeanClass.getIp().equals(IP) == false) {
    Util.logging.Debug("String_Node_Str");
    eBeanClass.setSessiontime(0);
    eBeanClass.setIp(IP);
    AuthDB.database.save(eBeanClass);
  }
}
Program: 93972
Project: 93972
Buggy source:
public String commandString(String command){
  if (command.contains("String_Node_Str")) {
    String[] temp=command.split("String_Node_Str");
    if (temp.length > 0) {
      command=temp[0].replaceAll("String_Node_Str","String_Node_Str");
    }
  }
 else {
    command=command.replaceAll("String_Node_Str","String_Node_Str");
  }
  return command;
}

Fixed version (ground truth):
public String commandString(String command,boolean check){
  command=command.replaceAll("String_Node_Str","String_Node_Str");
  return command;
}
Program: 93978
Project: 93978
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        if (Config.protection_freeze) {
          long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
          Location temp=event.getFrom();
          temp.setY(temp.getY() - 1);
          if (jointime + Config.protection_freeze_delay < Util.timeStamp() && temp.getBlock().getTypeId() != 0) {
            this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
          }
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    Location test=new Location(event.getPlayer().getWorld(),event.getFrom().getX(),event.getFrom().getY() - 1,event.getFrom().getZ());
    if (test.getBlock().getTypeId() != 0 && !checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        if (Config.protection_freeze) {
          long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
          if (jointime + Config.protection_freeze_delay < Util.timeStamp()) {
            this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
          }
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}
Program: 93980
Project: 93980
Buggy source:
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        if (Config.protection_freeze) {
          long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
          if (jointime + Config.protection_freeze_delay < Util.timeStamp()) {
            this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
          }
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}

Fixed version (ground truth):
public void onPlayerMove(PlayerMoveEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!plugin.isAuthorized(event.getPlayer())) {
    if (!checkGuest(event.getPlayer(),Config.guests_movement)) {
      if (this.plugin.AuthDB_JoinTime.containsKey(event.getPlayer().getName())) {
        if (Config.protection_freeze) {
          long jointime=this.plugin.AuthDB_JoinTime.get(event.getPlayer().getName());
          Location temp=event.getFrom();
          temp.setY(temp.getY() - 1);
          if (jointime + Config.protection_freeze_delay < Util.timeStamp() && temp.getBlock().getTypeId() != 0) {
            this.plugin.AuthDB_JoinTime.remove(event.getPlayer().getName());
          }
        }
      }
 else {
        event.getPlayer().teleport(event.getFrom());
      }
    }
  }
}
Program: 93986
Project: 93986
Buggy source:
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  Util.databaseManager.close();
}

Fixed version (ground truth):
public void onDisable(){
  for (  Player p : getServer().getOnlinePlayers()) {
    EBean eBeanClass=EBean.checkPlayer(p,true);
    if (eBeanClass.getAuthorized() != null && eBeanClass.getAuthorized().equalsIgnoreCase("String_Node_Str")) {
      eBeanClass.setReloadtime(Util.timeStamp());
      AuthDB.database.save(eBeanClass);
    }
    Processes.Logout(p);
  }
  Util.logging.Info(pluginName + "String_Node_Str" + pluginVersion+ "String_Node_Str");
  Plugin checkCraftIRC=getServer().getPluginManager().getPlugin("String_Node_Str");
  if ((checkCraftIRC != null) && (checkCraftIRC.isEnabled()) && (Config.CraftIRC_enabled == true)) {
    ZCraftIRC.sendMessage(Message.OnDisable,null);
  }
  authorizedNames.clear();
  AuthDB_AuthTime.clear();
  AuthDB_RemindLogin.clear();
  AuthDB_SpamMessage.clear();
  AuthDB_SpamMessageTime.clear();
  AuthDB_GUI_PasswordFieldIDs.clear();
  AuthDB_GUI_ErrorFieldIDs.clear();
  AuthDB_JoinTime.clear();
  AuthDB_LinkedNames.clear();
  AuthDB_LinkedNameCheck.clear();
  AuthDB_PasswordTries.clear();
  AuthDB_GUI_TempPasswords.clear();
  AuthDB_Timeouts.clear();
  AuthDB_Sessions.clear();
  AuthDB_Authed.clear();
  Util.databaseManager.close();
}