title: Freemarker: an enum in an if statement
body: <p>In my if statement, I want to compare a variable, which is a JDK 1.5 enum, to an enum literal. For example:</p>
  
  <pre><code>&lt;#if type == ProblemStatisticType.BEST_SOLUTION_CHANGED&gt;
    ...
  &lt;/#if&gt;
  </code></pre>
  
  <p>But I get this exception:</p>
  
  <pre><code>freemarker.core.InvalidReferenceException: Expression ProblemStatisticType is undefined on line 430, column 87 in index.html.ftl.
  at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
  at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
  </code></pre>
  
  <p>How can I do that?</p>