Commits

Sebastian Sdorra committed b713031

remove redundant nullcheck

  • Participants
  • Parent commits 07471b2

Comments (0)

Files changed (1)

File scm-core/src/main/java/sonia/scm/repository/AbstactImportHandler.java

  */
 
 
+
 package sonia.scm.repository;
 
 //~--- non-JDK imports --------------------------------------------------------
    */
   @Override
   public List<String> importRepositories(RepositoryManager manager)
-          throws IOException, RepositoryException
+    throws IOException, RepositoryException
   {
     List<String> imported = new ArrayList<String>();
 
 
       if (repository == null)
       {
-        if (importRepository(manager, repositoryName))
-        {
-          imported.add(repositoryName);
-        }
+        importRepository(manager, repositoryName);
+        imported.add(repositoryName);
       }
       else if (logger.isDebugEnabled())
       {
    * @throws RepositoryException
    */
   protected Repository createRepository(File repositoryDirectory,
-          String repositoryName)
-          throws IOException, RepositoryException
+    String repositoryName)
+    throws IOException, RepositoryException
   {
     Repository repository = new Repository();
 
    * @throws IOException
    * @throws RepositoryException
    */
-  private boolean importRepository(RepositoryManager manager,
-                                   String repositoryName)
-          throws IOException, RepositoryException
+  private void importRepository(RepositoryManager manager,
+    String repositoryName)
+    throws IOException, RepositoryException
   {
-    boolean result = false;
     Repository repository =
       createRepository(getRepositoryDirectory(repositoryName), repositoryName);
 
-    if (repository != null)
+    if (logger.isInfoEnabled())
     {
-      if (logger.isInfoEnabled())
-      {
-        logger.info("import repository {} of type {}", repositoryName,
-                    getTypeName());
-      }
-
-      manager.importRepository(repository);
-      result = true;
-    }
-    else if (logger.isWarnEnabled())
-    {
-      logger.warn("could not create repository object for {}", repositoryName);
+      logger.info("import repository {} of type {}", repositoryName,
+        getTypeName());
     }
 
-    return result;
+    manager.importRepository(repository);
   }
 
   //~--- get methods ----------------------------------------------------------
   private File getRepositoryDirectory(String repositoryName)
   {
     return new File(
-        getRepositoryHandler().getConfig().getRepositoryDirectory(),
-        repositoryName);
+      getRepositoryHandler().getConfig().getRepositoryDirectory(),
+      repositoryName);
   }
 
   /**