java.lang.Boolean more than two Instances
<p>I have noticed a really weird behaviour in the Code of the <a href="http://hibersap.sourceforge.net/current/" rel="nofollow">HiberSAP Project</a> (<a href="http://hibersap.svn.sourceforge.net/viewvc/hibersap/tags/hibersap-1.1.0/hibersap-core/src/main/java/org/hibersap/conversion/BooleanConverter.java?revision=449&amp;view=markup" rel="nofollow">BooleanConverter</a> Linenumber 75).</p>

<p>The Problem is that a boolean value is not converted into 'X'. I have debugged the Code and inspected the boolean expression <code>javaValue == Boolean.TRUE</code>. This expression is interpreted as false because javaValue is <code>Boolean.TRUE</code> and has the ID 36 and Boolean.TRUE has the ID 33 (The ID is shown in the Variables-View of the Eclipse IDE). I can also inspect all Instances of Boolean and indeed, there are four Instances of java.lang.Boolean!!</p>

<p>Could somebody please explain me why this is happening.</p>

<hr>

<h2>EDIT:</h2>

<p>Okay, I think my Question isn't precise enough. The field which should be converted is <strong>boolean</strong> and not <strong>java.lang.Boolean</strong>. This must be a Classloader Fault here. In my case the only conversion from boolean to Boolean is done by the JVM. I know every Object comparison should use .equals() (and I fill in a Bug) but in this case it should work as it is. See the following Code:</p>

<pre><code>public static void main(String[] args) {
    for(int i = 0; i &lt; 1000; i++){
        print(true);
    }

}

public static void print(Object value) {
    System.out.println(value);
}
</code></pre>

<p>This should <strong>NOT</strong> create 1000 java.lang.Boolean Instances. This should <strong>always</strong> use java.lang.Boolean.TRUE! And this is the Strange behaviour of the Code that I couldn't understand.</p>

<p>Maybe this are the side effect of the reflection which is done by Hibersap? But I think this should not be a reason for such a behaviour.</p>

<p>Please, I just want to understand.</p>
