title: Spring ConfigurationProperties validation of a Double value
body: <p>I have a property value that should range between 0 and 1.
  I like Spring's <code>ConfigurationProperties</code> to validate the property value.</p>
  
  <p>So in my <code>ConfigProperties</code> class I added the <code>@Validated</code> annotation and wrote this:</p>
  
  <pre><code>@Min(0)
  @Max(1)
  Double fraction;
  </code></pre>
  
  <p>The strange thing is that the validation works in a manner that looks like <code>flooring / roofing</code> the value from the property file.</p>
  
  <p>This is the outcome of different values I put in the conf file:</p>
  
  <p><code>fraction=-2.1</code>  -> Spring reports an error and stops (good!)</p>
  
  <p><code>fraction=2.1</code>  -> Spring reports an error and stops (good!)</p>
  
  <p><code>fraction=-1.5</code> -> Spring doesn't report an error and starts (not good!)</p>
  
  <p><code>fraction=1.5</code> -> Spring doesn't report an error and starts (not good!)</p>
  
  <p>I also tried using the <code>@Range</code> annotation, but with the same outcomes</p>