Sebastian Sdorra avatar Sebastian Sdorra committed 5bb68a1

util classes should be final with a private constructor

Comments (0)

Files changed (34)

maven/scm-maven-plugin/src/main/java/sonia/scm/maven/Util.java

  *
  * @author Sebastian Sdorra
  */
-public class Util
+public final class Util
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private Util() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-clients/scm-cli-client/src/main/java/sonia/scm/cli/wrapper/WrapperUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class WrapperUtil
+public final class WrapperUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private WrapperUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *
    *
    *
    *
-   * @param baseUrl
    *
    * @param config
    * @param repositories
    * @return
    */
   public static List<RepositoryWrapper> wrapRepositories(ServerConfig config,
-          Collection<Repository> repositories)
+    Collection<Repository> repositories)
   {
     List<RepositoryWrapper> wrappers = new ArrayList<RepositoryWrapper>();
 

scm-clients/scm-client-impl/src/main/java/sonia/scm/client/ClientUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ClientUtil
+public final class ClientUtil
 {
 
   /** the logger for ClientUtil */
   private static final Logger logger =
     LoggerFactory.getLogger(ClientUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private ClientUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-clients/scm-client-impl/src/test/java/sonia/scm/client/it/ClientTestUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ClientTestUtil
+public final class ClientTestUtil
 {
 
   /** Field description */
   /** Field description */
   public static final boolean REQUEST_LOGGING = false;
 
+  private ClientTestUtil()
+  {
+  }
+
+  
+  
+  
   //~--- methods --------------------------------------------------------------
 
   /**

scm-core/src/main/java/sonia/scm/repository/EscapeUtil.java

  * @author Sebastian Sdorra
  * @since 1.15
  */
-public class EscapeUtil
+public final class EscapeUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private EscapeUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-core/src/main/java/sonia/scm/repository/PermissionUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class PermissionUtil
+public final class PermissionUtil
 {
 
   /**
   private static final Logger logger =
     LoggerFactory.getLogger(PermissionUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private PermissionUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    *
    *
    * @param repository
-   * @param securityContextProvider
    * @param pt
    *
    * @since 1.21
    *
    * @param configuration SCM-Manager main configuration
    * @param repository repository to check
-   * @param securityContext current user security context
    *
    * @return true if the repository is writable
    * @since 1.21

scm-core/src/main/java/sonia/scm/repository/RepositoryUtil.java

  * @author Sebastian Sdorra
  * @since 1.11
  */
-public class RepositoryUtil
+public final class RepositoryUtil
 {
 
   /** the logger for RepositoryUtil */
   private static final Logger logger =
     LoggerFactory.getLogger(RepositoryUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private RepositoryUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @since 1.16
    */
   public static void appendUrl(ScmConfiguration configuration,
-                               RepositoryManager repositoryManager,
-                               Repository repository)
+    RepositoryManager repositoryManager, Repository repository)
   {
     RepositoryHandler handler =
       repositoryManager.getHandler(repository.getType());
    * @since 1.16
    */
   public static void appendUrl(HttpServletRequest request,
-                               RepositoryManager repositoryManager,
-                               Repository repository)
+    RepositoryManager repositoryManager, Repository repository)
   {
     RepositoryHandler handler =
       repositoryManager.getHandler(repository.getType());
    * @return
    */
   public static List<File> searchRepositoryDirectories(File directory,
-          String... names)
+    String... names)
   {
     List<File> repositories = new ArrayList<File>();
 
    * @throws IOException
    */
   public static String getRepositoryName(AbstractRepositoryHandler handler,
-          String directoryPath)
-          throws IOException
+    String directoryPath)
+    throws IOException
   {
     return getRepositoryName(handler.getConfig().getRepositoryDirectory(),
-                             new File(directoryPath));
+      new File(directoryPath));
   }
 
   /**
    * @throws IOException
    */
   public static String getRepositoryName(SimpleRepositoryConfig config,
-          String directoryPath)
-          throws IOException
+    String directoryPath)
+    throws IOException
   {
     return getRepositoryName(config.getRepositoryDirectory(),
-                             new File(directoryPath));
+      new File(directoryPath));
   }
 
   /**
    * @throws IOException
    */
   public static String getRepositoryName(AbstractRepositoryHandler handler,
-          File directory)
-          throws IOException
+    File directory)
+    throws IOException
   {
     return getRepositoryName(handler.getConfig().getRepositoryDirectory(),
-                             directory);
+      directory);
   }
 
   /**
    * @throws IOException
    */
   public static String getRepositoryName(SimpleRepositoryConfig config,
-          File directory)
-          throws IOException
+    File directory)
+    throws IOException
   {
     return getRepositoryName(config.getRepositoryDirectory(), directory);
   }
    * @throws IOException
    */
   public static String getRepositoryName(File baseDirectory, File directory)
