diff options
Diffstat (limited to 'javaunohelper/com/sun/star/comp')
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/Bootstrap.java | 20 | ||||
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/ComponentContext.java | 12 |
2 files changed, 18 insertions, 14 deletions
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java index 7b466b011c52..80daf4b27d0d 100644 --- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java +++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java @@ -38,7 +38,9 @@ import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; +import java.util.HashMap; import java.util.Hashtable; +import java.util.Map; import java.util.Random; /** Bootstrap offers functionality to obtain a context or simply @@ -94,7 +96,7 @@ public class Bootstrap { static public XComponentContext createInitialComponentContext( Hashtable<String, Object> context_entries ) throws Exception { - return createInitialComponentContext((java.util.Map<String,Object>)context_entries); + return createInitialComponentContext((Map<String, Object>) context_entries); } /** Bootstraps an initial component context with service manager and basic jurt components inserted. @@ -102,7 +104,7 @@ public class Bootstrap { context entries (type class ComponentContextEntry). @return a new context. */ - static public XComponentContext createInitialComponentContext( java.util.Map<String, Object> context_entries ) + static public XComponentContext createInitialComponentContext( Map<String, Object> context_entries ) throws Exception { ServiceManager xSMgr = new ServiceManager(); @@ -116,7 +118,7 @@ public class Bootstrap { // initial component context if (context_entries == null) - context_entries = new Hashtable<String,Object>( 1 ); + context_entries = new HashMap<String,Object>( 1 ); // add smgr context_entries.put( "/singletons/com.sun.star.lang.theServiceManager", @@ -143,7 +145,7 @@ public class Bootstrap { static public XMultiServiceFactory createSimpleServiceManager() throws Exception { return UnoRuntime.queryInterface( - XMultiServiceFactory.class, createInitialComponentContext( null ).getServiceManager() ); + XMultiServiceFactory.class, createInitialComponentContext( (Map<String, Object>) null ).getServiceManager() ); } @@ -155,7 +157,7 @@ public class Bootstrap { static public final XComponentContext defaultBootstrap_InitialComponentContext() throws Exception { - return defaultBootstrap_InitialComponentContext( null, null ); + return defaultBootstrap_InitialComponentContext( (String) null, (Map<String,String>) null ); } /** * Backwards compatibility stub. @@ -164,7 +166,7 @@ public class Bootstrap { String ini_file, Hashtable<String,String> bootstrap_parameters ) throws Exception { - return defaultBootstrap_InitialComponentContext(ini_file, (java.util.Map<String,String>)bootstrap_parameters); + return defaultBootstrap_InitialComponentContext(ini_file, (Map<String,String>) bootstrap_parameters); } /** Bootstraps the initial component context from a native UNO installation. @@ -178,7 +180,7 @@ public class Bootstrap { bootstrap parameters (maybe null) */ static public final XComponentContext defaultBootstrap_InitialComponentContext( - String ini_file, java.util.Map<String,String> bootstrap_parameters ) + String ini_file, Map<String,String> bootstrap_parameters ) throws Exception { // jni convenience: easier to iterate over array than calling Hashtable @@ -187,7 +189,7 @@ public class Bootstrap { { pairs = new String [ 2 * bootstrap_parameters.size() ]; int n = 0; - for (java.util.Map.Entry<String, String> bootstrap_parameter : bootstrap_parameters.entrySet()) { + for (Map.Entry<String, String> bootstrap_parameter : bootstrap_parameters.entrySet()) { pairs[ n++ ] = bootstrap_parameter.getKey(); pairs[ n++ ] = bootstrap_parameter.getValue(); } @@ -250,7 +252,7 @@ public class Bootstrap { try { // create default local component context XComponentContext xLocalContext = - createInitialComponentContext( null ); + createInitialComponentContext( (Map<String, Object>) null ); if ( xLocalContext == null ) throw new BootstrapException( "no local component context!" ); diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java index 6f2d46ab38df..563c0a92d412 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java @@ -28,8 +28,10 @@ import com.sun.star.lang.XComponent; import com.sun.star.lang.XEventListener; import com.sun.star.lang.EventObject; -import java.util.Hashtable; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; @@ -57,7 +59,7 @@ public class ComponentContext implements XComponentContext, XComponent private static final String SMGR_NAME = "/singletons/com.sun.star.lang.theServiceManager"; private static final String TDMGR_NAME = "/singletons/com.sun.star.reflection.theTypeDescriptionManager"; - private java.util.Map<String,Object> m_table; + private Map<String,Object> m_table; private XComponentContext m_xDelegate; private XMultiComponentFactory m_xSMgr; @@ -67,7 +69,7 @@ public class ComponentContext implements XComponentContext, XComponent public ComponentContext( Hashtable<String,Object> table, XComponentContext xDelegate ) { - this((java.util.Map<String,Object>)table, xDelegate); + this((Map<String,Object>) table, xDelegate); } /** Ctor to create a component context passing a hashtable for values and a delegator @@ -79,7 +81,7 @@ public class ComponentContext implements XComponentContext, XComponent @param xDelegate if values are not found, request is delegated to this object */ - public ComponentContext( java.util.Map<String,Object> table, XComponentContext xDelegate ) + public ComponentContext( Map<String,Object> table, XComponentContext xDelegate ) { m_eventListener = new ArrayList<XEventListener>(); m_table = table; @@ -237,7 +239,7 @@ public class ComponentContext implements XComponentContext, XComponent XComponent tdmgr = null; // dispose values, then service manager, then typdescription manager - for (java.util.Map.Entry<String, Object> entry : m_table.entrySet()) + for (Map.Entry<String, Object> entry : m_table.entrySet()) { String name = entry.getKey(); if (! name.equals( SMGR_NAME )) |