Program: 116623
Project: 116623
Buggy source:
private CartridgeSubscription subscribe(SubscriptionData subscriptionData,CartridgeInfo cartridgeInfo,String lbClusterId) throws ADCException, InvalidCartridgeAliasException, DuplicateCartridgeAliasException, PolicyException, UnregisteredCartridgeException, RepositoryRequiredException, RepositoryCredentialsRequiredException, RepositoryTransportException, AlreadySubscribedException, InvalidRepositoryException {
  SubscriptionTenancyBehaviour tenancyBehaviour;
  if (cartridgeInfo.getMultiTenant()) {
    tenancyBehaviour=new SubscriptionMultiTenantBehaviour();
  }
 else {
    tenancyBehaviour=new SubscriptionSingleTenantBehaviour();
  }
  CartridgeSubscription cartridgeSubscription=CartridgeSubscriptionFactory.getCartridgeSubscriptionInstance(cartridgeInfo,tenancyBehaviour);
  String subscriptionKey=CartridgeSubscriptionUtils.generateSubscriptionKey();
  cartridgeSubscription.setSubscriptionKey(subscriptionKey);
  String encryptedRepoPassword;
  String repositoryPassword=subscriptionData.getRepositoryPassword();
  if (repositoryPassword != null && !repositoryPassword.isEmpty()) {
    encryptedRepoPassword=RepoPasswordMgtUtil.encryptPassword(repositoryPassword,subscriptionKey);
  }
 else {
    encryptedRepoPassword=repositoryPassword;
  }
  Repository repository=cartridgeSubscription.manageRepository(subscriptionData.getRepositoryURL(),subscriptionData.getRepositoryUsername(),encryptedRepoPassword,subscriptionData.isPrivateRepository());
  Subscriber subscriber=new Subscriber(subscriptionData.getTenantAdminUsername(),subscriptionData.getTenantId(),subscriptionData.getTenantDomain());
  cartridgeSubscription.setLbClusterId(lbClusterId);
  cartridgeSubscription.createSubscription(subscriber,subscriptionData.getCartridgeAlias(),subscriptionData.getAutoscalingPolicyName(),subscriptionData.getDeploymentPolicyName(),repository);
  cartridgeSubscription.getPayloadData().add(CartridgeConstants.COMMIT_ENABLED,String.valueOf(subscriptionData.isCommitsEnabled()));
  log.info("String_Node_Str" + subscriptionData.getTenantId() + "String_Node_Str"+ subscriptionData.getTenantAdminUsername()+ "String_Node_Str"+ "String_Node_Str"+ subscriptionData.getCartridgeAlias()+ "String_Node_Str"+ subscriptionData.getCartridgeType()+ "String_Node_Str"+ subscriptionData.getRepositoryURL()+ "String_Node_Str"+ subscriptionData.getAutoscalingPolicyName()+ "String_Node_Str"+ subscriptionData.getDeploymentPolicyName());
  return cartridgeSubscription;
}

Fixed version (ground truth):
private CartridgeSubscription subscribe(SubscriptionData subscriptionData,CartridgeInfo cartridgeInfo,String lbClusterId) throws ADCException, InvalidCartridgeAliasException, DuplicateCartridgeAliasException, PolicyException, UnregisteredCartridgeException, RepositoryRequiredException, RepositoryCredentialsRequiredException, RepositoryTransportException, AlreadySubscribedException, InvalidRepositoryException {
  SubscriptionTenancyBehaviour tenancyBehaviour;
  if (cartridgeInfo.getMultiTenant()) {
    tenancyBehaviour=new SubscriptionMultiTenantBehaviour();
  }
 else {
    tenancyBehaviour=new SubscriptionSingleTenantBehaviour();
  }
  CartridgeSubscription cartridgeSubscription=CartridgeSubscriptionFactory.getCartridgeSubscriptionInstance(cartridgeInfo,tenancyBehaviour);
  String subscriptionKey=CartridgeSubscriptionUtils.generateSubscriptionKey();
  cartridgeSubscription.setSubscriptionKey(subscriptionKey);
  String encryptedRepoPassword;
  String repositoryPassword=subscriptionData.getRepositoryPassword();
  if (repositoryPassword != null && !repositoryPassword.isEmpty()) {
    encryptedRepoPassword=RepoPasswordMgtUtil.encryptPassword(repositoryPassword,subscriptionKey);
  }
 else {
    encryptedRepoPassword="String_Node_Str";
  }
  Repository repository=cartridgeSubscription.manageRepository(subscriptionData.getRepositoryURL(),subscriptionData.getRepositoryUsername(),encryptedRepoPassword,subscriptionData.isPrivateRepository());
  Subscriber subscriber=new Subscriber(subscriptionData.getTenantAdminUsername(),subscriptionData.getTenantId(),subscriptionData.getTenantDomain());
  cartridgeSubscription.setLbClusterId(lbClusterId);
  cartridgeSubscription.createSubscription(subscriber,subscriptionData.getCartridgeAlias(),subscriptionData.getAutoscalingPolicyName(),subscriptionData.getDeploymentPolicyName(),repository);
  cartridgeSubscription.getPayloadData().add(CartridgeConstants.COMMIT_ENABLED,String.valueOf(subscriptionData.isCommitsEnabled()));
  log.info("String_Node_Str" + subscriptionData.getTenantId() + "String_Node_Str"+ subscriptionData.getTenantAdminUsername()+ "String_Node_Str"+ "String_Node_Str"+ subscriptionData.getCartridgeAlias()+ "String_Node_Str"+ subscriptionData.getCartridgeType()+ "String_Node_Str"+ subscriptionData.getRepositoryURL()+ "String_Node_Str"+ subscriptionData.getAutoscalingPolicyName()+ "String_Node_Str"+ subscriptionData.getDeploymentPolicyName());
  return cartridgeSubscription;
}