-          throws IOException
+    throws IOException
   {
     String name = null;
     String path = directory.getCanonicalPath();
    * @throws IOException
    */
   public static List<String> getRepositoryNames(
-          AbstractRepositoryHandler handler, String... directoryNames)
-          throws IOException
+    AbstractRepositoryHandler handler, String... directoryNames)
+    throws IOException
   {
     return getRepositoryNames(handler.getConfig(), directoryNames);
   }
    * @throws IOException
    */
   public static List<String> getRepositoryNames(SimpleRepositoryConfig config,
-          String... directoryNames)
-          throws IOException
+    String... directoryNames)
+    throws IOException
   {
     return getRepositoryNames(config.getRepositoryDirectory(), directoryNames);
   }
    * @throws IOException
    */
   public static List<String> getRepositoryNames(File baseDirectory,
-          String... directoryNames)
-          throws IOException
+    String... directoryNames)
+    throws IOException
   {
     List<String> repositories = new ArrayList<String>();
     List<File> repositoryFiles = searchRepositoryDirectories(baseDirectory,
    * @param names
    */
   private static void searchRepositoryDirectories(List<File> repositories,
-          File directory, List<String> names)
+    File directory, List<String> names)
   {
     boolean found = false;
 

scm-core/src/main/java/sonia/scm/search/SearchUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class SearchUtil
+public final class SearchUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private SearchUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *
    * @return
    */
   public static boolean matchesAll(SearchRequest request, String value,
-                                   String... other)
+    String... other)
   {
     boolean result = false;
     String query = createStringQuery(request);
    * @return
    */
   public static boolean matchesOne(SearchRequest request, String value,
-                                   String... other)
+    String... other)
   {
     boolean result = false;
     String query = createStringQuery(request);
    * @return
    */
   public static <T> Collection<T> search(SearchRequest searchRequest,
-          Collection<T> collection, TransformFilter<T> filter)
+    Collection<T> collection, TransformFilter<T> filter)
   {
     List<T> items = new ArrayList<T>();
     int index = 0;

scm-core/src/main/java/sonia/scm/security/CipherUtil.java

  * @author Sebastian Sdorra
  * @since 1.7
  */
-public class CipherUtil
+public final class CipherUtil
 {
 
   /** Field description */
 
   //~--- constructors ---------------------------------------------------------
 
-  private KeyGenerator keyGenerator;
-  
   /**
    * Constructs ...
    *
     if (cipherHandler == null)
     {
       cipherHandler = new DefaultCipherHandler(SCMContext.getContext(),
-              keyGenerator);
+        keyGenerator);
     }
   }
 
-  public KeyGenerator getKeyGenerator()
-  {
-    return keyGenerator;
-  }
-  
-  
-
   //~--- get methods ----------------------------------------------------------
 
   /**
     return cipherHandler;
   }
 
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  public KeyGenerator getKeyGenerator()
+  {
+    return keyGenerator;
+  }
+
   //~--- fields ---------------------------------------------------------------
 
   /** Field description */
   private CipherHandler cipherHandler;
+
+  /** Field description */
+  private KeyGenerator keyGenerator;
 }

scm-core/src/main/java/sonia/scm/url/UrlUtil.java

  * @author Sebastian Sdorra
  * @since 1.11
  */
-public class UrlUtil
+public final class UrlUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private UrlUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-core/src/main/java/sonia/scm/util/AssertUtil.java

 
 //~--- non-JDK imports --------------------------------------------------------
 
-import sonia.scm.ArgumentIsInvalidException;
 import sonia.scm.Validateable;
 
 //~--- JDK imports ------------------------------------------------------------
  *
  * @author Sebastian Sdorra
  */
-public class AssertUtil
+public final class AssertUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private AssertUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-core/src/main/java/sonia/scm/util/ChecksumUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ChecksumUtil
+public final class ChecksumUtil
 {
 
   /** Field description */
   private static final String DIGEST_TYPE = "SHA-1";
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private ChecksumUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @return
    *
    * @throws IOException
-   * 
+   *
    * @since 1.12
    */
   public static String createChecksum(byte[] content) throws IOException

scm-core/src/main/java/sonia/scm/util/GlobUtil.java

  * @author Sebastian Sdorra
  * @since 1.8
  */
-public class GlobUtil
+public final class GlobUtil
 {
 
+  private GlobUtil()
+  {
+  }
+  
+  
+
   /**
    * Converts the given glob string to a regular expression string.
    *

scm-core/src/main/java/sonia/scm/util/HttpUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class HttpUtil
+public final class HttpUtil
 {
 
   /** authentication realm for basic authentication */
   /** the logger for HttpUtil */
   private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
 
-  /** Field description */
+  /**
+   * Pattern for url normalization
+   * @sincee 1.26
+   */
   private static final Pattern PATTERN_URLNORMALIZE =
     Pattern.compile("(?:(http://[^:]+):80(/.+)?|(https://[^:]+):443(/.+)?)");
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private HttpUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-core/src/main/java/sonia/scm/util/IOUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class IOUtil
+public final class IOUtil
 {
 
   /** Field description */
 
   /** Field description */
   private static final String[] EXTENSION_SCRIPT_UNIX = { ".sh", ".csh",
-          ".bsh" };
+    ".bsh" };
 
   /** Field description */
   private static final String[] EXTENSION_SCRIPT_WINDOWS = { ".bat", ".cmd",
-          ".exe" };
+    ".exe" };
 
   /** Field description */
   private static final Logger logger =
     LoggerFactory.getLogger(IOUtil.class.getName());
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private IOUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @throws IOException
    */
   public static void copy(Reader reader, Writer writer, int bufferSize)
-          throws IOException
+    throws IOException
   {
     char[] buffer = new char[bufferSize];
 
    * @throws IOException
    */
   public static void copy(InputStream in, OutputStream out, int bufferSize)
-          throws IOException
+    throws IOException
   {
     byte[] buffer = new byte[bufferSize];
 
    * @throws IOException
    */
   public static void copy(InputStream in, OutputStream out, int bufferSize,
-                          int byteCount)
-          throws IOException
+    int byteCount)
+    throws IOException
   {
     byte buffer[] = new byte[bufferSize];
     int len = bufferSize;
       while (byteCount > 0)
       {
         int max = (byteCount < bufferSize)
-                  ? (int) byteCount
-                  : bufferSize;
+          ? (int) byteCount
+          : bufferSize;
 
         len = in.read(buffer, 0, max);
 
    * @param bufferSize
    */
   public static void copyThread(InputStream input, OutputStream output,
-                                int bufferSize)
+    int bufferSize)
   {
     new Thread(new IOStreamCopyThread(input, output, bufferSize)).start();
   }
    * @throws IOException
    */
   public static void extract(File archive, File outputDirectory)
-          throws IOException
+    throws IOException
   {
     String name = archive.getName().toLowerCase(Locale.ENGLISH);
 
    * @throws IOException
    */
   public static void extract(File archive, File outputDirectory, String type)
-          throws IOException
+    throws IOException
   {
     if (type.endsWith(ZipUnArchiver.EXTENSION))
     {
     if (!directory.exists() &&!directory.mkdirs())
     {
       throw new IllegalStateException(
-          "could not create directory ".concat(directory.getPath()));
+        "could not create directory ".concat(directory.getPath()));
     }
   }
 
    * @return
    */
   public static List<String> searchAll(String[] path, String cmd,
-          String checkParameter)
+    String checkParameter)
   {
     List<String> cmds = new ArrayList<String>();
 
    * @return
    */
   private static File findFileByExtension(String parentPath, String cmd,
-          List<String> potentialExtensions)
+    List<String> potentialExtensions)
   {
     File file = null;
 
      * @param bufferSize
      */
     public IOStreamCopyThread(InputStream input, OutputStream output,
-                              int bufferSize)
+      int bufferSize)
     {
       this.input = input;
       this.output = output;

scm-core/src/main/java/sonia/scm/util/RegistryUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class RegistryUtil
+public final class RegistryUtil
 {
 
   /** the logger for RegistryUtil */
   private static final Logger logger =
     LoggerFactory.getLogger(RegistryUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private RegistryUtil() {}
+
   //~--- get methods ----------------------------------------------------------
 
   /**
    * @return
    */
   public static String getRegistryValue(String key, String subKey,
-          String defaultValue)
+    String defaultValue)
   {
     String value = defaultValue;
     SimpleCommand command = null;

scm-core/src/main/java/sonia/scm/util/SecurityUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class SecurityUtil
+public final class SecurityUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private SecurityUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-core/src/main/java/sonia/scm/util/ServiceUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ServiceUtil
+public final class ServiceUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private ServiceUtil() {}
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-core/src/main/java/sonia/scm/util/SystemUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class SystemUtil
+public final class SystemUtil
 {
 
   /** Field description */
   /** Field description */
   private static Platform platform =
     new Platform(System.getProperty(PROPERTY_OSNAME),
-                 System.getProperty(PROPERTY_ARCH),
-                 System.getProperty(PROPERTY_OSARCH));
+      System.getProperty(PROPERTY_ARCH), System.getProperty(PROPERTY_OSARCH));
 
   /** Field description */
   private static ServletContainer servletContainer =
     ServletContainerDetector.detect();
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private SystemUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-core/src/main/java/sonia/scm/util/Util.java

  *
  * @author Sebastian Sdorra
  */
-public class Util
+public final class Util
 {
 
   /** Field description */
   /** Field description */
   public static final String EMPTY_STRING = "";
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private Util() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @return
    */
   public static <T> boolean containsOne(Collection<T> collection,
-          Collection<T> other)
+    Collection<T> other)
   {
     boolean result = false;
 
    * @since 1.4
    */
   public static <T> Collection<T> createSubCollection(Collection<T> values,
-          Comparator<T> comparator, int start, int limit)
+    Comparator<T> comparator, int start, int limit)
   {
     return createSubCollection(values, comparator, null, start, limit);
   }
    * @since 1.4
    */
   public static <T> Collection<T> createSubCollection(Collection<T> values,
-          int start, int limit)
+    int start, int limit)
   {
     return createSubCollection(values, null, null, start, limit);
   }
    * @since 1.4
    */
   public static <T> Collection<T> createSubCollection(Collection<T> values,
-          CollectionAppender<T> appender, int start, int limit)
+    CollectionAppender<T> appender, int start, int limit)
   {
     return createSubCollection(values, null, appender, start, limit);
   }
    * @since 1.4
    */
   public static <T> Collection<T> createSubCollection(Collection<T> values,
-          Comparator<T> comparator, CollectionAppender<T> appender, int start,
-          int limit)
+    Comparator<T> comparator, CollectionAppender<T> appender, int start,
+    int limit)
   {
     List<T> result = new ArrayList<T>();
     List<T> valueList = new ArrayList(values);
   public static String nonNull(Object value)
   {
     return (value != null)
-           ? value.toString()
-           : "";
+      ? value.toString()
+      : "";
   }
 
   /**
    * @throws ParseException
    */
   public static Date parseDate(String dateString, TimeZone tz)
-          throws ParseException
+    throws ParseException
   {
     SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN);
 
    * @param start
    *
    * @return
-   * 
+   *
    * @since 1.17
    */
   public static boolean startWithIgnoreCase(String value, String start)
   {
     return (value != null) && (start != null)
-           && value.toUpperCase(Locale.ENGLISH).startsWith(start);
+      && value.toUpperCase(Locale.ENGLISH).startsWith(start);
   }
 
   /**
   public static boolean isEquals(Object object, Object other)
   {
     return (object == null)
-           ? other == null
-           : object.equals(other);
+      ? other == null
+      : object.equals(other);
   }
 
   /**

scm-core/src/main/java/sonia/scm/util/ValidationUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ValidationUtil
+public final class ValidationUtil
 {
 
   /** Field description */
   private static final String REGEX_USERNAME =
     "^[A-z0-9\\.\\-_@]|[^ ]([A-z0-9\\.\\-_@ ]*[A-z0-9\\.\\-_@]|[^ ])?$";
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private ValidationUtil() {}
+
   //~--- get methods ----------------------------------------------------------
 
   /**
    * @return
    */
   public static boolean isNotContaining(String value,
-          String... notAllowedStrings)
+    String... notAllowedStrings)
   {
     boolean result = Util.isNotEmpty(value);
 

scm-core/src/main/java/sonia/scm/util/WebUtil.java

  *
  */
 
+
+
 package sonia.scm.util;
 
 //~--- non-JDK imports --------------------------------------------------------
  * @author Sebastian Sdorra
  * @since 1.15
  */
-public class WebUtil
+public final class WebUtil
 {
 
   /** Field description */
   /** Field description */
   private static final Logger logger = LoggerFactory.getLogger(WebUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private WebUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @param seconds
    */
   public static void addStaticCacheControls(HttpServletResponse response,
-          long seconds)
+    long seconds)
   {
     long time = new Date().getTime();
 
   public static String getETag(File file)
   {
     return new StringBuilder("W/\"").append(file.length()).append(
-        file.lastModified()).append("\"").toString();
+      file.lastModified()).append("\"").toString();
   }
 
   /**
     Date modifiedSince = getIfModifiedSinceDate(request);
 
     if ((modifiedSince != null)
-        && (modifiedSince.getTime() == file.lastModified()))
+      && (modifiedSince.getTime() == file.lastModified()))
     {
       result = false;
     }
       String inmEtag = request.getHeader(HEADER_INM);
 
       if ((inmEtag != null) && (inmEtag.length() > 0)
-          && inmEtag.equals(getETag(file)))
+        && inmEtag.equals(getETag(file)))
       {
         result = false;
       }

scm-dao-orientdb/src/main/java/sonia/scm/orientdb/OrientDBUtil.java

  */
 
 
+
 package sonia.scm.orientdb;
 
 //~--- non-JDK imports --------------------------------------------------------
  *
  * @author Sebastian Sdorra
  */
-public class OrientDBUtil
+public final class OrientDBUtil
 {
 
   /** Field description */
   private static final Logger logger =
     LoggerFactory.getLogger(OrientDBUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private OrientDBUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @return
    */
   public static List<ODocument> executeListResultQuery(
-          ODatabaseDocumentTx connection, String query, Object... parameters)
+    ODatabaseDocumentTx connection, String query, Object... parameters)
   {
     if (logger.isTraceEnabled())
     {
    * @return
    */
   public static ODocument executeSingleResultQuery(
-          ODatabaseDocumentTx connection, String query, Object... parameters)
+    ODatabaseDocumentTx connection, String query, Object... parameters)
   {
     if (logger.isTraceEnabled())
     {
    * @return
    */
   public static <T> List<ODocument> transformToDocuments(
-          Converter<T> converter, List<T> items)
+    Converter<T> converter, List<T> items)
   {
     List<ODocument> docs = null;
 
    * @return
    */
   public static <T> List<T> transformToItems(Converter<T> converter,
-          List<ODocument> docs)
+    List<ODocument> docs)
   {
     List<T> items = null;
 
     if (Util.isNotEmpty(docs))
     {
       items = Lists.transform(docs,
-                              new DocumentConverterFunction<T>(converter));
+        new DocumentConverterFunction<T>(converter));
     }
 
     return items;
    * @author         Enter your name here...
    */
   private static class DocumentConverterFunction<T>
-          implements Function<ODocument, T>
+    implements Function<ODocument, T>
   {
 
     /**
    * @author         Enter your name here...
    */
   private static class ItemConverterFunction<F>
-          implements Function<F, ODocument>
+    implements Function<F, ODocument>
   {
 
     /**

scm-plugin-backend/src/main/java/sonia/scm/plugin/PluginUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class PluginUtil
+public final class PluginUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private PluginUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *

scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class GitUtil
+public final class GitUtil
 {
 
   /** Field description */
   /** the logger for GitUtil */
   private static final Logger logger = LoggerFactory.getLogger(GitUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private GitUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/web/HgUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class HgUtil
+public final class HgUtil
 {
 
   /** Field description */
   public static final String REVISION_TIP = "tip";
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private HgUtil() {}
+
   //~--- get methods ----------------------------------------------------------
 
   /**

scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/HgTestUtil.java

  */
 
 
+
 package sonia.scm.repository;
 
 //~--- non-JDK imports --------------------------------------------------------
  *
  * @author Sebastian Sdorra
  */
-public class HgTestUtil
+public final class HgTestUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private HgTestUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *
    */
   public static void checkForSkip(HgRepositoryHandler handler)
   {
+
     // skip tests if hg not in path
     if (!handler.isConfigured())
     {

scm-plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class SvnUtil
+public final class SvnUtil
 {
 
   /**
    */
   private static final Logger logger = LoggerFactory.getLogger(SvnUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private SvnUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-test/src/main/java/sonia/scm/util/MockUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class MockUtil
+public final class MockUtil
 {
 
   /** Field description */
   private static final User ADMIN = new User("scmadmin", "SCM Admin",
                                       "scmadmin@scm.org");
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private MockUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**

scm-webapp/src/main/java/sonia/scm/boot/BootstrapUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class BootstrapUtil
+public final class BootstrapUtil
 {
 
   /** Field description */
   private static final Logger logger =
     LoggerFactory.getLogger(BootstrapUtil.class);
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private BootstrapUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @return
    */
   public static <T> T loadClass(ClassLoader classLoader, Class<T> clazz,
-                                String className)
+    String className)
   {
     T instance = null;
 
    * @param classLoader
    */
   public static void setClassLoader(ServletContext context,
-                                    ClassLoader classLoader)
+    ClassLoader classLoader)
   {
     context.setAttribute(CLASSLOADER, classLoader);
   }

scm-webapp/src/main/java/sonia/scm/util/ScmConfigurationUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class ScmConfigurationUtil
+public final class ScmConfigurationUtil
 {
 
   /** Field description */
    * Constructs ...
    *
    */
-  public ScmConfigurationUtil()
+  private ScmConfigurationUtil()
   {
     try
     {
       context = JAXBContext.newInstance(ScmConfiguration.class);
       file = new File(SCMContext.getContext().getBaseDirectory(),
-                      ScmConfiguration.PATH);
+        ScmConfiguration.PATH);
     }
     catch (JAXBException ex)
     {

scm-webapp/src/main/java/sonia/scm/web/security/SecurityUtil.java

 /**
  *
  * @author Sebastian Sdorra
- * @deprecated 
+ * @deprecated
  */
 @Deprecated
-public class SecurityUtil
+public final class SecurityUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private SecurityUtil() {}
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
    * Method description
    *
    *
    * @return
    */
   public static String getUsername(
-          Provider<WebSecurityContext> securityContextProvider)
+    Provider<WebSecurityContext> securityContextProvider)
   {
     return getUsername(securityContextProvider.get());
   }

scm-webapp/src/test/java/sonia/scm/it/IntegrationTestUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class IntegrationTestUtil
+public final class IntegrationTestUtil
 {
 
   /** Field description */
   /** Field description */
   public static final String EXTENSION = ".xml";
 
+  //~--- constructors ---------------------------------------------------------
+
+  /**
+   * Constructs ...
+   *
+   */
+  private IntegrationTestUtil() {}
+
   //~--- methods --------------------------------------------------------------
 
   /**
    * @return
    */
   public static ClientResponse authenticate(Client client, String username,
-          String password)
+    String password)
   {
     WebResource wr = createResource(client, "authentication/login");
     MultivaluedMap<String, String> formData = new MultivaluedMapImpl();
     formData.add("password", password);
 
     return wr.type("application/x-www-form-urlencoded").post(
-        ClientResponse.class, formData);
+      ClientResponse.class, formData);
   }
 
   /**
     DefaultApacheHttpClientConfig config = new DefaultApacheHttpClientConfig();
 
     config.getProperties().put(ApacheHttpClientConfig.PROPERTY_HANDLE_COOKIES,
-                               true);
+      true);
 
     return ApacheHttpClient.create(config);
   }
    * @throws RepositoryClientException
    */
   public static void createRandomFile(RepositoryClient client)
-          throws IOException, RepositoryClientException
+    throws IOException, RepositoryClientException
   {
     String uuid = UUID.randomUUID().toString();
     String name = "file-" + uuid + ".uuid";
   public static File createTempDirectory()
   {
     File directory = new File(System.getProperty("java.io.tmpdir"),
-                              UUID.randomUUID().toString());
+                       UUID.randomUUID().toString());
 
     IOUtil.mkdirs(directory);
 

scm-webapp/src/test/java/sonia/scm/it/RepositoryITUtil.java

  *
  * @author Sebastian Sdorra
  */
-public class RepositoryITUtil
+public final class RepositoryITUtil
 {
 
   /**
+   * Constructs ...
+   *
+   */
+  private RepositoryITUtil() {}
+
+  //~--- methods --------------------------------------------------------------
+
+  /**
    * Method description
    *
    *
    * @param other
    */
   public static void assertRepositoriesEquals(Repository repository,
-          Repository other)
+    Repository other)
   {
     assertEquals(repository.getName(), other.getName());
     assertEquals(repository.getDescription(), other.getDescription());
    * @return
    */
   public static Repository createRepository(Client client,
-          Repository repository)
+    Repository repository)
   {
     WebResource wr = createResource(client, "repositories");
     ClientResponse response = wr.post(ClientResponse.class, repository);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.