nus-yam/ex-repair huggingface dataset:
Program: 37588
Project: 37588
Buggy source:
@Test public void canUpdateVirtualNetworkDeployment() throws Exception {
  final String dp="String_Node_Str" + testId;
  resourceClient.deployments().define(dp).withExistingResourceGroup(rgName).withTemplateLink(templateUri,contentVersion).withParametersLink(parametersUri,contentVersion).withMode(DeploymentMode.COMPLETE).beginCreate();
  Deployment deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals(dp,deployment.name());
  deployment.cancel();
  deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals("String_Node_Str",deployment.provisioningState());
  deployment.update().withTemplate(updateTemplate).withParameters(updateParameters).withMode(DeploymentMode.INCREMENTAL).apply();
  deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals(DeploymentMode.INCREMENTAL,deployment.mode());
  Assert.assertEquals("String_Node_Str",deployment.provisioningState());
  GenericResource genericVnet=resourceClient.genericResources().get(rgName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertNotNull(genericVnet);
  resourceClient.genericResources().delete(rgName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void canUpdateVirtualNetworkDeployment() throws Exception {
  final String dp="String_Node_Str" + testId;
  Deployment createdDeployment=resourceClient.deployments().define(dp).withExistingResourceGroup(rgName).withTemplateLink(templateUri,contentVersion).withParametersLink(parametersUri,contentVersion).withMode(DeploymentMode.COMPLETE).beginCreate();
  Deployment deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals(createdDeployment.correlationId(),deployment.correlationId());
  Assert.assertEquals(dp,deployment.name());
  deployment.cancel();
  deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals("String_Node_Str",deployment.provisioningState());
  deployment.update().withTemplate(updateTemplate).withParameters(updateParameters).withMode(DeploymentMode.INCREMENTAL).apply();
  deployment=resourceClient.deployments().getByResourceGroup(rgName,dp);
  Assert.assertEquals(DeploymentMode.INCREMENTAL,deployment.mode());
  Assert.assertEquals("String_Node_Str",deployment.provisioningState());
  GenericResource genericVnet=resourceClient.genericResources().get(rgName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertNotNull(genericVnet);
  resourceClient.genericResources().delete(rgName,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 37589
Project: 37589
Buggy source:
private void addLocationsForCreateUpdateParameters(DatabaseAccountCreateUpdateParametersInner createUpdateParametersInner,List<FailoverPolicyInner> failoverPolicies){
  List<Location> locations=new ArrayList<Location>();
  for (int i=0; i < failoverPolicies.size(); i++) {
    FailoverPolicyInner policyInner=failoverPolicies.get(i);
    Location location=new Location();
    location.withFailoverPriority(i);
    location.withLocationName(policyInner.locationName());
    locations.add(location);
  }
  if (locations.size() > 0) {
    createUpdateParametersInner.withLocations(locations);
  }
}

Fixed version (ground truth):
private void addLocationsForCreateUpdateParameters(DatabaseAccountCreateUpdateParametersInner createUpdateParametersInner,List<FailoverPolicyInner> failoverPolicies){
  List<Location> locations=new ArrayList<Location>();
  if (failoverPolicies.size() > 0) {
    for (int i=0; i < failoverPolicies.size(); i++) {
      FailoverPolicyInner policyInner=failoverPolicies.get(i);
      Location location=new Location();
      location.withFailoverPriority(i);
      location.withLocationName(policyInner.locationName());
      locations.add(location);
    }
  }
 else {
    Location location=new Location();
    location.withFailoverPriority(0);
    location.withLocationName(createUpdateParametersInner.location());
    locations.add(location);
  }
  createUpdateParametersInner.withLocations(locations);
}
Program: 37590
Project: 37590
Buggy source:
@Override public ActionGroupImpl withAzureFunction(String functionAppResourceId,String functionName,String httpTriggerUrl){
  String compositeKey=this.actionReceiverPrefix + functionSuffix;
  if (this.functionReceivers.containsKey(compositeKey)) {
    this.functionReceivers.remove(compositeKey);
  }
  AzureFunctionReceiver afr=new AzureFunctionReceiver();
  afr.withName(compositeKey);
  afr.withFunctionAppResourceId(functionAppResourceId);
  afr.withFunctionName(functionName);
  afr.withHttpTriggerUrl(httpTriggerUrl);
  this.functionReceivers.put(compositeKey,afr);
  return this;
}

Fixed version (ground truth):
@Override public ActionGroupImpl withAzureFunction(String functionAppResourceId,String functionName,String httpTriggerUrl){
  this.withoutAzureFunction();
  String compositeKey=this.actionReceiverPrefix + functionSuffix;
  AzureFunctionReceiver afr=new AzureFunctionReceiver();
  afr.withName(compositeKey);
  afr.withFunctionAppResourceId(functionAppResourceId);
  afr.withFunctionName(functionName);
  afr.withHttpTriggerUrl(httpTriggerUrl);
  this.functionReceivers.put(compositeKey,afr);
  return this;
}
Program: 37591
Project: 37591
Buggy source:
/** 
 * Sets the short name of the action group. This will be used in SMS messages. Maximum length cannot exceed 15 symbols.
 * @param shortName short name of the action group. Cannot exceed 15 symbols
 * @return the next stage of the update
 */
Update withShortName(String shortName);

Fixed version (ground truth):
/** 
 * Sets the short name of the action group. This will be used in SMS messages. Maximum length cannot exceed 12 symbols.
 * @param shortName short name of the action group. Cannot exceed 12 symbols
 * @return the next stage of the update
 */
Update withShortName(String shortName);
Program: 37592
Project: 37592
Buggy source:
@Override public SqlDatabase call(DatabaseInner inner){
  return new SqlDatabaseImpl(resourceGroupName,sqlServerName,inner.location(),inner.name(),inner,manager);
}

Fixed version (ground truth):
@Override public SqlDatabase call(DatabaseInner inner){
  return new SqlDatabaseImpl(inner.name(),(SqlServerImpl)sqlServer,inner,sqlServer.manager());
}
Program: 37593
Project: 37593
Buggy source:
@Override public Observable<SqlDatabase> listBySqlServerAsync(SqlServer sqlServer){
  return null;
}

Fixed version (ground truth):
@Override public Observable<SqlDatabase> listBySqlServerAsync(final SqlServer sqlServer){
  return sqlServer.manager().inner().databases().listByServerAsync(sqlServer.resourceGroupName(),sqlServer.name()).flatMap(new Func1<List<DatabaseInner>,Observable<DatabaseInner>>(){
    @Override public Observable<DatabaseInner> call(    List<DatabaseInner> databaseInners){
      return Observable.from(databaseInners);
    }
  }
).map(new Func1<DatabaseInner,SqlDatabase>(){
    @Override public SqlDatabase call(    DatabaseInner inner){
      return new SqlDatabaseImpl(inner.name(),(SqlServerImpl)sqlServer,inner,sqlServer.manager());
    }
  }
);
}
Program: 37594
Project: 37594
Buggy source:
@Override protected Observable<ServerAutomaticTuningInner> getInnerAsync(){
  return null;
}

Fixed version (ground truth):
@Override protected Observable<ServerAutomaticTuningInner> getInnerAsync(){
  return this.sqlServerManager.inner().serverAutomaticTunings().getAsync(this.resourceGroupName,this.sqlServerName);
}
Program: 37595
Project: 37595
Buggy source:
Observable<Indexable> submitAppSettings(){
  return Observable.just(configurationSource).flatMap(new Func1<WebAppBase,Observable<Indexable>>(){
    @Override public Observable<Indexable> call(    WebAppBase webAppBase){
      if (webAppBase == null || !isInCreateMode()) {
        return Observable.just((Indexable)DeploymentSlotBaseImpl.this);
      }
      return webAppBase.getAppSettingsAsync().flatMap(new Func1<Map<String,AppSetting>,Observable<Indexable>>(){
        @Override public Observable<Indexable> call(        Map<String,AppSetting> stringAppSettingMap){
          for (          AppSetting appSetting : stringAppSettingMap.values()) {
            if (appSetting.sticky()) {
              withStickyAppSetting(appSetting.key(),appSetting.value());
            }
 else {
              withAppSetting(appSetting.key(),appSetting.value());
            }
          }
          return DeploymentSlotBaseImpl.super.submitAppSettings();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
Observable<Indexable> submitAppSettings(){
  return Observable.just(configurationSource).flatMap(new Func1<WebAppBase,Observable<Indexable>>(){
    @Override public Observable<Indexable> call(    WebAppBase webAppBase){
      if (webAppBase == null || !isInCreateMode()) {
        return DeploymentSlotBaseImpl.super.submitAppSettings();
      }
      return webAppBase.getAppSettingsAsync().flatMap(new Func1<Map<String,AppSetting>,Observable<Indexable>>(){
        @Override public Observable<Indexable> call(        Map<String,AppSetting> stringAppSettingMap){
          for (          AppSetting appSetting : stringAppSettingMap.values()) {
            if (appSetting.sticky()) {
              withStickyAppSetting(appSetting.key(),appSetting.value());
            }
 else {
              withAppSetting(appSetting.key(),appSetting.value());
            }
          }
          return DeploymentSlotBaseImpl.super.submitAppSettings();
        }
      }
);
    }
  }
);
}
Program: 37596
Project: 37596
Buggy source:
Observable<Indexable> submitConnectionStrings(){
  return Observable.just(configurationSource).flatMap(new Func1<WebAppBase,Observable<Indexable>>(){
    @Override public Observable<Indexable> call(    WebAppBase webAppBase){
      if (webAppBase == null || !isInCreateMode()) {
        return Observable.just((Indexable)DeploymentSlotBaseImpl.this);
      }
      return webAppBase.getConnectionStringsAsync().flatMap(new Func1<Map<String,ConnectionString>,Observable<Indexable>>(){
        @Override public Observable<Indexable> call(        Map<String,ConnectionString> stringConnectionStringMap){
          for (          ConnectionString connectionString : stringConnectionStringMap.values()) {
            if (connectionString.sticky()) {
              withStickyConnectionString(connectionString.name(),connectionString.value(),connectionString.type());
            }
 else {
              withConnectionString(connectionString.name(),connectionString.value(),connectionString.type());
            }
          }
          return DeploymentSlotBaseImpl.super.submitConnectionStrings();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
Observable<Indexable> submitConnectionStrings(){
  return Observable.just(configurationSource).flatMap(new Func1<WebAppBase,Observable<Indexable>>(){
    @Override public Observable<Indexable> call(    WebAppBase webAppBase){
      if (webAppBase == null || !isInCreateMode()) {
        return DeploymentSlotBaseImpl.super.submitConnectionStrings();
      }
      return webAppBase.getConnectionStringsAsync().flatMap(new Func1<Map<String,ConnectionString>,Observable<Indexable>>(){
        @Override public Observable<Indexable> call(        Map<String,ConnectionString> stringConnectionStringMap){
          for (          ConnectionString connectionString : stringConnectionStringMap.values()) {
            if (connectionString.sticky()) {
              withStickyConnectionString(connectionString.name(),connectionString.value(),connectionString.type());
            }
 else {
              withConnectionString(connectionString.name(),connectionString.value(),connectionString.type());
            }
          }
          return DeploymentSlotBaseImpl.super.submitConnectionStrings();
        }
      }
);
    }
  }
);
}
Program: 37598
Project: 37598
Buggy source:
@Override public Observable<CdnEndpoint> refreshAsync(){
  final CdnEndpointImpl self=this;
  return refreshAsync().flatMap(new Func1<CdnEndpoint,Observable<CdnEndpoint>>(){
    @Override public Observable<CdnEndpoint> call(    CdnEndpoint cdnEndpoint){
      self.customDomainList.clear();
      self.deletedCustomDomainList.clear();
      return self.parent().manager().inner().customDomains().listByEndpointAsync(self.parent().resourceGroupName(),self.parent().name(),self.name()).flatMap(new Func1<Page<CustomDomainInner>,Observable<CdnEndpoint>>(){
        @Override public Observable<CdnEndpoint> call(        Page<CustomDomainInner> customDomainInnerPage){
          self.customDomainList.addAll(customDomainInnerPage.items());
          return Observable.just((CdnEndpoint)self);
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
@Override public Observable<CdnEndpoint> refreshAsync(){
  final CdnEndpointImpl self=this;
  return super.refreshAsync().flatMap(new Func1<CdnEndpoint,Observable<CdnEndpoint>>(){
    @Override public Observable<CdnEndpoint> call(    CdnEndpoint cdnEndpoint){
      self.customDomainList.clear();
      self.deletedCustomDomainList.clear();
      return self.parent().manager().inner().customDomains().listByEndpointAsync(self.parent().resourceGroupName(),self.parent().name(),self.name()).flatMap(new Func1<Page<CustomDomainInner>,Observable<CdnEndpoint>>(){
        @Override public Observable<CdnEndpoint> call(        Page<CustomDomainInner> customDomainInnerPage){
          self.customDomainList.addAll(customDomainInnerPage.items());
          return Observable.just((CdnEndpoint)self);
        }
      }
);
    }
  }
);
}
Program: 37599
Project: 37599
Buggy source:
private void handleUnManagedOSDiskContainers(){
  final VirtualMachineScaleSetStorageProfile storageProfile=inner().virtualMachineProfile().storageProfile();
  if (isManagedDiskEnabled()) {
    storageProfile.osDisk().withVhdContainers(null);
    return;
  }
  if (isOSDiskFromStoredImage(storageProfile)) {
    storageProfile.osDisk().vhdContainers().clear();
    return;
  }
  String containerName=this.vhdContainerName;
  if (containerName == null) {
    for (    String containerUrl : storageProfile.osDisk().vhdContainers()) {
      containerName=containerUrl.substring(containerUrl.lastIndexOf("String_Node_Str") + 1);
      break;
    }
  }
  if (containerName == null) {
    containerName="String_Node_Str";
  }
  if (isInCreateMode() && this.creatableStorageAccountKeys.isEmpty() && this.existingStorageAccountsToAssociate.isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  String storageAccountKey : this.creatableStorageAccountKeys) {
    StorageAccount storageAccount=this.<StorageAccount>taskResult(storageAccountKey);
    storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(),containerName));
  }
  for (  StorageAccount storageAccount : this.existingStorageAccountsToAssociate) {
    storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(),containerName));
  }
  this.vhdContainerName=null;
  this.creatableStorageAccountKeys.clear();
  this.existingStorageAccountsToAssociate.clear();
}

Fixed version (ground truth):
private void handleUnManagedOSDiskContainers(){
  final VirtualMachineScaleSetStorageProfile storageProfile=inner().virtualMachineProfile().storageProfile();
  if (isManagedDiskEnabled()) {
    storageProfile.osDisk().withVhdContainers(null);
    return;
  }
  if (isOSDiskFromStoredImage(storageProfile)) {
    storageProfile.osDisk().vhdContainers().clear();
    return;
  }
  String containerName=null;
  for (  String containerUrl : storageProfile.osDisk().vhdContainers()) {
    containerName=containerUrl.substring(containerUrl.lastIndexOf("String_Node_Str") + 1);
    break;
  }
  if (containerName == null) {
    containerName="String_Node_Str";
  }
  if (isInCreateMode() && this.creatableStorageAccountKeys.isEmpty() && this.existingStorageAccountsToAssociate.isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  String storageAccountKey : this.creatableStorageAccountKeys) {
    StorageAccount storageAccount=this.<StorageAccount>taskResult(storageAccountKey);
    storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(),containerName));
  }
  for (  StorageAccount storageAccount : this.existingStorageAccountsToAssociate) {
    storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(),containerName));
  }
  this.creatableStorageAccountKeys.clear();
  this.existingStorageAccountsToAssociate.clear();
}
Program: 37600
Project: 37600
Buggy source:
@Override protected RecordSetInner prepareForUpdate(RecordSetInner resource){
  if (this.inner().mxRecords() != null && this.inner().mxRecords().size() > 0) {
    if (resource.mxRecords() == null) {
      resource.withMxRecords(new ArrayList<MxRecord>());
    }
    resource.mxRecords().addAll(this.inner().mxRecords());
    this.inner().mxRecords().clear();
  }
  if (this.recordSetRemoveInfo.mxRecords().size() > 0) {
    if (resource.mxRecords() != null) {
      for (      MxRecord recordToRemove : this.recordSetRemoveInfo.mxRecords()) {
        for (        MxRecord record : resource.mxRecords()) {
          if (record.exchange().equalsIgnoreCase(recordToRemove.exchange()) && (record.preference() == recordToRemove.preference())) {
            resource.mxRecords().remove(record);
            break;
          }
        }
      }
    }
    this.recordSetRemoveInfo.mxRecords().clear();
  }
  return resource;
}

Fixed version (ground truth):
@Override protected RecordSetInner prepareForUpdate(RecordSetInner resource){
  if (this.inner().mxRecords() != null && this.inner().mxRecords().size() > 0) {
    if (resource.mxRecords() == null) {
      resource.withMxRecords(new ArrayList<MxRecord>());
    }
    resource.mxRecords().addAll(this.inner().mxRecords());
    this.inner().mxRecords().clear();
  }
  if (this.recordSetRemoveInfo.mxRecords().size() > 0) {
    if (resource.mxRecords() != null) {
      for (      MxRecord recordToRemove : this.recordSetRemoveInfo.mxRecords()) {
        for (        MxRecord record : resource.mxRecords()) {
          if (record.exchange().equalsIgnoreCase(recordToRemove.exchange()) && (record.preference().equals(recordToRemove.preference()))) {
            resource.mxRecords().remove(record);
            break;
          }
        }
      }
    }
    this.recordSetRemoveInfo.mxRecords().clear();
  }
  return resource;
}
Program: 37601
Project: 37601
Buggy source:
@Override public PublicIPAddressImpl withReverseFqdn(String reverseFqdn){
  this.inner().dnsSettings().withReverseFqdn(reverseFqdn.toLowerCase());
  return this;
}

Fixed version (ground truth):
@Override public PublicIPAddressImpl withReverseFqdn(String reverseFqdn){
  this.inner().dnsSettings().withReverseFqdn(reverseFqdn != null ? reverseFqdn.toLowerCase() : null);
  return this;
}
Program: 37602
Project: 37602
Buggy source:
boolean isTerminalMatched(Character charToMatch){
  return terminalChar == charToMatch;
}

Fixed version (ground truth):
boolean isTerminalMatched(Character charToMatch){
  if (terminalChar == null && charToMatch == null) {
    return true;
  }
  return terminalChar != null && charToMatch != null && terminalChar.equals(charToMatch);
}
Program: 37603
Project: 37603
Buggy source:
@Override public void beforeGroupCreateOrUpdate(){
  if (parentSqlElasticPool != null) {
    this.addParentDependency(parentSqlElasticPool);
  }
  if (this.importRequestInner != null && this.elasticPoolName() != null) {
    final SqlDatabaseImpl self=this;
    final String epName=this.elasticPoolName();
    this.addPostRunDependent(new FunctionalTaskItem(){
      @Override public Observable<Indexable> call(      final Context context){
        self.importRequestInner=null;
        self.withExistingElasticPool(epName);
        return self.createResourceAsync().flatMap(new Func1<SqlDatabase,Observable<Indexable>>(){
          @Override public Observable<Indexable> call(          SqlDatabase sqlDatabase){
            return context.voidObservable();
          }
        }
);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void beforeGroupCreateOrUpdate(){
  if (this.importRequestInner != null && this.elasticPoolName() != null) {
    final SqlDatabaseImpl self=this;
    final String epName=this.elasticPoolName();
    this.addPostRunDependent(new FunctionalTaskItem(){
      @Override public Observable<Indexable> call(      final Context context){
        self.importRequestInner=null;
        self.withExistingElasticPool(epName);
        return self.createResourceAsync().flatMap(new Func1<SqlDatabase,Observable<Indexable>>(){
          @Override public Observable<Indexable> call(          SqlDatabase sqlDatabase){
            return context.voidObservable();
          }
        }
);
      }
    }
);
  }
}
Program: 37604
Project: 37604
Buggy source:
/** 
 * Creates an instance of external child resource in-memory.
 * @param parentSqlElasticPool the parent SqlElasticPool this database belongs to
 * @param name        the name of this external child resource
 * @param innerObject reference to the inner object representing this external child resource
 * @param sqlServerManager reference to the SQL server manager that accesses firewall rule operations
 */
SqlDatabaseImpl(TaskGroup.HasTaskGroup parentSqlElasticPool,String name,DatabaseInner innerObject,SqlServerManager sqlServerManager){
  super(name,null,innerObject);
  Objects.requireNonNull(parentSqlElasticPool);
  Objects.requireNonNull(sqlServerManager);
  this.sqlServerManager=sqlServerManager;
  this.sqlElasticPools=new SqlElasticPoolsAsExternalChildResourcesImpl(this.sqlServerManager,"String_Node_Str");
  this.parentSqlElasticPool=null;
  this.isPatchUpdate=false;
  this.importRequestInner=null;
}

Fixed version (ground truth):
/** 
 * Creates an instance of external child resource in-memory.
 * @param parentSqlElasticPool the parent SqlElasticPool this database belongs to
 * @param name        the name of this external child resource
 * @param innerObject reference to the inner object representing this external child resource
 * @param sqlServerManager reference to the SQL server manager that accesses firewall rule operations
 */
SqlDatabaseImpl(TaskGroup.HasTaskGroup parentSqlElasticPool,String name,DatabaseInner innerObject,SqlServerManager sqlServerManager){
  super(name,null,innerObject);
  Objects.requireNonNull(parentSqlElasticPool);
  Objects.requireNonNull(sqlServerManager);
  this.sqlServerManager=sqlServerManager;
  this.sqlElasticPools=new SqlElasticPoolsAsExternalChildResourcesImpl(this.sqlServerManager,"String_Node_Str");
  this.isPatchUpdate=false;
  this.importRequestInner=null;
}
Program: 37606
Project: 37606
Buggy source:
@Override public final VirtualMachineExtensionImpl withoutTag(String key){
  this.inner().getTags().remove(key);
  return this;
}

Fixed version (ground truth):
@Override public final VirtualMachineExtensionImpl withoutTag(String key){
  if (this.inner().getTags() != null) {
    this.inner().getTags().remove(key);
  }
  return this;
}
Program: 37607
Project: 37607
Buggy source:
@Override public final VirtualMachineExtensionImpl withTag(String key,String value){
  this.inner().getTags().put(key,value);
  return this;
}

Fixed version (ground truth):
@Override public final VirtualMachineExtensionImpl withTag(String key,String value){
  if (this.inner().getTags() == null) {
    this.inner().withTags(new HashMap<String,String>());
  }
  this.inner().getTags().put(key,value);
  return this;
}
Program: 37608
Project: 37608
Buggy source:
/** 
 * Adds a tag to the resource.
 * @param key the key for the tag
 * @param value the value for the tag
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withTag(String key,String value){
  this.inner().getTags().put(key,value);
  return (FluentModelImplT)this;
}

Fixed version (ground truth):
/** 
 * Adds a tag to the resource.
 * @param key the key for the tag
 * @param value the value for the tag
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withTag(String key,String value){
  if (this.inner().getTags() == null) {
    this.inner().withTags(new HashMap<String,String>());
  }
  this.inner().getTags().put(key,value);
  return (FluentModelImplT)this;
}
Program: 37609
Project: 37609
Buggy source:
/** 
 * Removes a tag from the resource.
 * @param key the key of the tag to remove
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withoutTag(String key){
  this.inner().getTags().remove(key);
  return (FluentModelImplT)this;
}

Fixed version (ground truth):
/** 
 * Removes a tag from the resource.
 * @param key the key of the tag to remove
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withoutTag(String key){
  if (this.inner().getTags() != null) {
    this.inner().getTags().remove(key);
  }
  return (FluentModelImplT)this;
}
Program: 37610
Project: 37610
Buggy source:
/** 
 * Removes a tag from the resource.
 * @param key the key of the tag to remove
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withoutTag(String key){
  this.inner().getTags().remove(key);
  return (FluentModelImplT)this;
}

Fixed version (ground truth):
/** 
 * Removes a tag from the resource.
 * @param key the key of the tag to remove
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withoutTag(String key){
  if (this.inner().getTags() != null) {
    this.inner().getTags().remove(key);
  }
  return (FluentModelImplT)this;
}
Program: 37611
Project: 37611
Buggy source:
/** 
 * Adds a tag to the resource.
 * @param key the key for the tag
 * @param value the value for the tag
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withTag(String key,String value){
  this.inner().getTags().put(key,value);
  return (FluentModelImplT)this;
}

Fixed version (ground truth):
/** 
 * Adds a tag to the resource.
 * @param key the key for the tag
 * @param value the value for the tag
 * @return the next stage of the definition/update
 */
@SuppressWarnings("String_Node_Str") public final FluentModelImplT withTag(String key,String value){
  if (this.inner().getTags() == null) {
    this.inner().withTags(new HashMap<String,String>());
  }
  this.inner().getTags().put(key,value);
  return (FluentModelImplT)this;
}
Program: 37612
Project: 37612
Buggy source:
@Override public SqlDatabaseImpl withTags(Map<String,String> tags){
  this.inner().withTags(tags);
  return this;
}

Fixed version (ground truth):
@Override public SqlDatabaseImpl withTags(Map<String,String> tags){
  this.inner().withTags(new HashMap<>(tags));
  return this;
}
Program: 37613
Project: 37613
Buggy source:
@Override public SqlDatabaseImpl withTag(String key,String value){
  this.inner().getTags().put(key,value);
  return this;
}

Fixed version (ground truth):
@Override public SqlDatabaseImpl withTag(String key,String value){
  if (this.inner().getTags() == null) {
    this.inner().withTags(new HashMap<String,String>());
  }
  this.inner().getTags().put(key,value);
  return this;
}
Program: 37614
Project: 37614
Buggy source:
@Override public SqlDatabaseImpl withoutTag(String key){
  this.inner().getTags().remove(key);
  return this;
}

Fixed version (ground truth):
@Override public SqlDatabaseImpl withoutTag(String key){
  if (this.inner().getTags() != null) {
    this.inner().getTags().remove(key);
  }
  return this;
}
Program: 37615
Project: 37615
Buggy source:
@Override public SqlElasticPoolImpl withTags(Map<String,String> tags){
  this.inner().withTags(tags);
  return this;
}

Fixed version (ground truth):
@Override public SqlElasticPoolImpl withTags(Map<String,String> tags){
  this.inner().withTags(new HashMap<>(tags));
  return this;
}
Program: 37616
Project: 37616
Buggy source:
@Override public SqlElasticPoolImpl withTag(String key,String value){
  this.inner().getTags().put(key,value);
  return this;
}

Fixed version (ground truth):
@Override public SqlElasticPoolImpl withTag(String key,String value){
  if (this.inner().getTags() == null) {
    this.inner().withTags(new HashMap<String,String>());
  }
  this.inner().getTags().put(key,value);
  return this;
}
Program: 37617
Project: 37617
Buggy source:
@Override public SqlElasticPoolImpl withoutTag(String key){
  this.inner().getTags().remove(key);
  return this;
}

Fixed version (ground truth):
@Override public SqlElasticPoolImpl withoutTag(String key){
  if (this.inner().getTags() != null) {
    this.inner().getTags().remove(key);
  }
  return this;
}
Program: 37623
Project: 37623
Buggy source:
/** 
 * @return list with task entries in this task group
 */
private List<TaskGroupEntry<TaskItem>> entriesSnapshot(){
  List<TaskGroupEntry<TaskItem>> entries=new ArrayList<>();
  super.prepareForEnumeration();
  for (TaskGroupEntry<TaskItem> current=super.getNext(); current != null; current=super.getNext()) {
    entries.add(current);
    super.reportCompletion(current);
  }
  return entries;
}

Fixed version (ground truth):
/** 
 * @return list with current task entries in this task group
 */
private List<TaskGroupEntry<TaskItem>> entriesSnapshot(){
  List<TaskGroupEntry<TaskItem>> entries=new ArrayList<>();
  super.prepareForEnumeration();
  for (TaskGroupEntry<TaskItem> current=super.getNext(); current != null; current=super.getNext()) {
    entries.add(current);
    super.reportCompletion(current);
  }
  return entries;
}
Program: 37624
Project: 37624
Buggy source:
/** 
 * @return the TaskGroup this invocation context associated with.
 */
public TaskGroup taskGroup(){
  return this.taskGroup;
}

Fixed version (ground truth):
/** 
 * @return the wrapped proxy task group.
 */
TaskGroup taskGroup(){
  return this.proxyTaskGroup;
}
Program: 37628
Project: 37628
Buggy source:
/** 
 * Get the log content for the specified container instance within a container group.
 * @param resourceGroupName the Azure resource group name
 * @param containerName the container instance name
 * @param containerGroupName the container group name
 * @param tailLineCount only get the last log lines up to this
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the log lines from the end, up to the number specified
 */
String getLogContent(String resourceGroupName,String containerName,String containerGroupName,int tailLineCount);

Fixed version (ground truth):
/** 
 * Get the log content for the specified container instance within a container group.
 * @param resourceGroupName the Azure resource group name
 * @param containerGroupName the container group name
 * @param containerName the container instance name
 * @param tailLineCount only get the last log lines up to this
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the log lines from the end, up to the number specified
 */
@Beta(Beta.SinceVersion.V1_5_0) String getLogContent(String resourceGroupName,String containerGroupName,String containerName,int tailLineCount);
Program: 37629
Project: 37629
Buggy source:
/** 
 * Get the log content for the specified container instance within a container group.
 * @param resourceGroupName the Azure resource group name
 * @param containerName the container instance name
 * @param containerGroupName the container group name
 * @param tailLineCount only get the last log lines up to this
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return a representation of the future computation of this call
 */
Observable<String> getLogContentAsync(String resourceGroupName,String containerName,String containerGroupName,int tailLineCount);

Fixed version (ground truth):
/** 
 * Get the log content for the specified container instance within a container group.
 * @param resourceGroupName the Azure resource group name
 * @param containerGroupName the container group name
 * @param containerName the container instance name
 * @param tailLineCount only get the last log lines up to this
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return a representation of the future computation of this call
 */
@Beta(Beta.SinceVersion.V1_5_0) Observable<String> getLogContentAsync(String resourceGroupName,String containerGroupName,String containerName,int tailLineCount);
Program: 37630
Project: 37630
Buggy source:
@Override public String getLogContent(String containerName,int tailLineCount){
  return this.manager().containerGroups().getLogContent(this.resourceGroupName(),containerName,this.name(),tailLineCount);
}

Fixed version (ground truth):
@Override public String getLogContent(String containerName,int tailLineCount){
  return this.manager().containerGroups().getLogContent(this.resourceGroupName(),this.name(),containerName,tailLineCount);
}
Program: 37631
Project: 37631
Buggy source:
@Override public Observable<String> getLogContentAsync(String containerName,int tailLineCount){
  return this.manager().containerGroups().getLogContentAsync(this.resourceGroupName(),containerName,this.name(),tailLineCount);
}

Fixed version (ground truth):
@Override public Observable<String> getLogContentAsync(String containerName,int tailLineCount){
  return this.manager().containerGroups().getLogContentAsync(this.resourceGroupName(),this.name(),containerName,tailLineCount);
}
Program: 37632
Project: 37632
Buggy source:
@Override public String getLogContent(String resourceGroupName,String containerName,String containerGroupName,int tailLineCount){
  LogsInner logsInner=this.manager().inner().containerLogs().list(resourceGroupName,containerName,containerGroupName,tailLineCount);
  return logsInner != null ? logsInner.content() : null;
}

Fixed version (ground truth):
@Override public String getLogContent(String resourceGroupName,String containerGroupName,String containerName,int tailLineCount){
  LogsInner logsInner=this.manager().inner().containerLogs().list(resourceGroupName,containerGroupName,containerName,tailLineCount);
  return logsInner != null ? logsInner.content() : null;
}
Program: 37633
Project: 37633
Buggy source:
@Override public Observable<String> getLogContentAsync(String resourceGroupName,String containerName,String containerGroupName,int tailLineCount){
  return this.manager().inner().containerLogs().listAsync(resourceGroupName,containerName,containerGroupName,tailLineCount).map(new Func1<LogsInner,String>(){
    @Override public String call(    LogsInner logsInner){
      return logsInner.content();
    }
  }
);
}

Fixed version (ground truth):
@Override public Observable<String> getLogContentAsync(String resourceGroupName,String containerGroupName,String containerName,int tailLineCount){
  return this.manager().inner().containerLogs().listAsync(resourceGroupName,containerGroupName,containerName,tailLineCount).map(new Func1<LogsInner,String>(){
    @Override public String call(    LogsInner logsInner){
      return logsInner.content();
    }
  }
);
}
Program: 37634
Project: 37634
Buggy source:
/** 
 * Get the certificates value.
 * @return the certificates value
 */
public Map<String,AppServiceCertificate> certificates(){
  return this.certificates;
}

Fixed version (ground truth):
/** 
 * Get the certificates value.
 * @return the certificates value
 */
public Map<String,AppServiceCertificateInner> certificates(){
  return this.certificates;
}
Program: 37635
Project: 37635
Buggy source:
/** 
 * Set the certificates value.
 * @param certificates the certificates value to set
 * @return the AppServiceCertificateOrderInner object itself.
 */
public AppServiceCertificateOrderInner withCertificates(Map<String,AppServiceCertificate> certificates){
  this.certificates=certificates;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the certificates value.
 * @param certificates the certificates value to set
 * @return the AppServiceCertificateOrderInner object itself.
 */
public AppServiceCertificateOrderInner withCertificates(Map<String,AppServiceCertificateInner> certificates){
  this.certificates=certificates;
  return this;
}
Program: 37636
Project: 37636
Buggy source:
FunctionAppsImpl(final AppServiceManager manager){
  super(manager.inner().webApps(),manager);
  converter=new PagedListConverter<SiteInner,FunctionApp>(){
    @Override public Observable<FunctionApp> typeConvertAsync(    final SiteInner siteInner){
      return manager.inner().webApps().getConfigurationAsync(siteInner.resourceGroup(),siteInner.name()).subscribeOn(SdkContext.getRxScheduler()).map(new Func1<SiteConfigResourceInner,FunctionApp>(){
        @Override public FunctionApp call(        SiteConfigResourceInner siteConfigResourceInner){
          return wrapModel(siteInner,siteConfigResourceInner);
        }
      }
);
    }
    @Override protected boolean filter(    SiteInner inner){
      return "String_Node_Str".equals(inner.kind());
    }
  }
;
}

Fixed version (ground truth):
FunctionAppsImpl(final AppServiceManager manager){
  super(manager.inner().webApps(),manager);
  converter=new PagedListConverter<SiteInner,FunctionApp>(){
    @Override public Observable<FunctionApp> typeConvertAsync(    final SiteInner siteInner){
      return manager.inner().webApps().getConfigurationAsync(siteInner.resourceGroup(),siteInner.name()).subscribeOn(SdkContext.getRxScheduler()).map(new Func1<SiteConfigResourceInner,FunctionApp>(){
        @Override public FunctionApp call(        SiteConfigResourceInner siteConfigResourceInner){
          return wrapModel(siteInner,siteConfigResourceInner);
        }
      }
);
    }
    @Override protected boolean filter(    SiteInner inner){
      return "String_Node_Str".equalsIgnoreCase(inner.kind());
    }
  }
;
}
Program: 37637
Project: 37637
Buggy source:
@Override protected boolean filter(SiteInner inner){
  return "String_Node_Str".equals(inner.kind());
}

Fixed version (ground truth):
@Override protected boolean filter(SiteInner inner){
  return "String_Node_Str".equalsIgnoreCase(inner.kind());
}
Program: 37638
Project: 37638
Buggy source:
@Override public Observable<ActiveDirectoryApplication> getByNameAsync(final String name){
  return innerCollection.listWithServiceResponseAsync(String.format("String_Node_Str",name)).flatMap(new Func1<ServiceResponse<Page<ApplicationInner>>,Observable<Page<ApplicationInner>>>(){
    @Override public Observable<Page<ApplicationInner>> call(    ServiceResponse<Page<ApplicationInner>> result){
      if (result == null || result.body().items() == null || result.body().items().isEmpty()) {
        return innerCollection.listAsync(String.format("String_Node_Str",name));
      }
      return Observable.just(result.body());
    }
  }
).map(new Func1<Page<ApplicationInner>,ActiveDirectoryApplicationImpl>(){
    @Override public ActiveDirectoryApplicationImpl call(    Page<ApplicationInner> result){
      if (result == null || result.items() == null || result.items().isEmpty()) {
        return null;
      }
      return new ActiveDirectoryApplicationImpl(result.items().get(0),manager());
    }
  }
).flatMap(new Func1<ActiveDirectoryApplicationImpl,Observable<ActiveDirectoryApplication>>(){
    @Override public Observable<ActiveDirectoryApplication> call(    ActiveDirectoryApplicationImpl application){
      if (application == null) {
        return null;
      }
      return application.refreshCredentialsAsync();
    }
  }
);
}

Fixed version (ground truth):
@Override public Observable<ActiveDirectoryApplication> getByNameAsync(String name){
  final String trimmed=name.replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
  return innerCollection.listWithServiceResponseAsync(String.format("String_Node_Str",trimmed)).flatMap(new Func1<ServiceResponse<Page<ApplicationInner>>,Observable<Page<ApplicationInner>>>(){
    @Override public Observable<Page<ApplicationInner>> call(    ServiceResponse<Page<ApplicationInner>> result){
      if (result == null || result.body().items() == null || result.body().items().isEmpty()) {
        try {
          UUID.fromString(trimmed);
          return innerCollection.listAsync(String.format("String_Node_Str",trimmed));
        }
 catch (        IllegalArgumentException e) {
          return null;
        }
      }
      return Observable.just(result.body());
    }
  }
).map(new Func1<Page<ApplicationInner>,ActiveDirectoryApplicationImpl>(){
    @Override public ActiveDirectoryApplicationImpl call(    Page<ApplicationInner> result){
      if (result == null || result.items() == null || result.items().isEmpty()) {
        return null;
      }
      return new ActiveDirectoryApplicationImpl(result.items().get(0),manager());
    }
  }
).flatMap(new Func1<ActiveDirectoryApplicationImpl,Observable<ActiveDirectoryApplication>>(){
    @Override public Observable<ActiveDirectoryApplication> call(    ActiveDirectoryApplicationImpl application){
      if (application == null) {
        return null;
      }
      return application.refreshCredentialsAsync();
    }
  }
);
}
Program: 37639
Project: 37639
Buggy source:
@Override protected CdnProfileImpl wrapModel(ProfileInner inner){
  return new CdnProfileImpl(inner.name(),inner,this.manager());
}

Fixed version (ground truth):
@Override protected CdnProfileImpl wrapModel(ProfileInner inner){
  if (inner == null) {
    return null;
  }
  return new CdnProfileImpl(inner.name(),inner,this.manager());
}
Program: 37640
Project: 37640
Buggy source:
@Override protected SnapshotImpl wrapModel(SnapshotInner inner){
  return new SnapshotImpl(inner.name(),inner,this.manager());
}

Fixed version (ground truth):
@Override protected SnapshotImpl wrapModel(SnapshotInner inner){
  if (inner == null) {
    return null;
  }
  return new SnapshotImpl(inner.name(),inner,this.manager());
}
Program: 37641
Project: 37641
Buggy source:
/** 
 * @return - returns the next Message to be processed out of the queue.
 */
@Override public Message poll(){
  final VirtualSpoutIdentifier nextIndentifier=nextVirtualSpoutIdGenerator.nextVirtualSpoutId();
  final Message nextMessage=messageBuffer.get(nextIndentifier).poll();
  logger.info("String_Node_Str",nextIndentifier,nextMessage);
  return nextMessage;
}

Fixed version (ground truth):
/** 
 * @return returns the next Message to be processed out of the queue.
 */
@Override public Message poll(){
  final VirtualSpoutIdentifier nextIndentifier=nextVirtualSpoutIdGenerator.nextVirtualSpoutId();
  return messageBuffer.get(nextIndentifier).poll();
}
Program: 37642
Project: 37642
Buggy source:
/** 
 * @return - return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewQueue(){
  return new LinkedBlockingQueue<>(getMaxBufferSize());
}

Fixed version (ground truth):
/** 
 * @return return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewQueue(){
  return new LinkedBlockingQueue<>(getMaxBufferSize());
}
Program: 37643
Project: 37643
Buggy source:
/** 
 * @return - returns the next Message to be processed out of the queue.
 */
@Override public Message poll(){
  if (consumerIdIterator == null || !consumerIdIterator.hasNext()) {
    consumerIdIterator=messageBuffer.keySet().iterator();
  }
  Message returnMsg=null;
  while (returnMsg == null && consumerIdIterator.hasNext()) {
    final VirtualSpoutIdentifier nextConsumerId=consumerIdIterator.next();
    final BlockingQueue<Message> queue=messageBuffer.get(nextConsumerId);
    if (queue == null) {
      logger.info("String_Node_Str");
      consumerIdIterator=messageBuffer.keySet().iterator();
      continue;
    }
    returnMsg=queue.poll();
  }
  return returnMsg;
}

Fixed version (ground truth):
/** 
 * @return returns the next Message to be processed out of the queue.
 */
@Override public Message poll(){
  if (consumerIdIterator == null || !consumerIdIterator.hasNext()) {
    consumerIdIterator=messageBuffer.keySet().iterator();
  }
  Message returnMsg=null;
  while (returnMsg == null && consumerIdIterator.hasNext()) {
    final VirtualSpoutIdentifier nextConsumerId=consumerIdIterator.next();
    final BlockingQueue<Message> queue=messageBuffer.get(nextConsumerId);
    if (queue == null) {
      logger.debug("String_Node_Str");
      consumerIdIterator=messageBuffer.keySet().iterator();
      continue;
    }
    returnMsg=queue.poll();
  }
  return returnMsg;
}
Program: 37644
Project: 37644
Buggy source:
BlockingQueue<Message> createBuffer(final VirtualSpoutIdentifier virtualSpoutIdentifier){
  final Matcher matches=regexPattern.matcher(virtualSpoutIdentifier.toString());
  if (matches.find()) {
    return createNewThrottledQueue();
  }
  return createNewNonThrottledQueue();
}

Fixed version (ground truth):
private BlockingQueue<Message> createBuffer(final VirtualSpoutIdentifier virtualSpoutIdentifier){
  final Matcher matches=regexPattern.matcher(virtualSpoutIdentifier.toString());
  if (matches.find()) {
    logger.debug("String_Node_Str",virtualSpoutIdentifier,true);
    return createNewThrottledQueue();
  }
  logger.debug("String_Node_Str",virtualSpoutIdentifier,false);
  return createNewNonThrottledQueue();
}
Program: 37645
Project: 37645
Buggy source:
/** 
 * @return - return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewThrottledQueue(){
  return new LinkedBlockingQueue<>(getThrottledBufferSize());
}

Fixed version (ground truth):
/** 
 * @return return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewThrottledQueue(){
  return new LinkedBlockingQueue<>(getThrottledBufferSize());
}
Program: 37646
Project: 37646
Buggy source:
/** 
 * @return - return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewNonThrottledQueue(){
  return new LinkedBlockingQueue<>(getMaxBufferSize());
}

Fixed version (ground truth):
/** 
 * @return return a new LinkedBlockingQueue instance with a max size of our configured buffer.
 */
private BlockingQueue<Message> createNewNonThrottledQueue(){
  return new LinkedBlockingQueue<>(getMaxBufferSize());
}
Program: 37648
Project: 37648
Buggy source:
/** 
 * @return - return the largest offset we have started tracking.This is NOT the same as the "Last Finished Offset"
 */
public long lastStartedOffset(){
  if ((lastFinishedOffset + 1) > lastStartedOffset) {
    return (lastFinishedOffset + 1);
  }
  return lastStartedOffset;
}

Fixed version (ground truth):
/** 
 * @return - return the largest offset we have started tracking.This is NOT the same as the "Last Finished Offset"
 */
public long lastStartedOffset(){
  if (lastStartedOffset == -1) {
    return lastFinishedOffset;
  }
  return lastStartedOffset;
}
Program: 37649
Project: 37649
Buggy source:
/** 
 * Get the kafka consumer, if it has been retried yet, set it up.
 * @return Kafka consumer
 */
private KafkaConsumer<byte[],byte[]> getKafkaConsumer(){
  if (kafkaConsumer == null) {
    kafkaConsumer=new KafkaConsumer<>(getConsumerConfig().getKafkaConsumerProperties());
  }
  return kafkaConsumer;
}

Fixed version (ground truth):
/** 
 * Get the kafka consumer, if it has been retried yet, set it up.
 * @return Kafka consumer
 */
KafkaConsumer<byte[],byte[]> getKafkaConsumer(){
  if (kafkaConsumer == null) {
    kafkaConsumer=new KafkaConsumer<>(getConsumerConfig().getKafkaConsumerProperties());
  }
  return kafkaConsumer;
}