nus-yam/ex-repair huggingface dataset:
Program: 90018
Project: 90018
Buggy source:
/** 
 * Get the tags with the current genie.id and genie.name tags added into the set.
 * @return The final set of tags for storing in the database
 * @throws GenieException On any exception
 */
protected Set<String> getFinalTags() throws GenieException {
  final Set<String> finalTags;
  if (this.tags == null) {
    finalTags=Sets.newHashSet();
  }
 else {
    finalTags=Sets.newHashSet(this.tags.split(PIPE_REGEX)).stream().filter(tag -> !tag.contains(GENIE_TAG_NAMESPACE)).collect(Collectors.toSet());
  }
  if (this.getId() == null) {
    this.setId(UUID.randomUUID().toString());
  }
  finalTags.add(GENIE_ID_TAG_NAMESPACE + this.getId());
  finalTags.add(GENIE_NAME_TAG_NAMESPACE + this.getName());
  return finalTags;
}

Fixed version (ground truth):
/** 
 * Get the tags with the current genie.id and genie.name tags added into the set.
 * @return The final set of tags for storing in the database
 * @throws GenieException On any exception
 */
protected Set<String> getFinalTags() throws GenieException {
  final Set<String> finalTags;
  if (this.tags == null) {
    finalTags=Sets.newHashSet();
  }
 else {
    finalTags=Sets.newHashSet(this.splitTags(this.tags)).stream().filter(tag -> !tag.contains(GENIE_TAG_NAMESPACE)).collect(Collectors.toSet());
  }
  if (this.getId() == null) {
    this.setId(UUID.randomUUID().toString());
  }
  finalTags.add(GENIE_ID_TAG_NAMESPACE + this.getId());
  finalTags.add(GENIE_NAME_TAG_NAMESPACE + this.getName());
  return finalTags;
}
Program: 90019
Project: 90019
Buggy source:
/** 
 * Get the tags attached to this entity.
 * @return The tags attached to this entity
 */
public Set<String> getTags(){
  final Set<String> returnTags=new HashSet<>();
  if (this.tags != null) {
    returnTags.addAll(Arrays.asList(this.tags.split(PIPE_REGEX)));
  }
  return returnTags;
}

Fixed version (ground truth):
/** 
 * Get the tags attached to this entity.
 * @return The tags attached to this entity
 */
public Set<String> getTags(){
  if (this.tags != null) {
    return Sets.newHashSet(this.splitTags(this.tags));
  }
 else {
    return Sets.newHashSet();
  }
}
Program: 90020
Project: 90020
Buggy source:
/** 
 * Set the tags.
 * @param tags The tags to set
 */
public void setTags(final Set<String> tags){
  this.tags=null;
  if (tags != null && !tags.isEmpty()) {
    this.tags=tags.stream().sorted(String.CASE_INSENSITIVE_ORDER).reduce((one,two) -> one + PIPE + two).get();
  }
}

Fixed version (ground truth):
/** 
 * Set the tags.
 * @param tags The tags to set
 */
public void setTags(final Set<String> tags){
  this.tags=null;
  if (tags != null && !tags.isEmpty()) {
    this.tags=TAG_DELIMITER + tags.stream().sorted(String.CASE_INSENSITIVE_ORDER).reduce((one,two) -> one + TAG_DELIMITER + TAG_DELIMITER+ two).get() + TAG_DELIMITER;
  }
}
Program: 90021
Project: 90021
Buggy source:
/** 
 * Get the sorted like statement for tags used in specification queries.
 * @param tags The tags to use. Not null.
 * @return The tags sorted while ignoring case delimited with percent symbol.
 */
