diff options
Diffstat (limited to 'jurt/com/sun/star/comp')
6 files changed, 48 insertions, 49 deletions
diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java index ccb59106d89c..b3d5a4dfb494 100644 --- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java +++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java @@ -20,7 +20,6 @@ package com.sun.star.comp.bridgefactory; import java.math.BigInteger; import java.util.ArrayList; -import java.util.Vector; import com.sun.star.bridge.BridgeExistsException; import com.sun.star.bridge.XBridge; @@ -168,7 +167,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { * @see com.sun.star.bridge.XBridgeFactory */ public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException { - ArrayList vector = new ArrayList(); + ArrayList<XBridge> vector = new ArrayList<XBridge>(); IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { @@ -180,7 +179,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { XBridge xBridges[]= new XBridge[vector.size()]; for(int i = 0; i < vector.size(); ++ i) - xBridges[i] = (XBridge)vector.get(i); + xBridges[i] = vector.get(i); return xBridges; } diff --git a/jurt/com/sun/star/comp/connections/Implementation.java b/jurt/com/sun/star/comp/connections/Implementation.java index 4ff6ee103211..49aba665d6fa 100644 --- a/jurt/com/sun/star/comp/connections/Implementation.java +++ b/jurt/com/sun/star/comp/connections/Implementation.java @@ -52,7 +52,7 @@ final class Implementation { */ public static Object getConnectionService(XMultiServiceFactory factory, String description, - Class serviceClass, + Class<?> serviceClass, String serviceType) throws ConnectionSetupException { diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java index 5353b11e4455..72ce9171a51e 100644 --- a/jurt/com/sun/star/comp/loader/FactoryHelper.java +++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java @@ -56,7 +56,7 @@ public class FactoryHelper { static protected class Factory implements XSingleServiceFactory, XSingleComponentFactory, XServiceInfo, XTypeProvider { - protected static Class __objectArray; + protected static Class<?> __objectArray; static { try { @@ -72,14 +72,14 @@ public class FactoryHelper { protected XMultiServiceFactory _xMultiServiceFactory; protected XRegistryKey _xRegistryKey; protected int _nCode; - protected Constructor _constructor; + protected Constructor<?> _constructor; protected String _implName; protected String _serviceName; // keeps the Id for XTypeProvider protected static Object _mutex= new Object(); private static byte[] _implementationId; - protected Factory(Class implClass, + protected Factory(Class<?> implClass, String serviceName, XMultiServiceFactory xMultiServiceFactory, XRegistryKey xRegistryKey) @@ -89,9 +89,9 @@ public class FactoryHelper { _implName = implClass.getName(); _serviceName = serviceName; - Constructor constructors[] = implClass.getConstructors(); + Constructor<?> constructors[] = implClass.getConstructors(); for(int i = 0; i < constructors.length && _constructor == null; ++i) { - Class parameters[] = constructors[i].getParameterTypes(); + Class<?> parameters[] = constructors[i].getParameterTypes(); if(parameters.length == 3 && parameters[0].equals(XComponentContext.class) @@ -433,7 +433,7 @@ public class FactoryHelper { * @param regKey the given registry key * @see com.sun.star.lang.XServiceInfo */ - static public XSingleServiceFactory getServiceFactory(Class implClass, + static public XSingleServiceFactory getServiceFactory(Class<?> implClass, XMultiServiceFactory multiFactory, XRegistryKey regKey) { @@ -471,7 +471,7 @@ public class FactoryHelper { * @param regKey the given registry key * @see com.sun.star.lang.XServiceInfo */ - static public XSingleServiceFactory getServiceFactory(Class implClass, + static public XSingleServiceFactory getServiceFactory(Class<?> implClass, String serviceName, XMultiServiceFactory multiFactory, XRegistryKey regKey) @@ -484,7 +484,7 @@ public class FactoryHelper { @return returns a factory object @param implClass the implementing class */ - static public Object createComponentFactory( Class implClass, String serviceName ) + static public Object createComponentFactory( Class<?> implClass, String serviceName ) { return new Factory( implClass, serviceName, null, null ); } diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java index e4d97a3f7abb..9ac66d00211b 100644 --- a/jurt/com/sun/star/comp/loader/JavaLoader.java +++ b/jurt/com/sun/star/comp/loader/JavaLoader.java @@ -255,7 +255,7 @@ public class JavaLoader implements XImplementationLoader, locationUrl = expand_url( locationUrl ); Object returnObject = null; - Class clazz ; + Class<?> clazz ; DEBUG("try to get factory for " + implementationName); @@ -299,7 +299,7 @@ public class JavaLoader implements XImplementationLoader, throw cae; } - Class[] paramTypes = {String.class, XMultiServiceFactory.class, XRegistryKey.class}; + Class<?>[] paramTypes = {String.class, XMultiServiceFactory.class, XRegistryKey.class}; Object[] params = { implementationName, multiServiceFactory, xKey }; // try to get factory from implemetation class @@ -339,7 +339,7 @@ public class JavaLoader implements XImplementationLoader, throw new CannotActivateFactoryException( "No factory object for " + implementationName ); } - return (XSingleComponentFactory)ret; + return ret; } else { @@ -350,7 +350,7 @@ public class JavaLoader implements XImplementationLoader, Object oRet = method.invoke(clazz, params); if ( (oRet != null) && (oRet instanceof XSingleServiceFactory) ) { - returnObject = (XSingleServiceFactory) oRet; + returnObject = oRet; } } } @@ -401,14 +401,14 @@ public class JavaLoader implements XImplementationLoader, try { - Class clazz = RegistrationClassFinder.find(locationUrl); + Class<?> clazz = RegistrationClassFinder.find(locationUrl); if (null == clazz) { throw new CannotRegisterImplementationException( "Cannot determine registration class!" ); } - Class[] paramTypes = { XRegistryKey.class }; + Class<?>[] paramTypes = { XRegistryKey.class }; Object[] params = { regKey }; Method method = clazz.getMethod("__writeRegistryServiceInfo", paramTypes); diff --git a/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java b/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java index 6d3490a96be5..aef672457332 100644 --- a/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java +++ b/jurt/com/sun/star/comp/loader/RegistrationClassFinder.java @@ -28,11 +28,11 @@ import java.util.StringTokenizer; import java.util.jar.Attributes; final class RegistrationClassFinder { - public static Class find(String locationUrl) + public static Class<?> find(String locationUrl) throws ClassNotFoundException, IOException { synchronized (map) { - Class c = (Class) WeakMap.getValue(map.get(locationUrl)); + Class<?> c = (Class<?>) WeakMap.getValue(map.get(locationUrl)); if (c != null) { return c; } @@ -52,9 +52,9 @@ final class RegistrationClassFinder { } else { cl2 = URLClassLoader.newInstance(new URL[] { url }, cl1); } - Class c = cl2.loadClass(name); + Class<?> c = cl2.loadClass(name); synchronized (map) { - Class c2 = (Class) WeakMap.getValue(map.get(locationUrl)); + Class<?> c2 = (Class<?>) WeakMap.getValue(map.get(locationUrl)); if (c2 != null) { return c2; } diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java index 643b0cae5dac..673db0468c3c 100644 --- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java +++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java @@ -79,9 +79,9 @@ public class ServiceManager implements XMultiServiceFactory, "com.sun.star.lang.ServiceManager" }; - ArrayList eventListener; - java.util.HashMap factoriesByImplNames; - java.util.HashMap factoriesByServiceNames; // keys: + ArrayList<XEventListener> eventListener; + java.util.HashMap<String, Object> factoriesByImplNames; + java.util.HashMap<String, ArrayList<Object>> factoriesByServiceNames; // keys: private com.sun.star.uno.XComponentContext m_xDefaultContext; @@ -89,18 +89,18 @@ public class ServiceManager implements XMultiServiceFactory, * Creates a new instance of the <code>ServiceManager</code>. */ public ServiceManager() { - eventListener = new ArrayList(); - factoriesByImplNames = new java.util.HashMap(); - factoriesByServiceNames = new java.util.HashMap(); + eventListener = new ArrayList<XEventListener>(); + factoriesByImplNames = new java.util.HashMap<String, Object>(); + factoriesByServiceNames = new java.util.HashMap<String, ArrayList<Object>>(); m_xDefaultContext = null; } /** * Creates a new instance of the <code>ServiceManager</code>. */ public ServiceManager( XComponentContext xContext ) { - eventListener = new ArrayList(); - factoriesByImplNames = new java.util.HashMap(); - factoriesByServiceNames = new java.util.HashMap(); + eventListener = new ArrayList<XEventListener>(); + factoriesByImplNames = new java.util.HashMap<String, Object>(); + factoriesByServiceNames = new java.util.HashMap<String, ArrayList<Object>>(); m_xDefaultContext = xContext; } @@ -172,9 +172,9 @@ public class ServiceManager implements XMultiServiceFactory, try { // try to get the class of the implementation - Class clazz = Class.forName( newImpls[i] ); + Class<?> clazz = Class.forName( newImpls[i] ); - Class[] methodClassParam = { String.class, XMultiServiceFactory.class, XRegistryKey.class }; + Class<?>[] methodClassParam = { String.class, XMultiServiceFactory.class, XRegistryKey.class }; java.lang.reflect.Method getFactoryMeth ; try { getFactoryMeth = clazz.getMethod("__getServiceFactory", methodClassParam); @@ -305,14 +305,14 @@ public class ServiceManager implements XMultiServiceFactory, Object factory = null; if ( factoriesByServiceNames.containsKey( serviceName ) ) { - ArrayList aviableFact = (ArrayList) factoriesByServiceNames.get( serviceName ); + ArrayList<Object> availableFact = factoriesByServiceNames.get( serviceName ); DEBUG(""); - DEBUG("aviable factories for " + serviceName +" "+ aviableFact); + DEBUG("aviable factories for " + serviceName +" "+ availableFact); DEBUG(""); - if ( !aviableFact.isEmpty() ) - factory = aviableFact.get(aviableFact.size()-1); + if ( !availableFact.isEmpty() ) + factory = availableFact.get(availableFact.size()-1); } else // not found in list of services - now try the implementations factory = factoriesByImplNames.get( serviceName ); // return null if none is aviable @@ -341,10 +341,10 @@ public class ServiceManager implements XMultiServiceFactory, int i = 0; String[] availableServiceNames = new String[factoriesByServiceNames.size()]; - java.util.Iterator keys = factoriesByServiceNames.keySet().iterator(); + java.util.Iterator<String> keys = factoriesByServiceNames.keySet().iterator(); while (keys.hasNext()) - availableServiceNames[i++] = (String) keys.next(); + availableServiceNames[i++] = keys.next(); return availableServiceNames; } @@ -444,10 +444,10 @@ public class ServiceManager implements XMultiServiceFactory, throws com.sun.star.uno.RuntimeException { if (eventListener != null) { - java.util.Iterator enumer = eventListener.iterator(); + java.util.Iterator<XEventListener> enumer = eventListener.iterator(); while (enumer.hasNext()) { - XEventListener listener = (XEventListener) enumer.next(); + XEventListener listener = enumer.next(); listener.disposing(new com.sun.star.lang.EventObject(this)); } eventListener.clear(); @@ -552,15 +552,15 @@ public class ServiceManager implements XMultiServiceFactory, String[] serviceNames = xServiceInfo.getSupportedServiceNames(); - ArrayList vec ; + ArrayList<Object> vec ; for (int i=0; i<serviceNames.length; i++) { if ( !factoriesByServiceNames.containsKey( serviceNames[i] ) ) { DEBUG("> no registered services found under " + serviceNames[i] + ": adding..." ); - factoriesByServiceNames.put(serviceNames[i], new ArrayList()); + factoriesByServiceNames.put(serviceNames[i], new ArrayList<Object>()); } - vec = (ArrayList) factoriesByServiceNames.get( serviceNames[i] ); + vec = factoriesByServiceNames.get( serviceNames[i] ); if ( vec.contains( object ) ) System.err.println("The implementation " + xServiceInfo.getImplementationName() + @@ -613,7 +613,7 @@ public class ServiceManager implements XMultiServiceFactory, for ( int i=0; i<serviceNames.length; i++ ) { if ( factoriesByServiceNames.containsKey( serviceNames[i] ) ) { - ArrayList vec = (ArrayList) factoriesByServiceNames.get(serviceNames[i]); + ArrayList<Object> vec = factoriesByServiceNames.get(serviceNames[i]); if ( !vec.remove(object) ) System.err.println("The implementation " + xServiceInfo.getImplementationName() + @@ -675,7 +675,7 @@ public class ServiceManager implements XMultiServiceFactory, { XEnumeration enumer ; - ArrayList serviceList = (ArrayList) factoriesByServiceNames.get(serviceName); + ArrayList<Object> serviceList = factoriesByServiceNames.get(serviceName); if (serviceList != null) enumer = new ServiceEnumerationImpl( serviceList.iterator() ); @@ -737,7 +737,7 @@ public class ServiceManager implements XMultiServiceFactory, * @since UDK1.0 */ class ServiceEnumerationImpl implements XEnumeration { - java.util.Iterator enumeration = null; + java.util.Iterator<Object> enumeration = null; /** * Constructs a new empty instance. @@ -751,7 +751,7 @@ public class ServiceManager implements XMultiServiceFactory, * @param enumer is the enumeration which should been wrapped. * @see com.sun.star.container.XEnumeration */ - public ServiceEnumerationImpl(java.util.Enumeration enumer) { + public ServiceEnumerationImpl(java.util.Enumeration<Object> enumer) { enumeration = Collections.list(enumer).iterator(); } @@ -761,7 +761,7 @@ public class ServiceManager implements XMultiServiceFactory, * @param enumer is the enumeration which should been wrapped. * @see com.sun.star.container.XEnumeration */ - public ServiceEnumerationImpl(java.util.Iterator enumer) { + public ServiceEnumerationImpl(java.util.Iterator<Object> enumer) { enumeration = enumer; } |