title: Using Static String in Groovy Switch-Case Statement
body: <p>I'm a Java programmer who's dabbling in Groovy.  You'll note in my code that I mix in some Java-specific syntax, which is supposedly A-Okay with Groovy.</p>
  
  <p>Can anyone explain to me why Groovy won't accept a static variable as a <code>CASE</code> parameter?  Or if it will, can you see what I'm doing wrong here?</p>
  
  <pre><code>public static final String HIGH_STRING = "high";
  public static final String LOW_STRING  = "low";
  
  ... //other code, method signature, etc.
  
  def val = "high";
  switch (val) {
  
     case HIGH_STRING:
       println("string was high"); //this won't match
       break;
  
     case LOW_STRING:
       println("string was low");  //this won't match
       break;
  
     //case "high":
     //  println("string was high"); //this will match because "high" is a literal
     //  break;
  
     default:
       println("no match");
  }
  
  ... //other code, method closeout, etc.
  </code></pre>