cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 19 Dec 2022 14:24:15 +0000 (15:24 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 19 Dec 2022 14:24:15 +0000 (15:24 +0100)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/format/AbstractCdmFormatter.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/permission/User.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/annotation/ReferenceCheck.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/constraint/NullOrNotEmptyValidator.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/validation/NameValidCharactersTest.java

index 4ee0521379a35a76e6d5b941035643bd5619d2d3..fc9620ba2a6c98f9c8aa0fc82c59bfebea99933a 100644 (file)
@@ -58,7 +58,6 @@ public abstract class AbstractCdmFormatter implements ICdmFormatter {
         formatKeyMap.put(FormatKey.COMMA, COMMA_CHAR);
     }
 
-
     protected boolean isNotBlank(String str) {
         return StringUtils.isNotBlank(str);
     }
index 3579308f6d0c724ce0d812f9ef81f13981a1698a..3815e21ee0cb17339b557d573a927d92358e4f70 100644 (file)
@@ -75,7 +75,7 @@ import eu.etaxonomy.cdm.validation.annotation.ValidPassword;
 public class User extends CdmBase implements UserDetails {
 
     private static final long serialVersionUID = 6582191171369439163L;
-    private static final Logger logger = LogManager.getLogger(User.class);
+    private static final Logger logger = LogManager.getLogger();
 
     public static final String USERNAME_REGEX = "[A-Za-z0-9_\\.\\-]+";
 
@@ -96,7 +96,6 @@ public class User extends CdmBase implements UserDetails {
     @ValidPassword(groups=Level2.class)
     protected String password;
 
-
     /**
      * The salt for password hashing.
      * @see https://dev.e-taxonomy.eu/redmine/issues/7210
index fc2f7fc78b76654e096295c8ab03b5a812048ad1..7fcebcea7ebb3828fba6b3ea72d799ce9a3e8990 100644 (file)
@@ -1,38 +1,38 @@
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.validation.annotation;\r
-\r
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;\r
-import static java.lang.annotation.ElementType.FIELD;\r
-import static java.lang.annotation.ElementType.METHOD;\r
-import static java.lang.annotation.ElementType.TYPE;\r
-import static java.lang.annotation.RetentionPolicy.RUNTIME;\r
-\r
-import java.lang.annotation.Documented;\r
-import java.lang.annotation.Retention;\r
-import java.lang.annotation.Target;\r
-\r
-import javax.validation.Constraint;\r
-import javax.validation.Payload;\r
-\r
-import eu.etaxonomy.cdm.validation.constraint.ReferenceCheckValidator;\r
-\r
-\r
-@Target( { TYPE, METHOD, FIELD, ANNOTATION_TYPE})\r
-@Retention(RUNTIME)\r
-@Constraint(validatedBy = ReferenceCheckValidator.class)\r
-@Documented\r
-public @interface ReferenceCheck {\r
-\r
-       String message() default "{eu.etaxonomy.cdm.validation.annotation.InReference.ReferenceShouldNotHaveIsbn.message}";\r
-\r
-       Class<? extends Payload>[] payload() default {};\r
-\r
-       Class<?>[] groups() default {};  //Level2.class\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.validation.annotation;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+
+import eu.etaxonomy.cdm.validation.constraint.ReferenceCheckValidator;
+
+
+@Target( { TYPE, METHOD, FIELD, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+@Constraint(validatedBy = ReferenceCheckValidator.class)
+@Documented
+public @interface ReferenceCheck {
+
+       String message() default "{eu.etaxonomy.cdm.validation.annotation.InReference.ReferenceShouldNotHaveIsbn.message}";
+
+       Class<? extends Payload>[] payload() default {};
+
+       Class<?>[] groups() default {};  //Level2.class
 }
index e73fb4422a06a97150315949b7687acd4e371680..b4e9c8b630c20ff2b3e4d3059955cbba257be35a 100644 (file)
@@ -1,33 +1,32 @@
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.validation.constraint;\r
-\r
-import javax.validation.ConstraintValidator;\r
-import javax.validation.ConstraintValidatorContext;\r
-\r
-import eu.etaxonomy.cdm.validation.annotation.NullOrNotEmpty;\r
-\r
-public class NullOrNotEmptyValidator implements ConstraintValidator<NullOrNotEmpty, String> {\r
-\r
-    @Override\r
-    public void initialize(NullOrNotEmpty nullOrNotEmpty) { }\r
-\r
-    @Override\r
-       public boolean isValid(String string, ConstraintValidatorContext constraintContext) {\r
-               boolean isValid = false;\r
-               if(string == null) {\r
-                       isValid = true;\r
-               } else if(string.trim().length() > 0) {\r
-                       isValid =  true;\r
-               }\r
-\r
-               return isValid;\r
-       }\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.validation.constraint;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+import eu.etaxonomy.cdm.validation.annotation.NullOrNotEmpty;
+
+public class NullOrNotEmptyValidator implements ConstraintValidator<NullOrNotEmpty, String> {
+
+    @Override
+    public void initialize(NullOrNotEmpty nullOrNotEmpty) { }
+
+    @Override
+       public boolean isValid(String string, ConstraintValidatorContext constraintContext) {
+               boolean isValid = false;
+               if(string == null) {
+                       isValid = true;
+               } else if(string.trim().length() > 0) {
+                       isValid =  true;
+               }
+
+               return isValid;
+       }
+}
index e4fcbc2a301e480195097e15829fcaeb1983e374..01ee151abaad323857433a1be38757f6f697dbeb 100644 (file)
@@ -68,7 +68,7 @@ public class NameValidCharactersTest extends ValidationTestBase  {
         Set<ConstraintViolation<IBotanicalName>> constraintViolations  = validator.validate(name, Default.class);
         assertTrue("There should not be a constraint violation as this name is valid at the default level",constraintViolations.isEmpty());
 
-        constraintViolations  = validator.validate(name, Default.class,Level2.class);
+        constraintViolations  = validator.validate(name, Default.class, Level2.class);
         assertFalse("There should be a constraint violation as this name is valid at the default level, but contains a letter with a grave and an acute",constraintViolations.isEmpty());
        }