title: Why does JDK sourcecode take a `final` copy of `volatile` instances
body: <p>I read the JDK's source code about ConcurrentHashMap.</p>
  
  <p>But the following code confused me:</p>
  
  <pre><code>public boolean isEmpty() {
      final Segment&lt;K,V&gt;[] segments = this.segments;
      ...
  }
  </code></pre>
  
  <p>My question is:</p>
  
  <p>"this.segments" is declared:</p>
  
  <pre><code>final Segment&lt;K,V&gt;[] segments;
  </code></pre>
  
  <p>So, here, in the beginning of the method, declared a same type reference, point to the same memory.</p>
  
  <p>Why did the author write it like this? Why didn't they use this.segments directly? Is there some reason?</p>