public static String getTagLikeString(@NotNull final Set<String> tags){
  final StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  tags.stream().filter(StringUtils::isNotBlank).sorted(String.CASE_INSENSITIVE_ORDER).forEach(tag -> builder.append(tag).append("String_Node_Str"));
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * Get the sorted like statement for tags used in specification queries.
 * @param tags The tags to use. Not null.
 * @return The tags sorted while ignoring case delimited with percent symbol.
 */
public static String getTagLikeString(@NotNull final Set<String> tags){
  final StringBuilder builder=new StringBuilder();
  tags.stream().filter(StringUtils::isNotBlank).sorted(String.CASE_INSENSITIVE_ORDER).forEach(tag -> builder.append(PERCENT).append(CommonFieldsEntity.TAG_DELIMITER).append(tag).append(CommonFieldsEntity.TAG_DELIMITER));
  return builder.append(PERCENT).toString();
}
Program: 90022
Project: 90022
Buggy source:
/** 
 * Test to patch a cluster.
 * @throws GenieException For any problem
 * @throws IOException For Json serialization problem
 */
@Test public void testPatchCluster() throws GenieException, IOException {
  final Cluster getCluster=this.service.getCluster(CLUSTER_1_ID);
  Assert.assertThat(getCluster.getName(),Matchers.is(CLUSTER_1_NAME));
  final Date updateTime=getCluster.getUpdated();
  final String patchString="String_Node_Str" + CLUSTER_2_NAME + "String_Node_Str";
  final ObjectMapper mapper=new ObjectMapper();
  final JsonPatch patch=JsonPatch.fromJson(mapper.readTree(patchString));
  this.service.patchCluster(CLUSTER_1_ID,patch);
  final Cluster updated=this.service.getCluster(CLUSTER_1_ID);
  Assert.assertNotEquals(updated.getUpdated(),Matchers.is(updateTime));
  Assert.assertThat(updated.getName(),Matchers.is(CLUSTER_2_NAME));
}

Fixed version (ground truth):
/** 
 * Test to patch a cluster.
 * @throws GenieException For any problem
 * @throws IOException    For Json serialization problem
 */
@Test public void testPatchCluster() throws GenieException, IOException {
  final Cluster getCluster=this.service.getCluster(CLUSTER_1_ID);
  Assert.assertThat(getCluster.getName(),Matchers.is(CLUSTER_1_NAME));
  final Date updateTime=getCluster.getUpdated();
  final String patchString="String_Node_Str" + CLUSTER_2_NAME + "String_Node_Str";
  final ObjectMapper mapper=new ObjectMapper();
  final JsonPatch patch=JsonPatch.fromJson(mapper.readTree(patchString));
  this.service.patchCluster(CLUSTER_1_ID,patch);
  final Cluster updated=this.service.getCluster(CLUSTER_1_ID);
  Assert.assertNotEquals(updated.getUpdated(),Matchers.is(updateTime));
  Assert.assertThat(updated.getName(),Matchers.is(CLUSTER_2_NAME));
}
Program: 90023
Project: 90023
Buggy source:
/** 
 * Test the choseClusterForJob function.
 * @throws GenieException For any problem
 */
@Ignore @Test public void testChooseClusterForJob() throws GenieException {
}

Fixed version (ground truth):
/** 
 * Test the choseClusterForJobRequest function.
 * @throws GenieException For any problem
 */
@Test public void testChooseClusterForJob() throws GenieException {
  final JobRequest one=new JobRequest.Builder(UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),Lists.newArrayList(new ClusterCriteria(Sets.newHashSet("String_Node_Str"))),Sets.newHashSet("String_Node_Str")).build();
  final JobRequest two=new JobRequest.Builder(UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),Lists.newArrayList(new ClusterCriteria(Sets.newHashSet("String_Node_Str"))),Sets.newHashSet("String_Node_Str")).build();
  final JobRequest three=new JobRequest.Builder(UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),Lists.newArrayList(new ClusterCriteria(Sets.newHashSet("String_Node_Str"))),Sets.newHashSet("String_Node_Str")).build();
  final JobRequest four=new JobRequest.Builder(UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),Lists.newArrayList(new ClusterCriteria(Sets.newHashSet("String_Node_Str"))),Sets.newHashSet("String_Node_Str")).build();
  final JobRequest five=new JobRequest.Builder(UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),Lists.newArrayList(new ClusterCriteria(Sets.newHashSet("String_Node_Str","String_Node_Str"))),Sets.newHashSet("String_Node_Str")).build();
  Assert.assertThat(this.service.chooseClusterForJobRequest(one).size(),Matchers.is(1));
  Assert.assertThat(this.service.chooseClusterForJobRequest(two).size(),Matchers.is(0));
  Assert.assertThat(this.service.chooseClusterForJobRequest(three).size(),Matchers.is(0));
  Assert.assertThat(this.service.chooseClusterForJobRequest(four).size(),Matchers.is(2));
  Assert.assertThat(this.service.chooseClusterForJobRequest(five).size(),Matchers.is(2));
}
Program: 90024
Project: 90024
Buggy source:
/** 
 * Make sure we can get a valid like string for the tag list.
 */
@Test public void canGetTagLikeString(){
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet()),Matchers.is("String_Node_Str"));
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet("String_Node_Str")),Matchers.is("String_Node_Str"));
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet("String_Node_Str","String_Node_Str","String_Node_Str")),Matchers.is("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Make sure we can get a valid like string for the tag list.
 */
@Test public void canGetTagLikeString(){
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet()),Matchers.is("String_Node_Str"));
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet("String_Node_Str")),Matchers.is("String_Node_Str" + CommonFieldsEntity.TAG_DELIMITER + "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"));
  Assert.assertThat(JpaSpecificationUtils.getTagLikeString(Sets.newHashSet("String_Node_Str","String_Node_Str","String_Node_Str")),Matchers.is("String_Node_Str" + CommonFieldsEntity.TAG_DELIMITER + "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"+ CommonFieldsEntity.TAG_DELIMITER+ "String_Node_Str"));
}
Program: 90025
Project: 90025
Buggy source:
@Override public Health health(){
  final double freePhysicalMemorySize=(double)operatingSystemMXBean.getFreePhysicalMemorySize();
  final double totalPhysicalMemorySize=(double)operatingSystemMXBean.getTotalPhysicalMemorySize();
  final double usedPhysicalMemoryPercentage=((totalPhysicalMemorySize - freePhysicalMemorySize) / totalPhysicalMemorySize) * 100;
  if (usedPhysicalMemoryPercentage > maxUsedPhysicalMemoryPercentage) {
    log.warn("String_Node_Str",usedPhysicalMemoryPercentage,maxUsedPhysicalMemoryPercentage);
    return Health.outOfService().withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize).build();
  }
 else {
    return Health.up().withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize).build();
  }
}

Fixed version (ground truth):
@Override public Health health(){
  Health.Builder result=Health.up();
  try {
    final double freePhysicalMemorySize=(double)operatingSystemMXBean.getFreePhysicalMemorySize();
    final double totalPhysicalMemorySize=(double)operatingSystemMXBean.getTotalPhysicalMemorySize();
    final double usedPhysicalMemoryPercentage=((totalPhysicalMemorySize - freePhysicalMemorySize) / totalPhysicalMemorySize) * 100;
    if (usedPhysicalMemoryPercentage > maxUsedPhysicalMemoryPercentage) {
      log.warn("String_Node_Str",usedPhysicalMemoryPercentage,maxUsedPhysicalMemoryPercentage);
      result=Health.outOfService();
    }
    result.withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize);
  }
 catch (  Throwable e) {
    log.warn("String_Node_Str",e.getMessage());
  }
  return result.build();
}
Program: 90026
Project: 90026
Buggy source:
/** 
 * Constructor.
 * @param maxUsedPhysicalMemoryPercentage The maximum physical memory threshold
 * @param operatingSystemMXBean MX bean for operating system
 */
@Autowired public MemoryHealthIndicator(@Value("String_Node_Str") final double maxUsedPhysicalMemoryPercentage,final OperatingSystemMXBean operatingSystemMXBean){
  this.maxUsedPhysicalMemoryPercentage=maxUsedPhysicalMemoryPercentage;
  this.operatingSystemMXBean=operatingSystemMXBean;
}

