mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-04-02 02:10:20 +02:00
util classes should be final with a private constructor
This commit is contained in:
@@ -44,7 +44,7 @@ import sonia.scm.util.ServiceUtil;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class SCMContext
|
||||
public final class SCMContext
|
||||
{
|
||||
|
||||
/** Default java package for finding extensions */
|
||||
@@ -53,8 +53,8 @@ public class SCMContext
|
||||
/** Name of the anonymous user */
|
||||
public static final String USER_ANONYMOUS = "anonymous";
|
||||
|
||||
/**
|
||||
* the anonymous user
|
||||
/**
|
||||
* the anonymous user
|
||||
* @since 1.21
|
||||
*/
|
||||
public static final User ANONYMOUS = new User(USER_ANONYMOUS,
|
||||
@@ -64,6 +64,14 @@ public class SCMContext
|
||||
/** Singleton instance of {@link SCMContextProvider} */
|
||||
private static volatile SCMContextProvider provider;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private SCMContext() {}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.net;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -50,7 +51,7 @@ import java.net.URL;
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.23
|
||||
*/
|
||||
public class Proxies
|
||||
public final class Proxies
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -58,6 +59,14 @@ public class Proxies
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(Proxies.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private Proxies() {}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.security;
|
||||
|
||||
/**
|
||||
@@ -45,4 +46,12 @@ public final class Role
|
||||
|
||||
/** Field description */
|
||||
public static final String USER = "user";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private Role() {}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.security;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -51,6 +52,14 @@ import javax.servlet.http.HttpServletRequest;
|
||||
public final class Tokens
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private Tokens() {}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Build an {@link AuthenticationToken} for use with
|
||||
* {@link Subject#login(org.apache.shiro.authc.AuthenticationToken)}.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.template;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -52,7 +53,7 @@ import java.io.Writer;
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.22
|
||||
*/
|
||||
public class Templates
|
||||
public final class Templates
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -60,6 +61,14 @@ public class Templates
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(Templates.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private Templates() {}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ package sonia.scm.url;
|
||||
* @since 1.9
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class UrlProviderFactory
|
||||
public final class UrlProviderFactory
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -55,6 +55,14 @@ public class UrlProviderFactory
|
||||
/** Field description */
|
||||
private static final String EXTENSION_XML = ".xml";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private UrlProviderFactory() {}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,18 +46,26 @@ import java.util.regex.Pattern;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class LinkTextParser
|
||||
public final class LinkTextParser
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final Pattern REGEX_URL =
|
||||
Pattern.compile(
|
||||
"\\(?\\b((?:https?://|ftps?://|mailto:|www[.])[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|])");
|
||||
"\\(?\\b((?:https?://|ftps?://|mailto:|www[.])[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|])");
|
||||
|
||||
/** Field description */
|
||||
private static final String REPLACE_URL =
|
||||
"<a target=\"_blank\" href=\"{1}\">{0}</a>";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private LinkTextParser() {}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -103,12 +111,12 @@ public class LinkTextParser
|
||||
if (token.getReplacement() != null)
|
||||
{
|
||||
buffer.append(MessageFormat.format(REPLACE_URL, token.getValue(),
|
||||
token.getReplacement()));
|
||||
token.getReplacement()));
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.append(token.getValue().replace("<", "<").replace(">",
|
||||
">"));
|
||||
">"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +130,7 @@ public class LinkTextParser
|
||||
*
|
||||
*
|
||||
* @version Enter version here..., 11/11/06
|
||||
* @author Enter your name here...
|
||||
* @author Enter your name here...
|
||||
*/
|
||||
private static class Token
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user