Add assertions on utility classes in IP module
* Add assertions and comment on the utility class. Added assertion on the utility class, so that it can't be mistakenly ever initialized in the class. * Add exception message for RegexUtils * Add exception message "Class Instantiation not allowed." for the TestingUtilities
This commit is contained in:
@@ -43,7 +43,9 @@ public final class RegexUtils {
|
||||
return stringToEscape.replaceAll("([.$\\[\\]^*+{}()\\\\?|])", "\\\\$1");
|
||||
}
|
||||
|
||||
// Non-instantiable utility class
|
||||
private RegexUtils() {
|
||||
throw new AssertionError("Class Instantiation not allowed.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,9 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public final class TestingUtilities {
|
||||
|
||||
// Non-instantiable utility class
|
||||
private TestingUtilities() {
|
||||
throw new AssertionError("Class Instantiation not allowed.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user