File tree Expand file tree Collapse file tree
base/src/main/java/com/tinyengine/it/common/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 * @since 2026-08-17
1919 */
2020public class CheckstyleValidation {
21- private String validationName = "" ;
21+ private String validationName ;
22+
23+ /**
24+ * Creates an empty validation state.
25+ */
26+ public CheckstyleValidation () {
27+ validationName = "" ;
28+ }
2229
2330 /**
2431 * Updates the validation name when the input has text.
2532 *
2633 * @param name the validation name
2734 * @return true if the value is accepted
2835 */
29- public boolean updateValidationName (String name ) {
30- if (name == null ) {
31- return false ;
36+ public boolean updateValidationName (final String name ) {
37+ final String trimmedName = name == null ? "" : name .trim ();
38+ final boolean accepted = !isEmpty (trimmedName );
39+ if (accepted ) {
40+ validationName = trimmedName ;
3241 }
3342
34- String trimmedName = name .trim ();
35- if (trimmedName .isEmpty ()) {
36- return false ;
37- }
43+ return accepted ;
44+ }
3845
39- validationName = trimmedName ;
40- return true ;
46+ private static boolean isEmpty ( final String value ) {
47+ return value . isEmpty () ;
4148 }
4249
4350 /**
You can’t perform that action at this time.
0 commit comments