Skip to content

Commit 35450ee

Browse files
committed
Merge pull request #24 from DevFactory/release/Utility-class-should-not-have-public-const
Fixing squid:S1118 - Utility classes should not have public constructors
2 parents 492a8e7 + 8529175 commit 35450ee

File tree

16 files changed

+107
-3
lines changed

16 files changed

+107
-3
lines changed

src/main/java/org/audit4j/core/Configurations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public class Configurations {
5252
static final String ENVIRONMENT_CONFIG_VARIABLE_NAME = "AUDIT4J_CONF_FILE_PATH";
5353

5454
/**
55-
* Instantiates a new configurations.
55+
*
5656
*/
57-
public Configurations() {
57+
private Configurations() {
5858

5959
}
6060

src/main/java/org/audit4j/core/CoreConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,9 @@ public final class CoreConstants {
147147

148148
/** The Constant ENCODE_UTF8. */
149149
public static final String ENCODE_UTF8 = "UTF-8";
150+
151+
private CoreConstants(){
152+
153+
}
150154

151155
}

src/main/java/org/audit4j/core/ErrorGuide.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ public final class ErrorGuide {
5959

6060
/** The Constant LAYOUT_ERROR. */
6161
public static final String OPTION_ERROR = ERROR_URL + "optionError";
62-
62+
63+
/**
64+
* private constructor to avoid instantiation of this class
65+
*/
66+
private ErrorGuide(){
67+
68+
}
69+
6370
/**
6471
* Gets the guide.
6572
*

src/main/java/org/audit4j/core/TroubleshootManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public final class TroubleshootManager {
3838

3939
/** The Constant MAX_PORT_NUMBER. */
4040
public static final int MAX_PORT_NUMBER = 49151;
41+
42+
/**
43+
* private constructor to avoid instantiation of this class
44+
*/
45+
private TroubleshootManager(){
46+
47+
}
4148

4249
/**
4350
* Troubleshoot event.

src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
*/
3030
public class DeIdentifyUtil {
3131

32+
33+
/**
34+
* private constructor to avoid instantiation of this class
35+
*/
36+
private DeIdentifyUtil(){
37+
38+
}
39+
3240
/**
3341
* Deidentify left.
3442
*

src/main/java/org/audit4j/core/dto/AuditLevel.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@ public class AuditLevel {
2929

3030
/** The Constant DEFAULT_LEVEL. */
3131
public static final String DEFAULT_LEVEL = "default";
32+
33+
/**
34+
* private constructor to avoid instantiation of this class
35+
*/
36+
private AuditLevel(){
37+
38+
}
3239

3340
}

src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
public class ClasspathUrlFinder
1919
{
2020

21+
/**
22+
* private constructor to avoid instantiation of this class
23+
*/
24+
private ClasspathUrlFinder(){
25+
26+
}
27+
2128
/**
2229
* Find the classpath URLs for a specific classpath resource. The classpath URL is extracted
2330
* from loader.getResources() using the baseResource.

src/main/java/org/audit4j/core/extra/scannotation/IteratorFactory.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
public class IteratorFactory {
88
private static final ConcurrentHashMap<String, DirectoryIteratorFactory> registry = new ConcurrentHashMap<String, DirectoryIteratorFactory>();
9+
10+
/**
11+
* private constructor to avoid instantiation of this class
12+
*/
13+
private IteratorFactory(){
14+
15+
}
16+
917
static {
1018
registry.put("file", new FileProtocolIteratorFactory());
1119
}

src/main/java/org/audit4j/core/handler/file/archive/FTPArchiveClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
* @author <a href="mailto:[email protected]">Janith Bandara</a>
3333
*/
3434
public final class FTPArchiveClient {
35+
36+
/**
37+
* private constructor to avoid instantiation of this class
38+
*/
39+
private FTPArchiveClient(){
40+
41+
}
3542

3643
/** The Constant USAGE. */
3744
public static final String USAGE = "Usage: ftp [options] <hostname> <username> <password> [<remote file> [<local file>]]\n"

src/main/java/org/audit4j/core/jmx/JMXUtils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
* @since 2.4.0
1111
*/
1212
public class JMXUtils {
13+
14+
/**
15+
* private constructor to avoid instantiation of this class
16+
*/
17+
private JMXUtils(){
18+
19+
}
1320

1421
/**
1522
* Gets the object name.

0 commit comments

Comments
 (0)