Cleanup checkstyle warnings and turn enforcement on in yang-data-impl
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / leafref / LeafRefDataValidationFailedException.java
index 3ddb01e5fa842da5775ce5cb791e27bfc7c30f9f..6adf7456a6a0d73b779cae580c699ec5d1227aa3 100644 (file)
@@ -10,20 +10,21 @@ package org.opendaylight.yangtools.yang.data.impl.leafref;
 public class LeafRefDataValidationFailedException extends Exception {
 
     private static final long serialVersionUID = 1L;
-    private int errorsCount = 1;
 
-    public LeafRefDataValidationFailedException(String message) {
-        super(message);
-    }
+    private final int errorsCount;
 
-    public LeafRefDataValidationFailedException(String message, int errorsCount) {
+    public LeafRefDataValidationFailedException(final String message, final int errorsCount) {
         super(message);
         this.errorsCount = errorsCount;
     }
 
-    public LeafRefDataValidationFailedException(String message,
-            final Throwable cause) {
+    public LeafRefDataValidationFailedException(final String message) {
+        this(message, 1);
+    }
+
+    public LeafRefDataValidationFailedException(final String message, final Throwable cause) {
         super(message, cause);
+        errorsCount = 1;
     }
 
     public int getValidationsErrorsCount() {