Skip to content

Commit c8a750d

Browse files
committed
Fixing squid:S1118 - Utility classes should not have public constructors
1 parent 3d8c64d commit c8a750d

File tree

7 files changed

+21
-0
lines changed

7 files changed

+21
-0
lines changed

caching/src/main/java/com/iluwatar/caching/AppManager.java

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public class AppManager {
1515

1616
private static CachingPolicy cachingPolicy;
1717

18+
private AppManager() {
19+
}
20+
1821
/**
1922
*
2023
* Developer/Tester is able to choose whether the application should use MongoDB as its underlying

caching/src/main/java/com/iluwatar/caching/CacheStore.java

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class CacheStore {
1111

1212
static LruCache cache = null;
1313

14+
private CacheStore() {
15+
}
16+
1417
/**
1518
* Init cache capacity
1619
*/

caching/src/main/java/com/iluwatar/caching/DbManager.java

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class DbManager {
2929

3030
private static HashMap<String, UserAccount> virtualDB;
3131

32+
private DbManager() {
33+
}
34+
3235
/**
3336
* Create DB
3437
*/

naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
public class SimpleAppSystemInitializer {
2323

24+
private SimpleAppSystemInitializer() {
25+
}
26+
2427
/**
2528
* Init test system
2629
*/

service-layer/src/main/java/com/iluwatar/servicelayer/hibernate/HibernateUtil.java

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public class HibernateUtil {
3232
}
3333
}
3434

35+
private HibernateUtil() {
36+
}
37+
3538
public static SessionFactory getSessionFactory() {
3639
return SESSION_FACTORY;
3740
}

service-locator/src/main/java/com/iluwatar/servicelocator/ServiceLocator.java

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public class ServiceLocator {
1010

1111
private static ServiceCache serviceCache = new ServiceCache();
1212

13+
private ServiceLocator() {
14+
}
15+
1316
/**
1417
* Fetch the service with the name param from the cache first, if no service is found, lookup the
1518
* service from the {@link InitContext} and then add the newly created service into the cache map

tolerant-reader/src/main/java/com/iluwatar/tolerantreader/RainbowFishSerializer.java

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
public class RainbowFishSerializer {
2020

21+
private RainbowFishSerializer() {
22+
}
23+
2124
/**
2225
* Write V1 RainbowFish to file
2326
*/

0 commit comments

Comments
 (0)