Skip to content

Commit 9873e39

Browse files
authored
Merge pull request #5 from DevFactory/release/utility-classes-should-not-have-public-constructors-fix-1
squid:S1118 - Utility classes should not have public constructors
2 parents 9325e76 + 7ae6471 commit 9873e39

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/java/io/github/benas/unixstream/Functions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
*
1111
* @author Mahmoud Ben Hassine ([email protected])
1212
*/
13-
public class Functions {
13+
public final class Functions {
14+
15+
private Functions() throws InstantiationException {
16+
throw new InstantiationException("This class is not created for instantiation");
17+
}
1418

1519
/**
1620
* Compact a string by removing all white spaces.

src/main/java/io/github/benas/unixstream/Predicates.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
*
1010
* @author Mahmoud Ben Hassine ([email protected])
1111
*/
12-
public class Predicates {
12+
public final class Predicates {
13+
14+
private Predicates() throws InstantiationException {
15+
throw new InstantiationException("This class is not created for instantiation");
16+
}
1317

1418
/**
1519
* Create a new predicate returning true when the input is not null.

0 commit comments

Comments
 (0)