diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-11 15:32:10 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-12 08:01:55 +0000 |
commit | 36ff1527c9cb20542d3097d123d221c40a356795 (patch) | |
tree | 52590ce642803a862bc331b3eae2e2b100b8e85f /scripting | |
parent | 1eb31467a5af90fe41dc646dd716bdb7d3e5db45 (diff) |
java: reduce excessive code indentation levels
by using early return in some methods
Change-Id: I3611c8c89b3a94ef7e1772d178acf065fd7fcdc7
Reviewed-on: https://gerrit.libreoffice.org/12374
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java b/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java index 634fa1a7eec8..c187fb0e199c 100644 --- a/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java +++ b/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java @@ -118,7 +118,6 @@ public class DeployedUnoPackagesDB { Element langNode = null; int len = 0; NodeList langNodes = null; - boolean result = false; if ((langNodes = main.getElementsByTagName("language")) != null && (len = langNodes.getLength()) != 0) { @@ -132,22 +131,24 @@ public class DeployedUnoPackagesDB { } } - if (langNode != null) { - len = 0; - NodeList packages = null; + if (langNode == null) { + return false; + } + len = 0; + NodeList packages = null; + boolean result = false; - if ((packages = langNode.getElementsByTagName("package")) != null && - (len = packages.getLength()) != 0) { - for (int i = 0; i < len; i++) { + if ((packages = langNode.getElementsByTagName("package")) != null && + (len = packages.getLength()) != 0) { + for (int i = 0; i < len; i++) { - Element e = (Element)packages.item(i); - String value = e.getAttribute("value"); + Element e = (Element)packages.item(i); + String value = e.getAttribute("value"); - if (value.equals(url)) { - langNode.removeChild(e); - result = true; - break; - } + if (value.equals(url)) { + langNode.removeChild(e); + result = true; + break; } } } |