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 /jurt/com | |
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 'jurt/com')
-rw-r--r-- | jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java | 25 | ||||
-rw-r--r-- | jurt/com/sun/star/uno/WeakReference.java | 25 |
2 files changed, 25 insertions, 25 deletions
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java index c9473eae9a87..722f825e6ba5 100644 --- a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java +++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java @@ -258,21 +258,22 @@ public class java_remote_bridge final void remRefHolder(Type type, String oid) { synchronized (refHolders) { LinkedList<RefHolder> l = refHolders.get(oid); - if (l != null) { - for (RefHolder rh : l) { - if (rh.getType().equals(type)) { - try { - if (rh.release()) { - l.remove(rh); - if (l.isEmpty()) { - refHolders.remove(oid); - } + if (l == null) { + return; + } + for (RefHolder rh : l) { + if (rh.getType().equals(type)) { + try { + if (rh.release()) { + l.remove(rh); + if (l.isEmpty()) { + refHolders.remove(oid); } - } finally { - release(); } - break; + } finally { + release(); } + break; } } } diff --git a/jurt/com/sun/star/uno/WeakReference.java b/jurt/com/sun/star/uno/WeakReference.java index 261bc1a170a2..81c4cd4facaf 100644 --- a/jurt/com/sun/star/uno/WeakReference.java +++ b/jurt/com/sun/star/uno/WeakReference.java @@ -43,19 +43,18 @@ public class WeakReference */ public WeakReference(WeakReference obj) { - if (obj != null) - { - Object weakImpl= obj.get(); - if (weakImpl != null) - { - XWeak weak= UnoRuntime.queryInterface(XWeak.class, weakImpl); - if (weak != null) - { - XAdapter adapter= weak.queryAdapter(); - if (adapter != null) - m_listener= new OWeakRefListener(adapter); - } - } + if (obj == null) { + return; + } + Object weakImpl = obj.get(); + if (weakImpl == null) { + return; + } + XWeak weak = UnoRuntime.queryInterface(XWeak.class, weakImpl); + if (weak != null) { + XAdapter adapter = weak.queryAdapter(); + if (adapter != null) + m_listener = new OWeakRefListener(adapter); } } |