title: What is the best way to handle SonarQube error "javax.validation.constraints.NotNull"
body: <p>Consider the below code. When I analyze the code for sonar rule, it complains about <em>"javax.validation.constraints.NotNull" but is not initialized in this constructor</em>.</p>
  
  <p>I can resolve it by initializing the field with default value ( <a href="https://stackoverflow.com/questions/48351878/object-is-marked-javax-validation-constraints-notnull-but-is-not-initialized-i/51734891#51734891">see example here</a> ) but it will make @NotNull annotation redundant. So my question is how to resolve this problem in best possible way.</p>
  
  <pre><code>public class Dummy {
  
      @NotNull(message = "Dummy field cannot be null")
      private Integer dummyField;
  
      public Dummy(Integer dummyField) {
          this.dummyField = dummyField;
      }
  
      public Integer getDummyField() {
          return dummyField;
      }
  
      public void setDummyField(Integer dummyField) {
          this.dummyField = dummyField;
      }
  }
  </code></pre>