title: Are there any advantages to using a getter inside the owning class?
body: <p>I have discovered the following in some legacy code:</p>
  
  <pre><code>public class MyClass
  {
      private boolean myBool;
  
      public boolean getMyBool()
      {
          return myBool;
      }
  
      public void otherMethod()
      {
           // some other calculations
           boolean something = this.getMyBool();
           // some other calculations
      }
  }
  </code></pre>
  
  <p>Am I missing something here? Is there an advantage to using <code>getMyBool()</code> and not just calling <code>myBool</code> directly?</p>
  
  <p>Because as I see it, if the behaviour of <code>getMyBool()</code> changes, then this class will betray itself when calling this method.</p>