]> WPIA git - gigi.git/commitdiff
Fix: Coverity, boolean compare in template's ifStatement
authorBenny Baumann <BenBE@geshi.org>
Wed, 25 Feb 2015 22:24:13 +0000 (23:24 +0100)
committerFelix Dörre <felix@dogcraft.de>
Wed, 25 Feb 2015 22:24:13 +0000 (23:24 +0100)
src/org/cacert/gigi/output/template/IfStatement.java

index 39a89b80d515d8cfb69f4b3376e7f99973d1c45d..0347a363db8798f3d98356fc68bbdea737c19d1f 100644 (file)
@@ -16,7 +16,7 @@ public final class IfStatement implements Outputable {
     public IfStatement(String variable, TemplateBlock body) {
         this.variable = variable;
         this.iftrue = body;
-        iffalse = null;
+        this.iffalse = null;
     }
 
     public IfStatement(String variable, TemplateBlock iftrue, TemplateBlock iffalse) {
@@ -28,10 +28,12 @@ public final class IfStatement implements Outputable {
     @Override
     public void output(PrintWriter out, Language l, Map<String, Object> vars) {
         Object o = vars.get(variable);
-        if ( !(o == null || o == Boolean.FALSE)) {
+
+        if ( !(o == null || Boolean.FALSE.equals(o))) {
             iftrue.output(out, l, vars);
         } else if (iffalse != null) {
             iffalse.output(out, l, vars);
         }
     }
+
 }