Why there is a local variable referencing value array in String#hashCode?
<p>What is the purpose of copying <code>value</code> reference into <code>val</code> variable, as oppose to using it directly?</p>

<pre><code>public int hashCode() {
    int h = hash;
    if (h == 0 &amp;&amp; value.length &gt; 0) {
        char val[] = value;    // private final char value[];

        for (int i = 0; i &lt; value.length; i++) {
            h = 31 * h + val[i];
        }
        hash = h;
    }
    return h;
}
</code></pre>