From 60201fabd3760a1b190bc22586f432699c8054a4 Mon Sep 17 00:00:00 2001 From: Daria Mayorova Date: Tue, 29 Sep 2015 12:45:28 +0200 Subject: [PATCH] Add missing `if (debug)` checks --- src/net/sourceforge/jFuzzyLogic/FunctionBlock.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/sourceforge/jFuzzyLogic/FunctionBlock.java b/src/net/sourceforge/jFuzzyLogic/FunctionBlock.java index d6f4d98..827f73c 100644 --- a/src/net/sourceforge/jFuzzyLogic/FunctionBlock.java +++ b/src/net/sourceforge/jFuzzyLogic/FunctionBlock.java @@ -165,7 +165,7 @@ public class FunctionBlock extends FclObject implements Iterable, Com if (variable == null) { variable = new Variable(varName); setVariable(varName, variable); - Gpr.debug("Variable '" + varName + "' does not exist => Creating it"); + if (debug) Gpr.debug("Variable '" + varName + "' does not exist => Creating it"); } //--- @@ -223,7 +223,7 @@ public class FunctionBlock extends FclObject implements Iterable, Com if (variable == null) { variable = new Variable(varName); setVariable(varName, variable); - Gpr.debug("Variable '" + varName + "' does not exist => Creating it"); + if (debug) Gpr.debug("Variable '" + varName + "' does not exist => Creating it"); } // Explore each sibling in this level @@ -426,7 +426,7 @@ public class FunctionBlock extends FclObject implements Iterable, Com String leaveName = child.getText(); if (leaveName.equalsIgnoreCase("(")) numPoints++; - Gpr.debug("leaveName : " + leaveName + "\tnumPoints: " + numPoints); + if (debug) Gpr.debug("leaveName : " + leaveName + "\tnumPoints: " + numPoints); } // Parse multiple points (for piece-wise linear) @@ -517,7 +517,7 @@ public class FunctionBlock extends FclObject implements Iterable, Com variable.setUniverseMax(max); } - if (varibleExists(variable.getName())) Gpr.debug("Warning: Variable '" + variable.getName() + "' duplicated"); + if (varibleExists(variable.getName())) if (debug) Gpr.debug("Warning: Variable '" + variable.getName() + "' duplicated"); else setVariable(varName, variable); // OK? => Add variable } }