title: Final field is mutable. What is my problem?
body: <p>I'm using mybatis and jackson-databind</p>
  <p>And I tried to calculate some values in constructor of result type dto</p>
  <p>Unfortunately, getter returns original values, not calculated values</p>
  <p>I also tried to using @JsonCreator, @JsonProperty, etc...</p>
  <p>But getter had return original value</p>
  <p>Interestingly, When parameter names of constructor was changed(or sql alias), getter returned calculated value</p>
  <p>I guess jackson or mybatis overrides something(or java reflection problem?)</p>
  <p>How can I solve this problem without change some names?</p>
  <p>This is my query</p>
  <pre><code>    &lt;select id=&quot;getVoteResult&quot; resultType=&quot;VoteResultDto&quot;&gt;
          SELECT SUM(good) AS voteCountOfGood
               , SUM(bad) AS voteCountOfBad
          FROM some.recommend_inf
          WHERE id = #{id};
      &lt;/select&gt;
  </code></pre>
  <p>and result dto</p>
  <pre><code>public final class VoteResultDto {
      private final int voteCountOfGood;
      private final int voteCountOfBad;
  
      public VoteResultDto(float voteCountOfGood, float voteCountOfBad) {
          System.out.println(&quot;float voteCountOfGood: &quot; + voteCountOfGood);
          System.out.println(&quot;float voteCountOfBad: &quot; + voteCountOfBad);
          if (voteCountOfGood &gt; 0 || voteCountOfBad &gt; 0) {
              this.voteCountOfGood = Math.round(voteCountOfGood / (voteCountOfGood + voteCountOfBad) * 100);
              this.voteCountOfBad = 100 - this.voteCountOfGood;
          } else {
              this.voteCountOfGood = this.voteCountOfBad = 0;
          }
          System.out.println(&quot;this.voteCountOfGood: &quot; + this.voteCountOfGood);
          System.out.println(&quot;this.voteCountOfBad: &quot; + this.voteCountOfBad);
      }
  
      public int getVoteCountOfGood() {
          return voteCountOfGood;
      }
  
      public int getVoteCountOfBad() {
          return voteCountOfBad;
      }
  
      @Override
      public String toString() {
          return &quot;toString(): {voteCountOfGood: &quot; + voteCountOfGood + &quot;, voteCountOfBad: &quot; + voteCountOfBad + '}';
      }
  }
  </code></pre>
  <p>and log</p>
  <pre><code>float voteCountOfGood: 8.0
  float voteCountOfBad: 4.0
  this.voteCountOfGood: 67
  this.voteCountOfBad: 33
  toString(): {voteCountOfGood: 8, voteCountOfBad: 4}
  </code></pre>