diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-15 14:43:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-16 08:15:48 +0200 |
commit | 973eb2f6db60c0939299a968a3121e3310e6d1f5 (patch) | |
tree | 9eece355c20bc4d930e7e58943fc2d33bedfcfd0 /qadevOOo | |
parent | fa652cdd2314f485359119a8ff081a7afd1c01b0 (diff) |
java: reduce the depth of some deeply nested if blocks
Change-Id: I3c0c7f08d4d8ea594e72fc0d9b93d085d4ab4bf5
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/lib/TestParameters.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/qadevOOo/runner/lib/TestParameters.java b/qadevOOo/runner/lib/TestParameters.java index a62565fcbaf4..69bf9fcd2980 100644 --- a/qadevOOo/runner/lib/TestParameters.java +++ b/qadevOOo/runner/lib/TestParameters.java @@ -76,22 +76,23 @@ public class TestParameters extends HashMap<String,Object> { * @return The value of this key, cast to a boolean type. */ public boolean getBool(Object key) { - Object val = super.get(key); - if (val != null) { - if (val instanceof String) { - String sVal = (String)val; - if (sVal.equalsIgnoreCase("true") || - sVal.equalsIgnoreCase("yes")) { - return true; - } - else if (sVal.equalsIgnoreCase("false") || - sVal.equalsIgnoreCase("no")) { - return false; - } + final Object val = super.get(key); + if (val == null) { + return false; + } + if (val instanceof String) { + String sVal = (String)val; + if (sVal.equalsIgnoreCase("true") || + sVal.equalsIgnoreCase("yes")) { + return true; + } + else if (sVal.equalsIgnoreCase("false") || + sVal.equalsIgnoreCase("no")) { + return false; } - if (val instanceof Boolean) - return ((Boolean)val).booleanValue(); } + else if (val instanceof Boolean) + return ((Boolean)val).booleanValue(); return false; } |