Fixed version (ground truth):
MemoryHealthIndicator(final double maxUsedPhysicalMemoryPercentage,final OperatingSystemMXBean operatingSystemMXBean){
  this.maxUsedPhysicalMemoryPercentage=maxUsedPhysicalMemoryPercentage;
  this.operatingSystemMXBean=operatingSystemMXBean;
}
Program: 90027
Project: 90027
Buggy source:
@Override public Health health(){
  final double freePhysicalMemorySize=(double)operatingSystemMXBean.getFreePhysicalMemorySize();
  final double totalPhysicalMemorySize=(double)operatingSystemMXBean.getTotalPhysicalMemorySize();
  final double usedPhysicalMemoryPercentage=((totalPhysicalMemorySize - freePhysicalMemorySize) / totalPhysicalMemorySize) * 100;
  if (usedPhysicalMemoryPercentage > maxUsedPhysicalMemoryPercentage) {
    log.warn("String_Node_Str",usedPhysicalMemoryPercentage,maxUsedPhysicalMemoryPercentage);
    return Health.outOfService().withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize).build();
  }
 else {
    return Health.up().withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize).build();
  }
}

Fixed version (ground truth):
@Override public Health health(){
  Health.Builder result=Health.up();
  try {
    final double freePhysicalMemorySize=(double)operatingSystemMXBean.getFreePhysicalMemorySize();
    final double totalPhysicalMemorySize=(double)operatingSystemMXBean.getTotalPhysicalMemorySize();
    final double usedPhysicalMemoryPercentage=((totalPhysicalMemorySize - freePhysicalMemorySize) / totalPhysicalMemorySize) * 100;
    if (usedPhysicalMemoryPercentage > maxUsedPhysicalMemoryPercentage) {
      log.warn("String_Node_Str",usedPhysicalMemoryPercentage,maxUsedPhysicalMemoryPercentage);
      result=Health.outOfService();
    }
    result.withDetail(FREE_PHYSICAL_MEMORY_SIZE,freePhysicalMemorySize).withDetail(TOTAL_PHYSICAL_MEMORY_SIZE,totalPhysicalMemorySize);
  }
 catch (  Throwable e) {
    log.warn("String_Node_Str",e.getMessage());
  }
  return result.build();
}
Program: 90028
Project: 90028
Buggy source:
/** 
 * Constructor.
 * @param maxUsedPhysicalMemoryPercentage The maximum physical memory threshold
 * @param operatingSystemMXBean MX bean for operating system
 */
@Autowired public MemoryHealthIndicator(@Value("String_Node_Str") final double maxUsedPhysicalMemoryPercentage,final OperatingSystemMXBean operatingSystemMXBean){
  this.maxUsedPhysicalMemoryPercentage=maxUsedPhysicalMemoryPercentage;
  this.operatingSystemMXBean=operatingSystemMXBean;
}

Fixed version (ground truth):
MemoryHealthIndicator(final double maxUsedPhysicalMemoryPercentage,final OperatingSystemMXBean operatingSystemMXBean){
  this.maxUsedPhysicalMemoryPercentage=maxUsedPhysicalMemoryPercentage;
  this.operatingSystemMXBean=operatingSystemMXBean;
}
Program: 90029
Project: 90029
Buggy source:
private void addConfigParamsFromConfig(final OkHttpClient.Builder builder,final GenieNetworkConfiguration genieNetworkConfiguration){
  if (genieNetworkConfiguration.getConnectTimeout() != 0) {
    builder.connectTimeout(genieNetworkConfiguration.getConnectTimeout(),TimeUnit.MILLISECONDS);
  }
  if (genieNetworkConfiguration.getReadTimeout() != 0) {
    builder.readTimeout(genieNetworkConfiguration.getReadTimeout(),TimeUnit.MILLISECONDS);
  }
  if (genieNetworkConfiguration.getWriteTimeout() != 0) {
    builder.writeTimeout(genieNetworkConfiguration.getWriteTimeout(),TimeUnit.MILLISECONDS);
  }
  builder.retryOnConnectionFailure(genieNetworkConfiguration.isRetryOnConnectionFailure());
}

Fixed version (ground truth):
private void addConfigParamsFromConfig(final OkHttpClient.Builder builder,final GenieNetworkConfiguration genieNetworkConfiguration){
  if (genieNetworkConfiguration.getConnectTimeout() != GenieNetworkConfiguration.DEFAULT_TIMEOUT) {
    builder.connectTimeout(genieNetworkConfiguration.getConnectTimeout(),TimeUnit.MILLISECONDS);
  }
  if (genieNetworkConfiguration.getReadTimeout() != GenieNetworkConfiguration.DEFAULT_TIMEOUT) {
    builder.readTimeout(genieNetworkConfiguration.getReadTimeout(),TimeUnit.MILLISECONDS);
  }
  if (genieNetworkConfiguration.getWriteTimeout() != GenieNetworkConfiguration.DEFAULT_TIMEOUT) {
    builder.writeTimeout(genieNetworkConfiguration.getWriteTimeout(),TimeUnit.MILLISECONDS);
  }
  builder.retryOnConnectionFailure(genieNetworkConfiguration.isRetryOnConnectionFailure());
}
Program: 90030
Project: 90030
Buggy source:
/** 
 * Constructor that takes the service url and a security interceptor implementation.
 * @param url The url of the Genie Service.
 * @param securityInterceptor An implementation of the Security Interceptor.
 * @param genieNetworkConfiguration  A configuration object that provides network settings for HTTP calls.
 * @throws GenieClientException If there is any problem creating the constructor.
 */
