Program: 20761
Project: 20761
Buggy source:
private void synchConfiguration(){
  List repos=archivaConfiguration.getConfiguration().getRepositories();
  Iterator it=repos.iterator();
  while (it.hasNext()) {
    RepositoryConfiguration repoConfig=(RepositoryConfiguration)it.next();
    try {
      try {
        ArchivaRepository repository=dao.getRepositoryDAO().getRepository(repoConfig.getId());
        repository.getModel().setName(repoConfig.getName());
        repository.getModel().setUrl(repoConfig.getUrl());
        repository.getModel().setLayoutName(repoConfig.getLayout());
        repository.getModel().setCreationSource("String_Node_Str");
        repository.getModel().setReleasePolicy(repoConfig.isReleases());
        repository.getModel().setSnapshotPolicy(repoConfig.isSnapshots());
        dao.getRepositoryDAO().saveRepository(repository);
      }
 catch (      ObjectNotFoundException e) {
        getLogger().info("String_Node_Str" + repoConfig);
        ArchivaRepository drepo=ArchivaConfigurationAdaptor.toArchivaRepository(repoConfig);
        drepo.getModel().setCreationSource("String_Node_Str");
        dao.getRepositoryDAO().saveRepository(drepo);
      }
    }
 catch (    ArchivaDatabaseException e) {
      getLogger().error("String_Node_Str" + e.getMessage(),e);
    }
    try {
      if (!roleManager.templatedRoleExists("String_Node_Str",repoConfig.getId())) {
        roleManager.createTemplatedRole("String_Node_Str",repoConfig.getId());
      }
      if (!roleManager.templatedRoleExists("String_Node_Str",repoConfig.getId()))       ;
{
        roleManager.createTemplatedRole("String_Node_Str",repoConfig.getId());
      }
    }
 catch (    RoleManagerException e) {
      getLogger().error("String_Node_Str" + e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void synchConfiguration(){
  List repos=archivaConfiguration.getConfiguration().getRepositories();
  Iterator it=repos.iterator();
  while (it.hasNext()) {
    RepositoryConfiguration repoConfig=(RepositoryConfiguration)it.next();
    try {
      try {
        ArchivaRepository repository=dao.getRepositoryDAO().getRepository(repoConfig.getId());
        repository.getModel().setName(repoConfig.getName());
        repository.getModel().setUrl(repoConfig.getUrl());
        repository.getModel().setLayoutName(repoConfig.getLayout());
        repository.getModel().setCreationSource("String_Node_Str");
        repository.getModel().setReleasePolicy(repoConfig.isReleases());
        repository.getModel().setSnapshotPolicy(repoConfig.isSnapshots());
        dao.getRepositoryDAO().saveRepository(repository);
      }
 catch (      ObjectNotFoundException e) {
        getLogger().info("String_Node_Str" + repoConfig);
        ArchivaRepository drepo=ArchivaConfigurationAdaptor.toArchivaRepository(repoConfig);
        drepo.getModel().setCreationSource("String_Node_Str");
        dao.getRepositoryDAO().saveRepository(drepo);
      }
    }
 catch (    ArchivaDatabaseException e) {
      getLogger().error("String_Node_Str" + e.getMessage(),e);
    }
    try {
      if (!roleManager.templatedRoleExists("String_Node_Str",repoConfig.getId())) {
        roleManager.createTemplatedRole("String_Node_Str",repoConfig.getId());
      }
      if (!roleManager.templatedRoleExists("String_Node_Str",repoConfig.getId())) {
        roleManager.createTemplatedRole("String_Node_Str",repoConfig.getId());
      }
    }
 catch (    RoleManagerException e) {
      getLogger().error("String_Node_Str" + e.getMessage(),e);
    }
  }
}