Program: 116691
Project: 116691
Buggy source:
private void onArtifactUpdateEvent(ArtifactUpdatedEvent event){
  ArtifactUpdatedEvent artifactUpdatedEvent=event;
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str",artifactUpdatedEvent.toString()));
  }
  String clusterIdInPayload=CartridgeAgentConfiguration.getInstance().getClusterId();
  String localRepoPath=CartridgeAgentConfiguration.getInstance().getAppPath();
  String clusterIdInMessage=artifactUpdatedEvent.getClusterId();
  String repoURL=artifactUpdatedEvent.getRepoURL();
  String repoPassword=CartridgeAgentUtils.decryptPassword(artifactUpdatedEvent.getRepoPassword());
  String repoUsername=artifactUpdatedEvent.getRepoUserName();
  String tenantId=artifactUpdatedEvent.getTenantId();
  if (StringUtils.isNotEmpty(repoURL) && (clusterIdInPayload != null) && clusterIdInPayload.equals(clusterIdInMessage)) {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    RepositoryInformation repoInformation=new RepositoryInformation();
    repoInformation.setRepoUsername(repoUsername);
    repoInformation.setRepoPassword(repoPassword);
    repoInformation.setRepoUrl(repoURL);
    repoInformation.setRepoPath(localRepoPath);
    repoInformation.setTenantId(tenantId);
    boolean cloneExists=GitBasedArtifactRepository.getInstance().cloneExists(repoInformation);
    GitBasedArtifactRepository.getInstance().checkout(repoInformation);
    ExtensionUtils.executeArtifactsUpdatedExtension();
    if (!cloneExists) {
      CartridgeAgentEventPublisher.publishInstanceActivatedEvent();
    }
    GitBasedArtifactRepository.getInstance().scheduleSyncTask(repoInformation,10);
  }
}

Fixed version (ground truth):
private void onArtifactUpdateEvent(ArtifactUpdatedEvent event){
  ArtifactUpdatedEvent artifactUpdatedEvent=event;
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str",artifactUpdatedEvent.toString()));
  }
  String clusterIdInPayload=CartridgeAgentConfiguration.getInstance().getClusterId();
  String localRepoPath=CartridgeAgentConfiguration.getInstance().getAppPath();
  String clusterIdInMessage=artifactUpdatedEvent.getClusterId();
  String repoURL=artifactUpdatedEvent.getRepoURL();
  String repoPassword=CartridgeAgentUtils.decryptPassword(artifactUpdatedEvent.getRepoPassword());
  String repoUsername=artifactUpdatedEvent.getRepoUserName();
  String tenantId=artifactUpdatedEvent.getTenantId();
  boolean isMultitenant=CartridgeAgentConfiguration.getInstance().isMultitenant();
  if (StringUtils.isNotEmpty(repoURL) && (clusterIdInPayload != null) && clusterIdInPayload.equals(clusterIdInMessage)) {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    RepositoryInformation repoInformation=new RepositoryInformation();
    repoInformation.setRepoUsername(repoUsername);
    repoInformation.setRepoPassword(repoPassword);
    repoInformation.setRepoUrl(repoURL);
    repoInformation.setRepoPath(localRepoPath);
    repoInformation.setTenantId(tenantId);
    repoInformation.setMultitenant(isMultitenant);
    boolean cloneExists=GitBasedArtifactRepository.getInstance().cloneExists(repoInformation);
    GitBasedArtifactRepository.getInstance().checkout(repoInformation);
    ExtensionUtils.executeArtifactsUpdatedExtension();
    if (!cloneExists) {
      CartridgeAgentEventPublisher.publishInstanceActivatedEvent();
    }
    GitBasedArtifactRepository.getInstance().scheduleSyncTask(repoInformation,10);
  }
}