public BaseGenieClient(final String url,final SecurityInterceptor securityInterceptor,final GenieNetworkConfiguration genieNetworkConfiguration) throws GenieClientException {
  if (StringUtils.isBlank(url)) {
    throw new GenieClientException("String_Node_Str");
  }
  final OkHttpClient.Builder builder=new OkHttpClient.Builder();
  if (genieNetworkConfiguration != null) {
    addConfigParamsFromConfig(builder,genieNetworkConfiguration);
  }
  mapper=new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  builder.addInterceptor(new ResponseMappingInterceptor());
  if (securityInterceptor != null) {
    builder.addInterceptor(securityInterceptor);
  }
  final OkHttpClient client=builder.build();
  retrofit=new Retrofit.Builder().baseUrl(url).addConverterFactory(JacksonConverterFactory.create(mapper)).client(client).build();
}

Fixed version (ground truth):
/** 
 * Constructor that takes the service url and a security interceptor implementation.
 * @param url The url of the Genie Service.
 * @param securityInterceptor An implementation of the Security Interceptor.
 * @param genieNetworkConfiguration  A configuration object that provides network settings for HTTP calls.
 * @throws GenieClientException If there is any problem creating the constructor.
 */
public BaseGenieClient(final String url,final SecurityInterceptor securityInterceptor,final GenieNetworkConfiguration genieNetworkConfiguration) throws GenieClientException {
  if (StringUtils.isBlank(url)) {
    throw new GenieClientException("String_Node_Str");
  }
  final OkHttpClient.Builder builder=new OkHttpClient.Builder();
  if (genieNetworkConfiguration != null) {
    this.addConfigParamsFromConfig(builder,genieNetworkConfiguration);
  }
  mapper=new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  builder.addInterceptor(new ResponseMappingInterceptor());
  if (securityInterceptor != null) {
    builder.addInterceptor(securityInterceptor);
  }
  final OkHttpClient client=builder.build();
  retrofit=new Retrofit.Builder().baseUrl(url).addConverterFactory(JacksonConverterFactory.create(mapper)).client(client).build();
}
Program: 90031
Project: 90031
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Response intercept(final Chain chain) throws IOException {
  final Response response=chain.proceed(chain.request());
  if (response.isSuccessful()) {
    return response;
  }
 else {
    final JsonNode responseBody=mapper.readTree(response.body().string());
    throw new GenieClientException(response.code(),response.message() + "String_Node_Str" + responseBody.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Response intercept(final Chain chain) throws IOException {
  final Response response=chain.proceed(chain.request());
  if (response.isSuccessful()) {
    return response;
  }
 else {
    try {
      final JsonNode responseBody=mapper.readTree(response.body().string());
      throw new GenieClientException(response.code(),response.message() + "String_Node_Str" + responseBody.get("String_Node_Str"));
    }
 catch (    JsonMappingException jme) {
      throw new GenieClientException(response.code(),response.message() + response.body().toString());
    }
  }
}
Program: 90033
Project: 90033
Buggy source:
/** 
 * Constructor.
 * @param oauthUrl The url of the IDP from where to get the credentials.
 * @param clientId The clientId to use to get the credentials.
 * @param clientSecret The clientSecret to use to get the credentials.
 * @param grantType The type of the grant.
 * @param scope The scope of the credentials returned.
 * @throws GenieException If there is any problem.
 */
public TokenFetcher(final String oauthUrl,final String clientId,final String clientSecret,final String grantType,final String scope) throws GenieException {
  log.debug("String_Node_Str");
  try {
    final URL url=new URL(oauthUrl);
    final String oAuthServer=url.getProtocol() + "String_Node_Str" + url.getHost()+ "String_Node_Str";
    final Retrofit retrofit=new Retrofit.Builder().baseUrl(oAuthServer).addConverterFactory(JacksonConverterFactory.create()).build();
    this.oauthUrl=oauthUrl;
    tokenService=retrofit.create(TokenService.class);
    credentialParams.put(CLIENT_ID,clientId);
    credentialParams.put(CLIENT_SECRET,clientSecret);
    credentialParams.put(GRANT_TYPE,grantType);
    credentialParams.put(SCOPE,scope);
  }
 catch (  Exception e) {
    throw new GenieServerException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param oauthUrl The url of the IDP from where to get the credentials.
 * @param clientId The clientId to use to get the credentials.
 * @param clientSecret The clientSecret to use to get the credentials.
 * @param grantType The type of the grant.
 * @param scope The scope of the credentials returned.
 * @throws GenieException If there is any problem.
 */
public TokenFetcher(final String oauthUrl,final String clientId,final String clientSecret,final String grantType,final String scope) throws GenieException {
  log.debug("String_Node_Str");
  if (StringUtils.isBlank(oauthUrl)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  if (StringUtils.isBlank(clientId)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  if (StringUtils.isBlank(clientSecret)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  if (StringUtils.isBlank(grantType)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  if (StringUtils.isBlank(scope)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  try {
    final URL url=new URL(oauthUrl);
    final String oAuthServerUrl=url.getProtocol() + "String_Node_Str" + url.getHost()+ "String_Node_Str";
    final Retrofit retrofit=new Retrofit.Builder().baseUrl(oAuthServerUrl).addConverterFactory(JacksonConverterFactory.create()).build();
    this.oauthUrl=oauthUrl;
    tokenService=retrofit.create(TokenService.class);
    credentialParams.put(CLIENT_ID,clientId);
    credentialParams.put(CLIENT_SECRET,clientSecret);
    credentialParams.put(GRANT_TYPE,grantType);
    credentialParams.put(SCOPE,scope);
  }
 catch (  Exception e) {
    throw new GenieException(400,"String_Node_Str",e);
  }
}
Program: 90036
Project: 90036
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void createJobExecution(@NotNull(message="String_Node_Str") final JobExecution jobExecution) throws GenieException {
  log.debug("String_Node_Str",jobExecution);
  if (StringUtils.isBlank(jobExecution.getId())) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  final JobEntity jobEntity=jobRepo.findOne(jobExecution.getId());
  if (jobEntity == null) {
    throw new GenieNotFoundException("String_Node_Str");
  }
  final JobExecutionEntity jobExecutionEntity=new JobExecutionEntity();
  jobExecutionEntity.setId(jobExecution.getId());
  jobExecutionEntity.setHostName(jobExecution.getHostName());
  jobExecutionEntity.setProcessId(jobExecution.getProcessId());
  jobExecutionEntity.setCheckDelay(jobExecution.getCheckDelay());
  jobExecutionEntity.setTimeout(jobExecution.getTimeout());
  jobEntity.setExecution(jobExecutionEntity);
  jobEntity.setStatus(JobStatus.RUNNING);
  jobEntity.setStatusMsg("String_Node_Str");
  jobEntity.setStarted(new Date());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void createJobExecution(@NotNull(message="String_Node_Str") final JobExecution jobExecution) throws GenieException {
  log.debug("String_Node_Str",jobExecution);
  if (StringUtils.isBlank(jobExecution.getId())) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  this.updateJobStatus(jobExecution.getId(),JobStatus.RUNNING,"String_Node_Str");
  final JobEntity jobEntity=jobRepo.findOne(jobExecution.getId());
  if (jobEntity == null) {
    throw new GenieNotFoundException("String_Node_Str");
  }
  final JobExecutionEntity jobExecutionEntity=new JobExecutionEntity();
  jobExecutionEntity.setId(jobExecution.getId());
  jobExecutionEntity.setHostName(jobExecution.getHostName());
  jobExecutionEntity.setProcessId(jobExecution.getProcessId());
  jobExecutionEntity.setCheckDelay(jobExecution.getCheckDelay());
  jobExecutionEntity.setTimeout(jobExecution.getTimeout());
  jobEntity.setExecution(jobExecutionEntity);
}
Program: 90037
Project: 90037
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void updateJobStatus(@NotBlank(message="String_Node_Str") final String id,@NotNull(message="String_Node_Str") final JobStatus jobStatus,@NotBlank(message="String_Node_Str") final String statusMsg) throws GenieException {
  log.debug("String_Node_Str",id,jobStatus,statusMsg);
  final JobEntity jobEntity=this.jobRepo.findOne(id);
  if (jobEntity == null) {
    throw new GenieNotFoundException("String_Node_Str");
  }
  jobEntity.setStatus(jobStatus);
  jobEntity.setStatusMsg(statusMsg);
  if (jobStatus.equals(JobStatus.KILLED) || jobStatus.equals(JobStatus.FAILED) || jobStatus.equals(JobStatus.SUCCEEDED)) {
    jobEntity.setFinished(new Date());
  }
  this.jobRepo.save(jobEntity);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void updateJobStatus(@NotBlank(message="String_Node_Str") final String id,@NotNull(message="String_Node_Str") final JobStatus jobStatus,@NotBlank(message="String_Node_Str") final String statusMsg) throws GenieException {
  log.debug("String_Node_Str",id,jobStatus,statusMsg);
  final JobEntity jobEntity=this.jobRepo.findOne(id);
  if (jobEntity == null) {
    throw new GenieNotFoundException("String_Node_Str");
  }
  jobEntity.setStatus(jobStatus);
  jobEntity.setStatusMsg(statusMsg);
  if (jobStatus.equals(JobStatus.RUNNING)) {
    jobEntity.setStarted(new Date());
  }
 else   if (jobEntity.getStarted() != null && (jobStatus.equals(JobStatus.KILLED) || jobStatus.equals(JobStatus.FAILED) || jobStatus.equals(JobStatus.SUCCEEDED))) {
    jobEntity.setFinished(new Date());
  }
  this.jobRepo.save(jobEntity);
}
Program: 90038
Project: 90038
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void addCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,@NotEmpty(message="String_Node_Str") final List<String> commandIds) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  for (  final String commandId : commandIds) {
    final CommandEntity cmd=this.commandRepo.findOne(commandId);
    if (cmd != null) {
      clusterEntity.addCommand(cmd);
    }
 else {
      throw new GenieNotFoundException("String_Node_Str" + commandId + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void addCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,@NotEmpty(message="String_Node_Str") final List<String> commandIds) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  final Set<String> resultCommandIds=clusterEntity.getCommands().stream().map(CommandEntity::getId).collect(Collectors.toSet());
  for (  final String commandId : commandIds) {
    if (resultCommandIds.contains(commandId)) {
      throw new GeniePreconditionException("String_Node_Str" + commandId + "String_Node_Str");
    }
    final CommandEntity cmd=this.commandRepo.findOne(commandId);
    if (cmd != null) {
      clusterEntity.addCommand(cmd);
      resultCommandIds.add(commandId);
    }
 else {
      throw new GenieNotFoundException("String_Node_Str" + commandId + "String_Node_Str");
    }
  }
}
Program: 90039
Project: 90039
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @Transactional(readOnly=true) public List<com.netflix.genie.common.dto.Command> getCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,final Set<CommandStatus> statuses) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  final List<CommandEntity> commandEntities=clusterEntity.getCommands();
  if (statuses != null) {
    return commandEntities.stream().filter(command -> statuses.contains(command.getStatus())).map(CommandEntity::getDTO).collect(Collectors.toList());
  }
 else {
    return commandEntities.stream().map(CommandEntity::getDTO).collect(Collectors.toList());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @Transactional(readOnly=true) public List<Command> getCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,final Set<CommandStatus> statuses) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  final List<CommandEntity> commandEntities=clusterEntity.getCommands();
  if (statuses != null) {
    return commandEntities.stream().filter(command -> statuses.contains(command.getStatus())).map(CommandEntity::getDTO).collect(Collectors.toList());
  }
 else {
    return commandEntities.stream().map(CommandEntity::getDTO).collect(Collectors.toList());
  }
}
Program: 90040
Project: 90040
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void updateCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,@NotNull(message="String_Node_Str") final List<String> commandIds) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  final List<CommandEntity> commandEntities=new ArrayList<>();
  for (  final String commandId : commandIds) {
    final CommandEntity cmd=this.commandRepo.findOne(commandId);
    if (cmd != null) {
      commandEntities.add(cmd);
    }
 else {
      throw new GenieNotFoundException("String_Node_Str" + commandId + "String_Node_Str");
    }
  }
  clusterEntity.setCommands(commandEntities);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void updateCommandsForCluster(@NotBlank(message="String_Node_Str") final String id,@NotNull(message="String_Node_Str") final List<String> commandIds) throws GenieException {
  final ClusterEntity clusterEntity=this.findCluster(id);
  final List<CommandEntity> commandEntities=new ArrayList<>();
  final Set<String> currentIds=new HashSet<>();
  for (  final String commandId : commandIds) {
    if (currentIds.contains(commandId)) {
      throw new GeniePreconditionException("String_Node_Str" + commandId + "String_Node_Str");
    }
    final CommandEntity cmd=this.commandRepo.findOne(commandId);
    if (cmd != null) {
      currentIds.add(commandId);
      commandEntities.add(cmd);
    }
 else {
      throw new GenieNotFoundException("String_Node_Str" + commandId + "String_Node_Str");
    }
  }
  clusterEntity.setCommands(commandEntities);
}
Program: 90041
Project: 90041
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void addApplicationsForCommand(@NotBlank(message="String_Node_Str") final String id,@NotEmpty(message="String_Node_Str") final List<String> applicationIds) throws GenieException {
  if (applicationIds.size() != applicationIds.stream().filter(this.appRepo::exists).count()) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  final CommandEntity commandEntity=this.findCommand(id);
  applicationIds.stream().forEach(applicationId -> commandEntity.getApplications().add(this.appRepo.findOne(applicationId)));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void addApplicationsForCommand(@NotBlank(message="String_Node_Str") final String id,@NotEmpty(message="String_Node_Str") final List<String> applicationIds) throws GenieException {
  if (applicationIds.size() != applicationIds.stream().filter(this.appRepo::exists).count()) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  final CommandEntity commandEntity=this.findCommand(id);
  final Set<String> resultApplicationIds=commandEntity.getApplications().stream().map(ApplicationEntity::getId).collect(Collectors.toSet());
  for (  final String applicationId : applicationIds) {
    if (resultApplicationIds.contains(applicationId)) {
      throw new GeniePreconditionException("String_Node_Str" + id + "String_Node_Str");
    }
    commandEntity.getApplications().add(this.appRepo.findOne(applicationId));
    resultApplicationIds.add(id);
  }
}
Program: 90042
Project: 90042
Buggy source:
/** 
 * Constructor.
 * @param hostName         The name of the host this Genie node is running on
 * @param jobSearchService The job search service to use to locate job information
 * @param executor         The executor to use to run system processes
 */
public LocalJobKillServiceImpl(@NotBlank final String hostName,@NotNull final JobSearchService jobSearchService,@NotNull final Executor executor){
  this.hostName=hostName;
  this.jobSearchService=jobSearchService;
  this.executor=executor;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param hostName         The name of the host this Genie node is running on
 * @param jobSearchService The job search service to use to locate job information
 * @param executor         The executor to use to run system processes
 * @param runAsUser        True if jobs are run as the user who submitted the job
 */
public LocalJobKillServiceImpl(@NotBlank final String hostName,@NotNull final JobSearchService jobSearchService,@NotNull final Executor executor,final boolean runAsUser){
  this.hostName=hostName;
  this.jobSearchService=jobSearchService;
  this.executor=executor;
  this.runAsUser=runAsUser;
}
Program: 90043
Project: 90043
Buggy source:
private void killJobOnUnix(final int pid) throws GenieException {
  try {
    final Calendar tomorrow=Calendar.getInstance(JobConstants.UTC);
    tomorrow.add(Calendar.DAY_OF_YEAR,1);
    final ProcessChecker processChecker=new UnixProcessChecker(pid,this.executor,tomorrow.getTime());
    processChecker.checkProcess();
  }
 catch (  final ExecuteException ee) {
    log.debug("String_Node_Str",pid);
    return;
  }
catch (  final IOException ioe) {
    throw new GenieServerException("String_Node_Str" + pid,ioe);
  }
  try {
    final CommandLine killCommand=new CommandLine("String_Node_Str");
    killCommand.addArguments(Integer.toString(pid));
    this.executor.execute(killCommand);
  }
 catch (  final IOException ioe) {
    throw new GenieServerException("String_Node_Str" + pid,ioe);
  }
}

Fixed version (ground truth):
private void killJobOnUnix(final int pid) throws GenieException {
  try {
    final Calendar tomorrow=Calendar.getInstance(JobConstants.UTC);
    tomorrow.add(Calendar.DAY_OF_YEAR,1);
    final ProcessChecker processChecker=new UnixProcessChecker(pid,this.executor,tomorrow.getTime());
    processChecker.checkProcess();
  }
 catch (  final ExecuteException ee) {
    log.debug("String_Node_Str",pid);
    return;
  }
catch (  final IOException ioe) {
    throw new GenieServerException("String_Node_Str" + pid,ioe);
  }
  try {
    final CommandLine killCommand;
    if (this.runAsUser) {
      killCommand=new CommandLine("String_Node_Str");
      killCommand.addArgument("String_Node_Str");
    }
 else {
      killCommand=new CommandLine("String_Node_Str");
    }
    killCommand.addArguments(Integer.toString(pid));
    this.executor.execute(killCommand);
  }
 catch (  final IOException ioe) {
    throw new GenieServerException("String_Node_Str" + pid,ioe);
  }
}
Program: 90044
Project: 90044
Buggy source:
/** 
 * Get an local implementation of the JobKillService.
 * @param hostname         The name of the host this Genie node is running on.
 * @param jobSearchService The job search service to use to locate job information.
 * @param executor         The executor to use to run system processes.
 * @return A job kill service instance.
 */
@Bean public JobKillService jobKillService(final String hostname,final JobSearchService jobSearchService,final Executor executor){
  return new LocalJobKillServiceImpl(hostname,jobSearchService,executor);
}

Fixed version (ground truth):
/** 
 * Get an local implementation of the JobKillService.
 * @param hostname         The name of the host this Genie node is running on.
 * @param jobSearchService The job search service to use to locate job information.
 * @param executor         The executor to use to run system processes.
 * @return A job kill service instance.
 */
@Bean public JobKillService jobKillService(final String hostname,final JobSearchService jobSearchService,final Executor executor){
  return new LocalJobKillServiceImpl(hostname,jobSearchService,executor,false);
}
Program: 90045
Project: 90045
Buggy source:
/** 
 * Setup for the tests.
 */
@Before public void setup(){
  Assume.assumeTrue(SystemUtils.IS_OS_UNIX);
  this.jobSearchService=Mockito.mock(JobSearchService.class);
  this.executor=Mockito.mock(Executor.class);
  this.service=new LocalJobKillServiceImpl(HOSTNAME,this.jobSearchService,this.executor);
  this.killCommand=new CommandLine("String_Node_Str");
  this.killCommand.addArguments(Integer.toString(PID));
  this.psCommand=new CommandLine("String_Node_Str");
  this.psCommand.addArgument("String_Node_Str");
  this.psCommand.addArgument(Integer.toString(PID));
}

Fixed version (ground truth):
/** 
 * Setup for the tests.
 */
@Before public void setup(){
  Assume.assumeTrue(SystemUtils.IS_OS_UNIX);
  this.jobSearchService=Mockito.mock(JobSearchService.class);
  this.executor=Mockito.mock(Executor.class);
  this.service=new LocalJobKillServiceImpl(HOSTNAME,this.jobSearchService,this.executor,false);
  this.killCommand=new CommandLine("String_Node_Str");
  this.killCommand.addArguments(Integer.toString(PID));
}
Program: 90046
Project: 90046
Buggy source:
/** 
 * Returns a bean for mail service impl using the Spring Mail.
 * @param javaMailSender An implementation of the JavaMailSender interface.
 * @param fromAddress    The from email address for the email.
 * @param mailUser       The userid of the account used to send email.
 * @param mailPassword   The password of the account used to send email.
 * @return An instance of MailService implementation.
 * @throws GenieException If there is any problem.
 */
@Bean @ConditionalOnBean(JavaMailSender.class) public MailService getJavaMailSenderMailService(final JavaMailSender javaMailSender,@Value("String_Node_Str") final String fromAddress,@Value("String_Node_Str") final String mailUser,@Value("String_Node_Str") final String mailPassword) throws GenieException {
  return new MailServiceImpl(javaMailSender,fromAddress,mailUser,mailPassword);
}

Fixed version (ground truth):
/** 
 * Returns a bean for mail service impl using the Spring Mail.
 * @param javaMailSender An implementation of the JavaMailSender interface.
 * @param fromAddress    The from email address for the email.
 * @param mailUser       The userid of the account used to send email.
 * @param mailPassword   The password of the account used to send email.
 * @return An instance of MailService implementation.
 * @throws GenieException If there is any problem.
 */
@Bean @ConditionalOnProperty("String_Node_Str") public MailService getJavaMailSenderMailService(final JavaMailSender javaMailSender,@Value("String_Node_Str") final String fromAddress,@Value("String_Node_Str") final String mailUser,@Value("String_Node_Str") final String mailPassword) throws GenieException {
  return new MailServiceImpl(javaMailSender,fromAddress,mailUser,mailPassword);
}
Program: 90047
Project: 90047
Buggy source:
/** 
 * Get an instance of the JobCoordinatorService.
 * @param jobPersistenceService implementation of job persistence service interface
 * @param jobSearchService      implementation of job search service interface
 * @param jobSubmitterService   implementation of the job submitter service
 * @param jobKillService        The job kill service to use
 * @param baseArchiveLocation   The base directory location of where the job dir should be archived
 * @return An instance of the JobCoordinatorService.
 */
@Bean public JobCoordinatorService jobCoordinatorService(final JobPersistenceService jobPersistenceService,final JobSearchService jobSearchService,final JobSubmitterService jobSubmitterService,final JobKillService jobKillService,@Value("String_Node_Str") final String baseArchiveLocation){
  return new JobCoordinatorService(jobPersistenceService,jobSubmitterService,jobKillService,baseArchiveLocation);
}

Fixed version (ground truth):
/** 
 * Get an instance of the JobCoordinatorService.
 * @param jobPersistenceService implementation of job persistence service interface
 * @param jobSubmitterService   implementation of the job submitter service
 * @param jobKillService        The job kill service to use
 * @param baseArchiveLocation   The base directory location of where the job dir should be archived
 * @return An instance of the JobCoordinatorService.
 */
@Bean public JobCoordinatorService jobCoordinatorService(final JobPersistenceService jobPersistenceService,final JobSubmitterService jobSubmitterService,final JobKillService jobKillService,@Value("String_Node_Str") final String baseArchiveLocation){
  return new JobCoordinatorService(jobPersistenceService,jobSubmitterService,jobKillService,baseArchiveLocation);
}
Program: 90048
Project: 90048
Buggy source:
/** 
 * Get an local implementation of the JobKillService.
 * @param hostName         The name of the host this Genie node is running on.
 * @param jobSearchService The job search service to use to locate job information.
 * @param executor         The executor to use to run system processes.
 * @return A job kill service instance.
 */
@Bean public JobKillService jobKillService(final String hostName,final JobSearchService jobSearchService,final Executor executor){
  return new LocalJobKillServiceImpl(hostName,jobSearchService,executor);
}

Fixed version (ground truth):
/** 
 * Get an local implementation of the JobKillService.
 * @param hostName         The name of the host this Genie node is running on.
 * @param jobSearchService The job search service to use to locate job information.
 * @param executor         The executor to use to run system processes.
 * @param runAsUser        Whether jobs on this instance are run as the user or not
 * @return A job kill service instance.
 */
@Bean public JobKillService jobKillService(final String hostName,final JobSearchService jobSearchService,final Executor executor,@Value("String_Node_Str") final boolean runAsUser){
  return new LocalJobKillServiceImpl(hostName,jobSearchService,executor,runAsUser);
}
Program: 90049
Project: 90049
Buggy source:
/** 
 * Can get a bean for Job Coordinator Service.
 */
@Test public void canGetJobCoordinatorServiceBean(){
  final JobPersistenceService jobPersistenceService=Mockito.mock(JobPersistenceService.class);
  final JobSubmitterService jobSubmitterService=Mockito.mock(JobSubmitterService.class);
  final JobKillService jobKillService=Mockito.mock(JobKillService.class);
  Assert.assertNotNull(this.servicesConfig.jobCoordinatorService(jobPersistenceService,this.jobSearchService,jobSubmitterService,jobKillService,"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Can get a bean for Job Coordinator Service.
 */
@Test public void canGetJobCoordinatorServiceBean(){
  final JobPersistenceService jobPersistenceService=Mockito.mock(JobPersistenceService.class);
  final JobSubmitterService jobSubmitterService=Mockito.mock(JobSubmitterService.class);
  final JobKillService jobKillService=Mockito.mock(JobKillService.class);
  Assert.assertNotNull(this.servicesConfig.jobCoordinatorService(jobPersistenceService,jobSubmitterService,jobKillService,"String_Node_Str"));
}
Program: 90050
Project: 90050
Buggy source:
/** 
 * Can get a bean for Job Kill Service.
 */
@Test public void canGetJobKillServiceBean(){
  Assert.assertNotNull(this.servicesConfig.jobKillService("String_Node_Str",this.jobSearchService,Mockito.mock(Executor.class)));
}

Fixed version (ground truth):
/** 
 * Can get a bean for Job Kill Service.
 */
@Test public void canGetJobKillServiceBean(){
  Assert.assertNotNull(this.servicesConfig.jobKillService("String_Node_Str",this.jobSearchService,Mockito.mock(Executor.class),true));
}
Program: 90053
Project: 90053
Buggy source:
/** 
 * Method to change the ownership of a directory.
 * @param dir The directory to change the ownership of.
 * @param user Userid of the user.
 * @throws GenieException If there is a problem.
 */
public void changeOwnershipOfDirectory(final String dir,final String user) throws GenieException {
  final CommandLine commandLine=new CommandLine("String_Node_Str");
  commandLine.addArgument("String_Node_Str");
  commandLine.addArgument(user);
  commandLine.addArgument(dir);
  try {
    this.executor.execute(commandLine);
  }
 catch (  IOException ioexception) {
    throw new GenieServerException("String_Node_Str" + ioexception);
  }
}

Fixed version (ground truth):
/** 
 * Method to change the ownership of a directory.
 * @param dir The directory to change the ownership of.
 * @param user Userid of the user.
 * @throws GenieException If there is a problem.
 */
public void changeOwnershipOfDirectory(final String dir,final String user) throws GenieException {
  final CommandLine commandLine=new CommandLine("String_Node_Str");
  commandLine.addArgument("String_Node_Str");
  commandLine.addArgument("String_Node_Str");
  commandLine.addArgument(user);
  commandLine.addArgument(dir);
  try {
    this.executor.execute(commandLine);
  }
 catch (  IOException ioexception) {
    throw new GenieServerException("String_Node_Str" + ioexception);
  }
}
Program: 90054
Project: 90054
Buggy source:
/** 
 * Create user on the system.
 * @param user user id
 * @param group group id
 * @throws GenieException If there is any problem.
 */
public void createUser(final String user,final String group) throws GenieException {
  final CommandLine idCheckCommandLine=new CommandLine("String_Node_Str");
  idCheckCommandLine.addArgument("String_Node_Str");
  idCheckCommandLine.addArgument(user);
  try {
    this.executor.execute(idCheckCommandLine);
    log.info("String_Node_Str");
  }
 catch (  IOException ioe) {
    log.info("String_Node_Str");
    final CommandLine userCreateCommandLine=new CommandLine("String_Node_Str");
    userCreateCommandLine.addArgument("String_Node_Str");
    userCreateCommandLine.addArgument(user);
    if (StringUtils.isNotBlank(group)) {
      userCreateCommandLine.addArgument("String_Node_Str");
      userCreateCommandLine.addArgument(group);
    }
    userCreateCommandLine.addArgument("String_Node_Str");
    try {
      this.executor.execute(userCreateCommandLine);
    }
 catch (    IOException ioexception) {
      throw new GenieServerException("String_Node_Str" + user + "String_Node_Str"+ ioexception);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create user on the system.
 * @param user user id
 * @param group group id
 * @throws GenieException If there is any problem.
 */
public void createUser(final String user,final String group) throws GenieException {
  final CommandLine idCheckCommandLine=new CommandLine("String_Node_Str");
  idCheckCommandLine.addArgument("String_Node_Str");
  idCheckCommandLine.addArgument(user);
  try {
    this.executor.execute(idCheckCommandLine);
    log.debug("String_Node_Str");
  }
 catch (  IOException ioe) {
    log.debug("String_Node_Str");
    final CommandLine groupCreateCommandLine=new CommandLine("String_Node_Str");
    groupCreateCommandLine.addArgument("String_Node_Str");
    groupCreateCommandLine.addArgument(group);
    try {
      this.executor.execute(groupCreateCommandLine);
    }
 catch (    IOException ioexception) {
      log.debug("String_Node_Str");
    }
    final CommandLine userCreateCommandLine=new CommandLine("String_Node_Str");
    userCreateCommandLine.addArgument("String_Node_Str");
    userCreateCommandLine.addArgument(user);
    if (StringUtils.isNotBlank(group)) {
      userCreateCommandLine.addArgument("String_Node_Str");
      userCreateCommandLine.addArgument(group);
    }
    userCreateCommandLine.addArgument("String_Node_Str");
    try {
      this.executor.execute(userCreateCommandLine);
    }
 catch (    IOException ioexception) {
      throw new GenieServerException("String_Node_Str" + user + "String_Node_Str"+ ioexception);
    }
  }
}