Default boolean value is not getting set in JAXB generated class
<p>I am tying to generate class from xsd using JAXB and make use of default values in xsd.
But when I set default value of a xs:boolean element to "true". The value is not set and I get the null-pointer exception as Boolean object value has not been initialized to true.</p>

<pre><code>&lt;xs:element name="statsEnabled" type="xs:boolean" minOccurs="0" default="true"/&gt;
</code></pre>

<p>what wrong am I doing ? Can we set default values only for xs:string and not for xs:boolean ?</p>

<p>The xml file generated is something like this :</p>

<pre><code>public class Cluster {

@XmlElement(defaultValue = "true")
protected Boolean topoEnabled;
@XmlElement(defaultValue = "true")
protected Boolean statsEnabled;

public Boolean isTopoEnabled() {
    return topoEnabled;
}

    public Boolean isStatsEnabled() {
    return statsEnabled;
}

}
</code></pre>

<p>and when I try to invoke the function :</p>

<pre><code>Cluster cluster = new cluster();

if(cluster.isTopoEnabled)
  .....
</code></pre>

<p>or</p>

<pre><code>if(cluster.isStatEnabled)
  ....
</code></pre>

<p>I get the null pointer error. Although in my code I have taken care of this null value.</p>

<p>I am just curious to know as why the default value is not working. Is there something I am doing wrong and what should I do ?
or 
is it that default values only apply on xs:string  elements and not others ?</p>