mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
util classes should be final with a private constructor
This commit is contained in:
@@ -46,7 +46,7 @@ import javax.servlet.ServletContext;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class BootstrapUtil
|
||||
public final class BootstrapUtil
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -56,6 +56,14 @@ public class BootstrapUtil
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(BootstrapUtil.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private BootstrapUtil() {}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -96,7 +104,7 @@ public class BootstrapUtil
|
||||
* @return
|
||||
*/
|
||||
public static <T> T loadClass(ClassLoader classLoader, Class<T> clazz,
|
||||
String className)
|
||||
String className)
|
||||
{
|
||||
T instance = null;
|
||||
|
||||
@@ -164,7 +172,7 @@ public class BootstrapUtil
|
||||
* @param classLoader
|
||||
*/
|
||||
public static void setClassLoader(ServletContext context,
|
||||
ClassLoader classLoader)
|
||||
ClassLoader classLoader)
|
||||
{
|
||||
context.setAttribute(CLASSLOADER, classLoader);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ import javax.xml.bind.Unmarshaller;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class ScmConfigurationUtil
|
||||
public final class ScmConfigurationUtil
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -72,13 +72,13 @@ public class ScmConfigurationUtil
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
public ScmConfigurationUtil()
|
||||
private ScmConfigurationUtil()
|
||||
{
|
||||
try
|
||||
{
|
||||
context = JAXBContext.newInstance(ScmConfiguration.class);
|
||||
file = new File(SCMContext.getContext().getBaseDirectory(),
|
||||
ScmConfiguration.PATH);
|
||||
ScmConfiguration.PATH);
|
||||
}
|
||||
catch (JAXBException ex)
|
||||
{
|
||||
|
||||
@@ -42,12 +42,20 @@ import sonia.scm.SCMContext;
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @deprecated
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public class SecurityUtil
|
||||
public final class SecurityUtil
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*/
|
||||
private SecurityUtil() {}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -57,7 +65,7 @@ public class SecurityUtil
|
||||
* @return
|
||||
*/
|
||||
public static String getUsername(
|
||||
Provider<WebSecurityContext> securityContextProvider)
|
||||
Provider<WebSecurityContext> securityContextProvider)
|
||||
{
|
||||
return getUsername(securityContextProvider.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user