diff options
author | rbuj <robert.buj@gmail.com> | 2014-08-09 21:15:11 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-08-10 07:30:22 +0000 |
commit | c77e929c4bfa6e9aee3d6103ef3629a9bcf583ae (patch) | |
tree | fe170cdd5ca19aff1595fb5cd123e7c631f71a25 /javaunohelper | |
parent | Seems to work now (diff) | |
download | core-c77e929c4bfa6e9aee3d6103ef3629a9bcf583ae.tar.gz core-c77e929c4bfa6e9aee3d6103ef3629a9bcf583ae.zip |
javaunohelper: Iterate over each Entry in a Map & Enhanced for-loops
Change-Id: I7abd62e0717bfc9c9b36a431092ddd92ef72684a
Reviewed-on: https://gerrit.libreoffice.org/10852
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/ComponentContext.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java index 30ff8ea71177..6f2d46ab38df 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java @@ -29,7 +29,6 @@ import com.sun.star.lang.XEventListener; import com.sun.star.lang.EventObject; import java.util.Hashtable; -import java.util.Iterator; import java.util.ArrayList; @@ -230,23 +229,20 @@ public class ComponentContext implements XComponentContext, XComponent // fire events EventObject evt = new EventObject( this ); - Iterator<XEventListener> eventListener = m_eventListener.iterator(); - while (eventListener.hasNext()) + for (XEventListener listener : m_eventListener) { - XEventListener listener = eventListener.next(); listener.disposing( evt ); } m_eventListener.clear(); XComponent tdmgr = null; // dispose values, then service manager, then typdescription manager - Iterator<String> keys = m_table.keySet().iterator(); - while (keys.hasNext()) + for (java.util.Map.Entry<String, Object> entry : m_table.entrySet()) { - String name = keys.next(); + String name = entry.getKey(); if (! name.equals( SMGR_NAME )) { - Object o = m_table.get( name ); + Object o = entry.getValue(); if (o instanceof ComponentContextEntry) { o = ((ComponentContextEntry)o).m_value; |