title: I can't return the value of an Enum? An exception is thrown, why?
body: <p>I am finding some difficulties work on this class (not written by me),  post only the section of the class that is affected by the problem:</p>
  
  <pre><code>public class Drive {
      .........................
      .........................
      public enum DriveMode {
      None, Stub, Mirror
      };
      .........................
      .........................
  
      public String getModeString() {
          return mode.toString().toLowerCase();
      }
  }
  </code></pre>
  
  <p>The problm is that when, from another class, I try to call the <strong>getModeString()</strong> method it give me an error (throw an exception)</p>
  
  <p>Infact into another class I call:</p>
  
  <pre><code>if(drive.getModeString() != null)
      driveElement.getChild("mode").setText(drive.getModeString());
  </code></pre>
  
  <p>and using the debug I see that it go in error when it call <strong>drive.getModeString()</strong>, then try to execute <strong>return mode.toString().toLowerCase();</strong> but:</p>
  
  <p>1) If, into debugger, I try to evaluate the expression <strong>mode.toString().toLowerCase()</strong> it say to me that: <code>&lt;error(s)_during_the_evaluation&gt;</code> and if I proceed with debugging going to the next step a NullPointerException is thrown</p>
  
  <p>Why? Someone have some ideas about how to solve it?</p>
  
  <p>Tnx
  Andrea</p>