summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-29 10:08:15 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:05 +0200
commitf9fa0dd66b830ff21c4a2dcd201151a4e9ca2de8 (patch)
tree1c1a421028cbef391af4f2886eac2677f75c5ee7
parent531a052bdc1eff3d66fd17ec6f7e9f373cbd1404 (diff)
Java5 updates - update code to use generics
This is all of the code I missed in my first set of patches. Change-Id: I8c7c9e5ac28dc3c2f3ac062c806fbf0787c997bd
-rw-r--r--bean/com/sun/star/beans/LocalOfficeConnection.java8
-rw-r--r--bean/com/sun/star/comp/beans/LocalOfficeConnection.java8
-rw-r--r--filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java40
-rw-r--r--filter/source/xsltvalidate/XSLTValidate.java12
-rw-r--r--javaunohelper/com/sun/star/comp/helper/Bootstrap.java19
-rw-r--r--javaunohelper/com/sun/star/comp/helper/ComponentContext.java33
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/Factory.java2
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java24
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java20
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java102
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java24
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java12
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java18
-rw-r--r--jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java2
-rw-r--r--jurt/test/com/sun/star/lib/uno/protocols/urp/TestBridge.java2
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java1
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java1
-rw-r--r--qadevOOo/tests/java/ifc/io/_XDataInputStream.java1
-rw-r--r--qadevOOo/tests/java/ifc/io/_XDataOutputStream.java1
-rw-r--r--qadevOOo/tests/java/ifc/io/_XOutputStream.java1
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XParameters.java1
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XRow.java1
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java1
-rw-r--r--qadevOOo/tests/java/ifc/system/_XProxySettings.java1
-rw-r--r--qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java1
-rw-r--r--qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java1
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java4
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java4
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java4
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java4
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java4
-rw-r--r--scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java10
-rw-r--r--scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java8
-rw-r--r--scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java4
-rw-r--r--scripting/java/com/sun/star/script/framework/container/ParcelContainer.java22
-rw-r--r--scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java20
-rw-r--r--scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java8
-rw-r--r--scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java7
-rw-r--r--scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java6
-rw-r--r--scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java4
-rw-r--r--scripting/java/com/sun/star/script/framework/io/XStorageHelper.java4
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java19
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java2
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/java/StrictResolver.java2
-rw-r--r--testtools/com/sun/star/comp/bridge/TestComponent.java1
-rw-r--r--unotest/source/java/org/openoffice/test/tools/OfficeDocument.java2
46 files changed, 244 insertions, 232 deletions
diff --git a/bean/com/sun/star/beans/LocalOfficeConnection.java b/bean/com/sun/star/beans/LocalOfficeConnection.java
index 912f5ccc29bc..f999ee432ff2 100644
--- a/bean/com/sun/star/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/beans/LocalOfficeConnection.java
@@ -22,7 +22,7 @@ import java.awt.Container;
import java.io.File;
import java.util.Iterator;
import java.util.List;
-import java.util.Vector;
+import java.util.ArrayList;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XEventListener;
@@ -55,7 +55,7 @@ public class LocalOfficeConnection
private String mProtocol;
private String mInitialObject;
- private List mComponents = new Vector();
+ private List<XEventListener> mComponents = new ArrayList<XEventListener>();
/**
* Constructor.
@@ -169,10 +169,10 @@ public class LocalOfficeConnection
*/
public void dispose()
{
- Iterator itr = mComponents.iterator();
+ Iterator<XEventListener> itr = mComponents.iterator();
while (itr.hasNext()) {
// ignore runtime exceptions in dispose
- try { ((XEventListener)itr.next()).disposing(null); }
+ try { itr.next().disposing(null); }
catch ( RuntimeException aExc ) {}
}
mComponents.clear();
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
index 9c973fbb8249..7ab8d88befc8 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java
@@ -22,7 +22,7 @@ import java.awt.Container;
import java.io.File;
import java.util.Iterator;
import java.util.List;
-import java.util.Vector;
+import java.util.ArrayList;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XComponent;
@@ -64,7 +64,7 @@ public class LocalOfficeConnection
private String mProtocol;
private String mInitialObject;
- private List mComponents = new Vector();
+ private List<XEventListener> mComponents = new ArrayList<XEventListener>();
private static long m_nBridgeCounter = 0;
//-------------------------------------------------------------------------
@@ -243,10 +243,10 @@ public class LocalOfficeConnection
*/
public void dispose()
{
- Iterator itr = mComponents.iterator();
+ Iterator<XEventListener> itr = mComponents.iterator();
while (itr.hasNext() == true) {
// ignore runtime exceptions in dispose
- try { ((XEventListener)itr.next()).disposing(null); }
+ try { itr.next().disposing(null); }
catch ( RuntimeException aExc ) {}
}
mComponents.clear();
diff --git a/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
index 1a6d8cf16d8d..265eed018365 100644
--- a/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
+++ b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
@@ -35,11 +35,13 @@ import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.StringReader;
+import java.lang.ref.WeakReference;
import java.net.URL;
import java.net.URLConnection;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
// Imported TraX classes
import javax.xml.parsers.SAXParserFactory;
@@ -110,9 +112,9 @@ public class XSLTransformer
private String pubtype = new String();
private String systype = new String(); // processing thread
private Thread t; // listeners
- private Vector listeners = new Vector(); //
+ private ArrayList<XStreamListener> listeners = new ArrayList<XStreamListener>(); //
private XMultiServiceFactory svcfactory; // cache for transformations by stylesheet
- private static Hashtable xsltReferences = new Hashtable();
+ private static Map<String,WeakReference<Transformation>> xsltReferences = new HashMap<String,WeakReference<Transformation>>();
// struct for cached stylesheets
private static class Transformation {
@@ -209,7 +211,7 @@ public class XSLTransformer
public void removeListener(XStreamListener aListener) {
if (aListener != null) {
- listeners.removeElement(aListener);
+ listeners.remove(aListener);
}
}
@@ -238,8 +240,8 @@ public class XSLTransformer
// TransformerFactory calls below:
setContextClassLoader(this.getClass().getClassLoader());
- for (Enumeration e = listeners.elements(); e.hasMoreElements();) {
- XStreamListener l = (XStreamListener) e.nextElement();
+ for (Iterator<XStreamListener> e = listeners.iterator(); e.hasNext();) {
+ XStreamListener l = e.next();
l.started();
}
@@ -282,11 +284,11 @@ public class XSLTransformer
}
synchronized (xsltReferences) {
- java.lang.ref.WeakReference ref = null;
+ WeakReference<Transformation> ref = null;
// try to get the xsltTemplate reference from the cache
- if ((ref = (java.lang.ref.WeakReference) xsltReferences.get(stylesheeturl)) == null ||
- (transformation = ((Transformation) ref.get())) == null ||
- ((Transformation) ref.get()).lastmod < lastmod) {
+ if ((ref = xsltReferences.get(stylesheeturl)) == null ||
+ (transformation = ref.get()) == null ||
+ ref.get().lastmod < lastmod) {
// we cannot find a valid reference for this stylesheet
// or the stylsheet was updated
if (ref != null) {
@@ -304,7 +306,7 @@ public class XSLTransformer
transformation = new Transformation();
transformation.lastmod = lastmod;
transformation.cachedXSLT = xsltTemplate;
- ref = new java.lang.ref.WeakReference(transformation);
+ ref = new WeakReference<Transformation>(transformation);
xsltReferences.put(stylesheeturl, ref);
}
}
@@ -344,9 +346,9 @@ public class XSLTransformer
} catch (java.lang.Throwable ex) {
// notify any listeners about close
- for (Enumeration e = listeners.elements(); e.hasMoreElements();) {
+ for (Iterator<XStreamListener> e = listeners.iterator(); e.hasNext();) {
- XStreamListener l = (XStreamListener) e.nextElement();
+ XStreamListener l = e.next();
l.error(new com.sun.star.uno.Exception(ex.getClass().getName() + ": " + ex.getMessage()));
}
if (statsp != null) {
@@ -409,8 +411,8 @@ public class XSLTransformer
os = null;
// notify any listeners about close
if (listeners != null) {
- for (Enumeration e = listeners.elements(); e.hasMoreElements();) {
- XStreamListener l = (XStreamListener) e.nextElement();
+ for (Iterator<XStreamListener> e = listeners.iterator(); e.hasNext();) {
+ XStreamListener l = e.next();
l.closed();
}
}
@@ -432,8 +434,8 @@ public class XSLTransformer
debug("terminate called");
if (t.isAlive()) {
t.interrupt();
- for (Enumeration e = listeners.elements(); e.hasMoreElements();) {
- XStreamListener l = (XStreamListener) e.nextElement();
+ for (Iterator<XStreamListener> e = listeners.iterator(); e.hasNext();) {
+ XStreamListener l = e.next();
l.terminated();
}
}
diff --git a/filter/source/xsltvalidate/XSLTValidate.java b/filter/source/xsltvalidate/XSLTValidate.java
index 73dea7d6dd12..17aeb6a4364b 100644
--- a/filter/source/xsltvalidate/XSLTValidate.java
+++ b/filter/source/xsltvalidate/XSLTValidate.java
@@ -25,8 +25,8 @@ import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.uno.Type;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
import com.sun.star.xml.XImportFilter;
import com.sun.star.xml.XExportFilter;
@@ -50,7 +50,7 @@ import com.sun.star.lib.uno.adapter.*;
public class XSLTValidate {
private static XMultiServiceFactory xMSF;
- private static Vector parseErrors =new Vector();
+ private static ArrayList<String> parseErrors = new ArrayList<String>();
/** This inner class provides the component as a concrete implementation
* of the service description. It implements the needed interfaces.
@@ -124,7 +124,7 @@ public class XSLTValidate {
public void convert (com.sun.star.io.XInputStream xml) throws com.sun.star.uno.RuntimeException {
XInputStreamToInputStreamAdapter xis =new XInputStreamToInputStreamAdapter(xml);
- parseErrors =new Vector();
+ parseErrors = new ArrayList<String>();
//String defaultTimeOut = System.getProperty("sun.net.client.defaultConnectTimeout");
System.getProperties().setProperty("sun.net.client.defaultConnectTimeout", "10000");
try{
@@ -136,8 +136,8 @@ public class XSLTValidate {
dBuilder.parse(xis);
if (parseErrors.size()>0){
String errString ="";
- for (Enumeration e = parseErrors.elements() ; e.hasMoreElements() ;) {
- errString+=e.nextElement();
+ for (Iterator<String> e = parseErrors.iterator() ; e.hasNext() ;) {
+ errString += e.next();
//System.out.println(e.nextElement());
}
throw new com.sun.star.uno.RuntimeException(errString);
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
index 30eb200bd0ce..d5fda64c035e 100644
--- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
+++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
@@ -36,8 +36,9 @@ import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
import java.util.Random;
/** Bootstrap offers functionality to obtain a context or simply
@@ -93,7 +94,7 @@ public class Bootstrap {
context entries (type class ComponentContextEntry).
@return a new context.
*/
- static public XComponentContext createInitialComponentContext( Hashtable context_entries )
+ static public XComponentContext createInitialComponentContext( Map<String,Object> context_entries )
throws Exception
{
XImplementationLoader xImpLoader = UnoRuntime.queryInterface(
@@ -116,7 +117,7 @@ public class Bootstrap {
// initial component context
if (context_entries == null)
- context_entries = new Hashtable( 1 );
+ context_entries = new HashMap<String,Object>( 1 );
// add smgr
context_entries.put(
"/singletons/com.sun.star.lang.theServiceManager",
@@ -171,7 +172,7 @@ public class Bootstrap {
@see "cppuhelper/defaultBootstrap_InitialComponentContext()"
*/
static public final XComponentContext defaultBootstrap_InitialComponentContext(
- String ini_file, Hashtable bootstrap_parameters )
+ String ini_file, Map<String,String> bootstrap_parameters )
throws Exception
{
// jni convenience: easier to iterate over array than calling Hashtable
@@ -179,13 +180,13 @@ public class Bootstrap {
if (null != bootstrap_parameters)
{
pairs = new String [ 2 * bootstrap_parameters.size() ];
- Enumeration keys = bootstrap_parameters.keys();
+ Iterator<String> keys = bootstrap_parameters.keySet().iterator();
int n = 0;
- while (keys.hasMoreElements())
+ while (keys.hasNext())
{
- String name = (String)keys.nextElement();
+ String name = keys.next();
pairs[ n++ ] = name;
- pairs[ n++ ] = (String)bootstrap_parameters.get( name );
+ pairs[ n++ ] = bootstrap_parameters.get( name );
}
}
diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
index 868f1c723c41..0f08c548b8e7 100644
--- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
+++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
@@ -27,9 +27,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.Enumeration;
-import java.util.Vector;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.ArrayList;
//==================================================================================================
@@ -57,13 +58,13 @@ 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 Hashtable m_table;
+ private Map<String,Object> m_table;
private XComponentContext m_xDelegate;
private XMultiComponentFactory m_xSMgr;
private boolean m_bDisposeSMgr;
- private Vector m_eventListener;
+ private ArrayList<XEventListener> m_eventListener;
/** Ctor to create a component context passing a hashtable for values and a delegator
reference. Entries of the passed hashtable are either direct values or
@@ -74,9 +75,9 @@ public class ComponentContext implements XComponentContext, XComponent
@param xDelegate
if values are not found, request is delegated to this object
*/
- public ComponentContext( Hashtable table, XComponentContext xDelegate )
+ public ComponentContext( Map<String,Object> table, XComponentContext xDelegate )
{
- m_eventListener = new Vector();
+ m_eventListener = new ArrayList<XEventListener>();
m_table = table;
m_xDelegate = xDelegate;
m_xSMgr = null;
@@ -219,20 +220,20 @@ public class ComponentContext implements XComponentContext, XComponent
// fire events
EventObject evt = new EventObject( this );
- Enumeration eventListener = m_eventListener.elements();
- while (eventListener.hasMoreElements())
+ Iterator<XEventListener> eventListener = m_eventListener.iterator();
+ while (eventListener.hasNext())
{
- XEventListener listener = (XEventListener)eventListener.nextElement();
+ XEventListener listener = eventListener.next();
listener.disposing( evt );
}
- m_eventListener.removeAllElements();
+ m_eventListener.clear();
XComponent tdmgr = null;
// dispose values, then service manager, then typdescription manager
- Enumeration keys = m_table.keys();
- while (keys.hasMoreElements())
+ Iterator<String> keys = m_table.keySet().iterator();
+ while (keys.hasNext())
{
- String name = (String)keys.nextElement();
+ String name = keys.next();
if (! name.equals( SMGR_NAME ))
{
Object o = m_table.get( name );
@@ -286,7 +287,7 @@ public class ComponentContext implements XComponentContext, XComponent
if (m_eventListener.contains( xListener ))
throw new com.sun.star.uno.RuntimeException( "Listener already registred." );
- m_eventListener.addElement( xListener );
+ m_eventListener.add( xListener );
}
//______________________________________________________________________________________________
public void removeEventListener( XEventListener xListener )
@@ -296,6 +297,6 @@ public class ComponentContext implements XComponentContext, XComponent
if (! m_eventListener.contains( xListener ))
throw new com.sun.star.uno.RuntimeException( "Listener is not registered." );
- m_eventListener.removeElement( xListener );
+ m_eventListener.remove( xListener );
}
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
index fa189f49610f..586498cde844 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java
@@ -118,7 +118,7 @@ public class Factory
//==============================================================================================
private String m_impl_name;
private String [] m_supported_services;
- private Class m_impl_class;
+ private Class<?> m_impl_class;
private java.lang.reflect.Method m_method;
private java.lang.reflect.Constructor m_ctor;
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
index 443a2418eb49..6ebc687bb4b8 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
@@ -26,7 +26,7 @@ import java.util.Iterator;
public class MultiTypeInterfaceContainer
{
- private Map map= new HashMap();
+ private Map<Object,InterfaceContainer> map= new HashMap<Object,InterfaceContainer>();
/** Creates a new instance of MultiTypeInterfaceContainer */
public MultiTypeInterfaceContainer()
@@ -45,13 +45,13 @@ public class MultiTypeInterfaceContainer
if ( (size=map.size()) > 0)
{
Type [] arTypes= new Type[size];
- Iterator it= map.keySet().iterator();
+ Iterator<Object> it= map.keySet().iterator();
int countTypes= 0;
while (it.hasNext())
{
Object key= it.next();
- InterfaceContainer cont= (InterfaceContainer) map.get(key);
+ InterfaceContainer cont= map.get(key);
if (cont != null && cont.size() > 0)
{
if (key == null)
@@ -82,18 +82,18 @@ public class MultiTypeInterfaceContainer
synchronized public InterfaceContainer getContainer(Object key)
{
InterfaceContainer retVal= null;
- Iterator it= map.keySet().iterator();
+ Iterator<Object> it= map.keySet().iterator();
while (it.hasNext())
{
Object obj= it.next();
if (obj == null && key == null)
{
- retVal= (InterfaceContainer) map.get(null);
+ retVal= map.get(null);
break;
}
else if( obj != null && obj.equals(key))
{
- retVal= (InterfaceContainer) map.get(obj);
+ retVal= map.get(obj);
break;
}
}
@@ -109,7 +109,7 @@ public class MultiTypeInterfaceContainer
// Type a= new Type(XInterface.class);
// Type b= new Type(XInterface.class);
// Allthough a != b , the map interprets both as being the same.
- InterfaceContainer cont= (InterfaceContainer) map.get(ckey);
+ InterfaceContainer cont= map.get(ckey);
if (cont != null)
{
cont.add(iface);
@@ -127,7 +127,7 @@ public class MultiTypeInterfaceContainer
synchronized public int removeInterface(Object key, Object iface)
{
int retVal= 0;
- InterfaceContainer cont= (InterfaceContainer) map.get(key);
+ InterfaceContainer cont= map.get(key);
if (cont != null)
{
cont.remove(iface);
@@ -138,19 +138,19 @@ public class MultiTypeInterfaceContainer
public void disposeAndClear(EventObject evt)
{
- Iterator it= null;
+ Iterator<InterfaceContainer> it= null;
synchronized(this)
{
it= map.values().iterator();
}
while (it.hasNext() )
- ((InterfaceContainer) it.next()).disposeAndClear(evt);
+ it.next().disposeAndClear(evt);
}
synchronized public void clear()
{
- Iterator it= map.values().iterator();
+ Iterator<InterfaceContainer> it= map.values().iterator();
while (it.hasNext())
- ((InterfaceContainer) it.next()).clear();
+ it.next().clear();
}
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index 99227a6d06ba..b2571813f34e 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -76,9 +76,9 @@ import com.sun.star.lang.DisposedException;
public class PropertySet extends ComponentBase implements XPropertySet, XFastPropertySet,
XMultiPropertySet
{
- private HashMap _nameToPropertyMap;
- private HashMap _handleToPropertyMap;
- private HashMap _propertyToIdMap;
+ private HashMap<String,Property> _nameToPropertyMap;
+ private HashMap<Integer,Property> _handleToPropertyMap;
+ private HashMap<Property,Object> _propertyToIdMap;
private Property[] arProperties;
private int lastHandle= 1;
@@ -205,7 +205,7 @@ XMultiPropertySet
*/
protected Property getProperty(String propertyName)
{
- return (Property) _nameToPropertyMap.get(propertyName);
+ return _nameToPropertyMap.get(propertyName);
}
/** Returns the Property object with a handle (Property.Handle) as specified by the argument
@@ -217,7 +217,7 @@ XMultiPropertySet
*/
protected Property getPropertyByHandle(int nHandle)
{
- return (Property) _handleToPropertyMap.get(new Integer(nHandle));
+ return _handleToPropertyMap.get(new Integer(nHandle));
}
/** Returns an array of all Property objects or an array of length null if there
@@ -230,8 +230,8 @@ XMultiPropertySet
{
if (arProperties == null)
{
- Collection values= _nameToPropertyMap.values();
- arProperties= (Property[]) values.toArray(new Property[_nameToPropertyMap.size()]);
+ Collection<Property> values= _nameToPropertyMap.values();
+ arProperties= values.toArray(new Property[_nameToPropertyMap.size()]);
}
return arProperties;
}
@@ -290,9 +290,9 @@ XMultiPropertySet
*/
protected void initMappings()
{
- _nameToPropertyMap= new HashMap();
- _handleToPropertyMap= new HashMap();
- _propertyToIdMap= new HashMap();
+ _nameToPropertyMap= new HashMap<String,Property>();
+ _handleToPropertyMap= new HashMap<Integer,Property>();
+ _propertyToIdMap= new HashMap<Property,Object>();
}
/** Makes sure that listeners which are kept in aBoundLC (XPropertyChangeListener) and aVetoableLC
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
index 26aaa8cdb0fe..950840cb0d1c 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
@@ -144,12 +144,11 @@ public final class PropertySetMixin {
"unexpected com.sun.star.container.NoSuchElementException: "
+ e.getMessage());
}
- HashMap map = new HashMap();
- ArrayList handleNames = new ArrayList();
- initProperties(ifc, map, handleNames, new HashSet());
+ HashMap<String,PropertyData> map = new HashMap<String,PropertyData>();
+ ArrayList<String> handleNames = new ArrayList<String>();
+ initProperties(ifc, map, handleNames, new HashSet<String>());
properties = map;
- handleMap = (String[]) handleNames.toArray(
- new String[handleNames.size()]);
+ handleMap = handleNames.toArray(new String[handleNames.size()]);
}
/**
@@ -202,38 +201,39 @@ public final class PropertySetMixin {
{@link BoundListeners#notifyListeners} has not yet been called); may only
be null if the attribute that is going to be set is not bound
*/
+ @SuppressWarnings("unchecked")
public void prepareSet(
String propertyName, Object oldValue, Object newValue,
BoundListeners bound)
throws PropertyVetoException
{
// assert properties.get(propertyName) != null;
- Property p = ((PropertyData) properties.get(propertyName)).property;
- Vector specificVeto = null;
- Vector unspecificVeto = null;
+ Property p = properties.get(propertyName).property;
+ ArrayList<XVetoableChangeListener> specificVeto = null;
+ ArrayList<XVetoableChangeListener> unspecificVeto = null;
synchronized (this) {
if (disposed) {
throw new DisposedException("disposed", object);
}
if ((p.Attributes & PropertyAttribute.CONSTRAINED) != 0) {
- Object o = vetoListeners.get(propertyName);
+ ArrayList<XVetoableChangeListener> o = vetoListeners.get(propertyName);
if (o != null) {
- specificVeto = (Vector) ((Vector) o).clone();
+ specificVeto = (ArrayList<XVetoableChangeListener>) o.clone();
}
o = vetoListeners.get("");
if (o != null) {
- unspecificVeto = (Vector) ((Vector) o).clone();
+ unspecificVeto = (ArrayList<XVetoableChangeListener>) o.clone();
}
}
if ((p.Attributes & PropertyAttribute.BOUND) != 0) {
// assert bound != null;
- Object o = boundListeners.get(propertyName);
+ ArrayList<XPropertyChangeListener> o = boundListeners.get(propertyName);
if (o != null) {
- bound.specificListeners = (Vector) ((Vector) o).clone();
+ bound.specificListeners = (ArrayList<XPropertyChangeListener>) o.clone();
}
o = boundListeners.get("");
if (o != null) {
- bound.unspecificListeners = (Vector) ((Vector) o).clone();
+ bound.unspecificListeners = (ArrayList<XPropertyChangeListener>) o.clone();
}
}
}
@@ -241,18 +241,16 @@ public final class PropertySetMixin {
PropertyChangeEvent event = new PropertyChangeEvent(
object, propertyName, false, p.Handle, oldValue, newValue);
if (specificVeto != null) {
- for (Iterator i = specificVeto.iterator(); i.hasNext();) {
+ for (Iterator<XVetoableChangeListener> i = specificVeto.iterator(); i.hasNext();) {
try {
- ((XVetoableChangeListener) i.next()).vetoableChange(
- event);
+ i.next().vetoableChange(event);
} catch (DisposedException e) {}
}
}
if (unspecificVeto != null) {
- for (Iterator i = unspecificVeto.iterator(); i.hasNext();) {
+ for (Iterator<XVetoableChangeListener> i = unspecificVeto.iterator(); i.hasNext();) {
try {
- ((XVetoableChangeListener) i.next()).vetoableChange(
- event);
+ i.next().vetoableChange(event);
} catch (DisposedException e) {}
}
}
@@ -298,8 +296,8 @@ public final class PropertySetMixin {
ignored.</p>
*/
public void dispose() {
- HashMap bound;
- HashMap veto;
+ HashMap<String,ArrayList<XPropertyChangeListener>> bound;
+ HashMap<String,ArrayList<XVetoableChangeListener>> veto;
synchronized (this) {
bound = boundListeners;
boundListeners = null;
@@ -309,18 +307,18 @@ public final class PropertySetMixin {
}
EventObject event = new EventObject(object);
if (bound != null) {
- for (Iterator i = bound.values().iterator(); i.hasNext();) {
- for (Iterator j = ((Vector) i.next()).iterator(); j.hasNext();)
+ for (Iterator<ArrayList<XPropertyChangeListener>> i = bound.values().iterator(); i.hasNext();) {
+ for (Iterator<XPropertyChangeListener> j = i.next().iterator(); j.hasNext();)
{
- ((XPropertyChangeListener) j.next()).disposing(event);
+ j.next().disposing(event);
}
}
}
if (veto != null) {
- for (Iterator i = veto.values().iterator(); i.hasNext();) {
- for (Iterator j = ((Vector) i.next()).iterator(); j.hasNext();)
+ for (Iterator<ArrayList<XVetoableChangeListener>> i = veto.values().iterator(); i.hasNext();) {
+ for (Iterator<XVetoableChangeListener> j = i.next().iterator(); j.hasNext();)
{
- ((XVetoableChangeListener) j.next()).disposing(event);
+ j.next().disposing(event);
}
}
}
@@ -370,9 +368,9 @@ public final class PropertySetMixin {
synchronized (this) {
disp = disposed;
if (!disp) {
- Vector v = (Vector) boundListeners.get(propertyName);
+ ArrayList<XPropertyChangeListener> v = boundListeners.get(propertyName);
if (v == null) {
- v = new Vector();
+ v = new ArrayList<XPropertyChangeListener>();
boundListeners.put(propertyName, v);
}
v.add(listener);
@@ -395,7 +393,7 @@ public final class PropertySetMixin {
checkUnknown(propertyName);
synchronized (this) {
if (boundListeners != null) {
- Vector v = (Vector) boundListeners.get(propertyName);
+ ArrayList<XPropertyChangeListener> v = boundListeners.get(propertyName);
if (v != null) {
v.remove(listener);
}
@@ -420,9 +418,9 @@ public final class PropertySetMixin {
synchronized (this) {
disp = disposed;
if (!disp) {
- Vector v = (Vector) vetoListeners.get(propertyName);
+ ArrayList<XVetoableChangeListener> v = vetoListeners.get(propertyName);
if (v == null) {
- v = new Vector();
+ v = new ArrayList<XVetoableChangeListener>();
vetoListeners.put(propertyName, v);
}
v.add(listener);
@@ -445,7 +443,7 @@ public final class PropertySetMixin {
checkUnknown(propertyName);
synchronized (this) {
if (vetoListeners != null) {
- Vector v = (Vector) vetoListeners.get(propertyName);
+ ArrayList<XVetoableChangeListener> v = vetoListeners.get(propertyName);
if (v != null) {
v.remove(listener);
}
@@ -547,26 +545,24 @@ public final class PropertySetMixin {
*/
public void notifyListeners() {
if (specificListeners != null) {
- for (Iterator i = specificListeners.iterator(); i.hasNext();) {
+ for (Iterator<XPropertyChangeListener> i = specificListeners.iterator(); i.hasNext();) {
try {
- ((XPropertyChangeListener) i.next()).propertyChange(
- event);
+ i.next().propertyChange(event);
} catch (DisposedException e) {}
}
}
if (unspecificListeners != null) {
- for (Iterator i = unspecificListeners.iterator(); i.hasNext();)
+ for (Iterator<XPropertyChangeListener> i = unspecificListeners.iterator(); i.hasNext();)
{
try {
- ((XPropertyChangeListener) i.next()).propertyChange(
- event);
+ i.next().propertyChange(event);
} catch (DisposedException e) {}
}
}
}
- private Vector specificListeners = null;
- private Vector unspecificListeners = null;
+ private ArrayList<XPropertyChangeListener> specificListeners = null;
+ private ArrayList<XPropertyChangeListener> unspecificListeners = null;
private PropertyChangeEvent event = null;
}
@@ -595,7 +591,7 @@ public final class PropertySetMixin {
}
private void initProperties(
- XTypeDescription type, HashMap map, ArrayList handleNames, HashSet seen)
+ XTypeDescription type, HashMap<String,PropertyData> map, ArrayList<String> handleNames, HashSet<String> seen)
{
XInterfaceTypeDescription2 ifc = UnoRuntime.queryInterface(
XInterfaceTypeDescription2.class, resolveTypedefs(type));
@@ -1039,19 +1035,19 @@ public final class PropertySetMixin {
private final class Info extends WeakBase implements XPropertySetInfo
{
- public Info(Map properties) {
+ public Info(Map<String,PropertyData> properties) {
this.properties = properties;
}
public Property[] getProperties() {
- ArrayList al = new ArrayList(properties.size());
- for (Iterator i = properties.values().iterator(); i.hasNext();) {
- PropertyData p = (PropertyData) i.next();
+ ArrayList<Property> al = new ArrayList<Property>(properties.size());
+ for (Iterator<PropertyData> i = properties.values().iterator(); i.hasNext();) {
+ PropertyData p = i.next();
if (p.present) {
al.add(p.property);
}
}
- return (Property[]) al.toArray(new Property[al.size()]);
+ return al.toArray(new Property[al.size()]);
}
public Property getPropertyByName(String name)
@@ -1065,7 +1061,7 @@ public final class PropertySetMixin {
return p != null && p.present;
}
- private final Map properties; // from String to Property
+ private final Map<String,PropertyData> properties;
}
private final XComponentContext context;
@@ -1073,12 +1069,14 @@ public final class PropertySetMixin {
private final Type type;
private final String[] absentOptional;
private final XIdlClass idlClass;
- private final Map properties; // from String to Property
+ private final Map<String,PropertyData> properties; // from String to Property
private final String[] handleMap;
- private HashMap boundListeners = new HashMap();
+ private HashMap<String,ArrayList<XPropertyChangeListener>> boundListeners
+ = new HashMap<String,ArrayList<XPropertyChangeListener>>();
// from String to Vector of XPropertyChangeListener
- private HashMap vetoListeners = new HashMap();
+ private HashMap<String,ArrayList<XVetoableChangeListener>> vetoListeners
+ = new HashMap<String,ArrayList<XVetoableChangeListener>>();
// from String to Vector of XVetoableChangeListener
private boolean disposed = false;
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
index 4205fb1091f8..844d9e30f579 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
@@ -19,7 +19,7 @@
package com.sun.star.lib.uno.helper;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
-import java.util.Vector;
+import java.util.ArrayList;
/**
* Object representation and parsing of Uno Urls,
@@ -66,13 +66,13 @@ public class UnoUrl {
static private class UnoUrlPart {
private String partTypeName;
- private HashMap partParameters;
+ private HashMap<String,String> partParameters;
private String uninterpretedParameterString;
public UnoUrlPart(
String uninterpretedParameterString,
String partTypeName,
- HashMap partParameters) {
+ HashMap<String,String> partParameters) {
this.uninterpretedParameterString = uninterpretedParameterString;
this.partTypeName = partTypeName;
this.partParameters = partParameters;
@@ -82,7 +82,7 @@ public class UnoUrl {
return partTypeName;
}
- public HashMap getPartParameters() {
+ public HashMap<String,String> getPartParameters() {
return partParameters;
}
@@ -146,7 +146,7 @@ public class UnoUrl {
*
* @return a HashMap with key/value pairs for protocol parameters.
*/
- public HashMap getProtocolParameters() {
+ public HashMap<String,String> getProtocolParameters() {
return protocol.getPartParameters();
}
@@ -157,7 +157,7 @@ public class UnoUrl {
*
* @return a HashMap with key/value pairs for connection parameters.
*/
- public HashMap getConnectionParameters() {
+ public HashMap<String,String> getConnectionParameters() {
return connection.getPartParameters();
}
@@ -220,7 +220,7 @@ public class UnoUrl {
private static String decodeUTF8(String s)
throws com.sun.star.lang.IllegalArgumentException {
- Vector v = new Vector();
+ ArrayList<Integer> v = new ArrayList<Integer>();
for (int i = 0; i < s.length(); i++) {
int ch = s.charAt(i);
@@ -231,13 +231,13 @@ public class UnoUrl {
ch = (hb << 4) | lb;
}
- v.addElement(new Integer(ch));
+ v.add(new Integer(ch));
}
int size = v.size();
byte[] bytes = new byte[size];
for (int i = 0; i < size; i++) {
- Integer anInt = (Integer) v.elementAt(i);
+ Integer anInt = v.get(i);
bytes[i] = (byte) (anInt.intValue() & 0xFF);
}
@@ -249,9 +249,9 @@ public class UnoUrl {
}
}
- private static HashMap buildParamHashMap(String paramString)
+ private static HashMap<String,String> buildParamHashMap(String paramString)
throws com.sun.star.lang.IllegalArgumentException {
- HashMap params = new HashMap();
+ HashMap<String,String> params = new HashMap<String,String>();
int pos = 0;
@@ -313,7 +313,7 @@ public class UnoUrl {
+ "' may only consist of alpha numeric ASCII characters.");
}
- HashMap params = buildParamHashMap(theParamPart);
+ HashMap<String,String> params = buildParamHashMap(theParamPart);
return new UnoUrlPart(theParamPart, partName, params);
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java b/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
index 2df7820a5943..46ba04d368cb 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/WeakAdapter.java
@@ -34,17 +34,17 @@ public class WeakAdapter implements XAdapter
{
private final boolean DEBUG= false;
// references the XWeak implementation
- private WeakReference m_weakRef;
+ private WeakReference<Object> m_weakRef;
// contains XReference objects registered by addReference
- private List m_xreferenceList;
+ private List<XReference> m_xreferenceList;
/**
*@param component the object that is to be held weak
*/
public WeakAdapter(Object component)
{
- m_weakRef= new WeakReference(component);
- m_xreferenceList= Collections.synchronizedList( new LinkedList());
+ m_weakRef= new WeakReference<Object>(component);
+ m_xreferenceList= Collections.synchronizedList( new LinkedList<XReference>());
}
/** Called by the XWeak implementation (WeakBase) when it is being finalized.
@@ -59,10 +59,10 @@ public class WeakAdapter implements XAdapter
void referentDying()
{
//synchronized call
- Object[] references= m_xreferenceList.toArray();
+ XReference[] references= m_xreferenceList.toArray(new XReference[m_xreferenceList.size()]);
for (int i= references.length; i > 0; i--)
{
- ((XReference) references[i-1]).dispose();
+ references[i-1].dispose();
}
}
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
index 829eb02d0f29..409773860be7 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/WeakBase.java
@@ -21,9 +21,9 @@ import com.sun.star.uno.XWeak;
import com.sun.star.uno.XAdapter;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.uno.Type;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.Map;
-import java.util.Hashtable;
+import java.util.HashMap;
/** This class can be used as the base class for UNO components. It implements the capability
@@ -38,8 +38,8 @@ public class WeakBase implements XWeak, XTypeProvider
// They have to be notified when this object dies
private WeakAdapter m_adapter;
- protected static Map _mapImplementationIds= new Hashtable();
- protected static Map _mapTypes= new Hashtable();
+ protected static Map<Class<?>,byte[]> _mapImplementationIds = new HashMap<Class<?>,byte[]>();
+ protected static Map<Class<?>,Type[]> _mapTypes = new HashMap<Class<?>,Type[]>();
/** Method of XWeak. The returned XAdapter implementation can be used to keap
* a weak reference to this object.
@@ -69,10 +69,10 @@ public class WeakBase implements XWeak, XTypeProvider
*/
public Type[] getTypes()
{
- Type[] arTypes= (Type[]) _mapTypes.get( getClass());
+ Type[] arTypes= _mapTypes.get( getClass());
if (arTypes == null)
{
- Vector vec= new Vector();
+ ArrayList<Type> vec= new ArrayList<Type>();
Class currentClass= getClass();
do
{
@@ -87,9 +87,7 @@ public class WeakBase implements XWeak, XTypeProvider
currentClass= currentClass.getSuperclass();
} while (currentClass != null);
- Type types[]= new Type[vec.size()];
- for( int i= 0; i < types.length; i++)
- types[i]= (Type) vec.elementAt(i);
+ Type types[]= vec.toArray(new Type[vec.size()]);
_mapTypes.put(getClass(), types);
arTypes= types;
}
@@ -107,7 +105,7 @@ public class WeakBase implements XWeak, XTypeProvider
byte[] id= null;
synchronized (_mapImplementationIds)
{
- id= (byte[]) _mapImplementationIds.get(getClass());
+ id= _mapImplementationIds.get(getClass());
if (id == null)
{
diff --git a/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java b/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
index 6b619b5b3b73..d92e368622c0 100644
--- a/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
@@ -302,6 +302,6 @@ public final class Protocol_Test {
}
private final IProtocol protocol;
- private final LinkedList queue = new LinkedList();
+ private final LinkedList<Object> queue = new LinkedList<Object>();
}
}
diff --git a/jurt/test/com/sun/star/lib/uno/protocols/urp/TestBridge.java b/jurt/test/com/sun/star/lib/uno/protocols/urp/TestBridge.java
index 9a2ae19184fd..88f6aeefea00 100644
--- a/jurt/test/com/sun/star/lib/uno/protocols/urp/TestBridge.java
+++ b/jurt/test/com/sun/star/lib/uno/protocols/urp/TestBridge.java
@@ -30,7 +30,7 @@ import com.sun.star.uno.Type;
class TestBridge implements IBridge {
static public final boolean DEBUG = false;
- HashMap _hashtable = new HashMap();
+ final HashMap<String,Object> _hashtable = new HashMap<String,Object>();
IEnvironment _source ;//= new com.sun.star.lib.uno.environments.java.java_environment(null);
diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java
index 6ee8c0c611c9..2ba20762d538 100644
--- a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java
+++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java
@@ -62,6 +62,7 @@ public class _XFastPropertySet extends MultiMethodTest {
/**
* Retrieves relation.
*/
+ @SuppressWarnings("unchecked")
protected void before() {
exclude = (Set<String>) tEnv.getObjRelation("XFastPropertySet.ExcludeProps") ;
if (exclude == null) {
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
index 128e5e255fc0..e6eee001a116 100644
--- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
@@ -77,6 +77,7 @@ public class _XMultiPropertySet extends MultiMethodTest {
/**
* Initializes some fields.
*/
+ @SuppressWarnings("unchecked")
public void before() {
exclProps = (Set<String>) tEnv.getObjRelation("XMultiPropertySet.ExcludeProps");
if (exclProps == null) exclProps = new HashSet<String>(0);
diff --git a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java
index 2671b4baf620..e912334252eb 100644
--- a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java
+++ b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java
@@ -76,6 +76,7 @@ public class _XDataInputStream extends MultiMethodTest {
* data of different types and fills the appropriate variables.
* @throws StatusException If one of relations not found.
*/
+ @SuppressWarnings("unchecked")
public void before(){
XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter") ;
diff --git a/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java
index 90d049cbd05f..c66c8bea3da5 100644
--- a/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java
+++ b/qadevOOo/tests/java/ifc/io/_XDataOutputStream.java
@@ -56,6 +56,7 @@ public class _XDataOutputStream extends MultiMethodTest {
* If relation or data of some type in stream not found then
* tests of corresponding methods are skipped.
*/
+ @SuppressWarnings("unchecked")
public void before() throws RuntimeException {
List<Object> data = (List<Object>) tEnv.getObjRelation("StreamData") ;
diff --git a/qadevOOo/tests/java/ifc/io/_XOutputStream.java b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
index 8e53c67def0b..9945437a6f7c 100644
--- a/qadevOOo/tests/java/ifc/io/_XOutputStream.java
+++ b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
@@ -56,6 +56,7 @@ public class _XOutputStream extends MultiMethodTest {
public void resetStreams();
}
+ @SuppressWarnings("unchecked")
protected void before() {
checker = (StreamChecker)
tEnv.getObjRelation("XOutputStream.StreamChecker");
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XParameters.java b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java
index e9d9774c0688..fd3dd2bafcb2 100644
--- a/qadevOOo/tests/java/ifc/sdbc/_XParameters.java
+++ b/qadevOOo/tests/java/ifc/sdbc/_XParameters.java
@@ -100,6 +100,7 @@ public class _XParameters extends MultiMethodTest {
/**
* Gets object relation
*/
+ @SuppressWarnings("unchecked")
public void before() {
data = (List<Object>) tEnv.getObjRelation("XParameters.ParamValues") ;
if (data == null) {
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRow.java b/qadevOOo/tests/java/ifc/sdbc/_XRow.java
index a707bbe34cb2..c92f23af064a 100644
--- a/qadevOOo/tests/java/ifc/sdbc/_XRow.java
+++ b/qadevOOo/tests/java/ifc/sdbc/_XRow.java
@@ -101,6 +101,7 @@ public class _XRow extends MultiMethodTest {
/**
* Retrieves object relation first.
*/
+ @SuppressWarnings("unchecked")
public void before() {
data = (List<Object>) tEnv.getObjRelation("CurrentRowData") ;
}
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java
index 53cd93d9fa5b..0ae50bd300bc 100644
--- a/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java
+++ b/qadevOOo/tests/java/ifc/sdbc/_XRowUpdate.java
@@ -99,6 +99,7 @@ public class _XRowUpdate extends MultiMethodTest {
/**
* Gets relations.
*/
+ @SuppressWarnings("unchecked")
public void before() {
rowData = (List<Object>) tEnv.getObjRelation("CurrentRowData") ;
if (rowData == null) {
diff --git a/qadevOOo/tests/java/ifc/system/_XProxySettings.java b/qadevOOo/tests/java/ifc/system/_XProxySettings.java
index 06b18d1a2269..b11e10282a97 100644
--- a/qadevOOo/tests/java/ifc/system/_XProxySettings.java
+++ b/qadevOOo/tests/java/ifc/system/_XProxySettings.java
@@ -67,6 +67,7 @@ public class _XProxySettings extends MultiMethodTest {
*
* @see #expectedProxies
*/
+ @SuppressWarnings("unchecked")
public void before() {
expectedProxies = (Map<String,String>)tEnv.getObjRelation(
"XProxySettings.proxySettings");
diff --git a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
index 3ca7861c0db0..3d81a16cecba 100644
--- a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
+++ b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
@@ -55,6 +55,7 @@ public class _XMultiSelectionSupplier extends MultiMethodTest {
Object[] selections = null;
Comparator<Object> ObjCompare = null;
+ @SuppressWarnings("unchecked")
protected void before() {
selections = (Object[])tEnv.getObjRelation("Selections");
if (selections == null) {
diff --git a/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java
index 37fce51db73d..40f1b55c4a8d 100644
--- a/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java
+++ b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java
@@ -53,6 +53,7 @@ public class _XSelectionSupplier extends MultiMethodTest {
Object[] selections = null;
Comparator<Object> ObjCompare = null;
+ @SuppressWarnings("unchecked")
protected void before() {
selections = (Object[])tEnv.getObjRelation("Selections");
if (selections == null) {
diff --git a/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java
index c54f7a0068f2..34de36f1b952 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/DataInputStream.java
@@ -27,7 +27,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -128,7 +128,7 @@ public class DataInputStream extends TestCase {
xDataSink.setInputStream(xPipeInput) ;
// all data types for writing to an XDataInputStream
- Vector data = new Vector() ;
+ ArrayList<Object> data = new ArrayList<Object>() ;
data.add(new Boolean(true)) ;
data.add(new Byte((byte)123)) ;
data.add(new Character((char)1234)) ;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java
index 1ac01fba0f18..177ce4bd0001 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/DataOutputStream.java
@@ -26,7 +26,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -102,7 +102,7 @@ public class DataOutputStream extends TestCase {
xDataSource.setOutputStream(xPipeOutput);
// all data types for writing to an XDataInputStream
- Vector data = new Vector() ;
+ ArrayList<Object> data = new ArrayList<Object>() ;
data.add(new Boolean(true)) ;
data.add(new Byte((byte)123)) ;
data.add(new Character((char)1234)) ;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
index 98d1efcff355..dd3666207da0 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
@@ -26,7 +26,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -127,7 +127,7 @@ public class MarkableOutputStream extends TestCase {
oObj = (XInterface) mostream;
// all data types for writing to an XDataInputStream
- Vector data = new Vector() ;
+ ArrayList<Object> data = new ArrayList<Object>() ;
data.add(new Boolean(true)) ;
data.add(new Byte((byte)123)) ;
data.add(new Character((char)1234)) ;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java
index de3dac06889b..576076f87f2f 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/ObjectInputStream.java
@@ -32,7 +32,7 @@ import com.sun.star.registry.XSimpleRegistry;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -247,7 +247,7 @@ public class ObjectInputStream extends TestCase {
// all data types for writing to an XDataInputStream
- Vector data = new Vector() ;
+ ArrayList<Object> data = new ArrayList<Object>() ;
data.add(new Boolean(true)) ;
data.add(new Byte((byte)123)) ;
data.add(new Character((char)1234)) ;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java
index e07dcfce4e1d..f30870ec2d24 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/ObjectOutputStream.java
@@ -32,7 +32,7 @@ import com.sun.star.registry.XSimpleRegistry;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
-import java.util.Vector;
+import java.util.ArrayList;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
@@ -237,7 +237,7 @@ public class ObjectOutputStream extends TestCase {
oObj = oStream;
// all data types for writing to an XDataInputStream
- Vector data = new Vector() ;
+ ArrayList<Object> data = new ArrayList<Object>() ;
data.add(new Boolean(true)) ;
data.add(new Byte((byte)123)) ;
data.add(new Character((char)1234)) ;
diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
index c4593276d76d..cb87c0b24731 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
@@ -55,7 +55,7 @@ public class ParcelBrowseNode extends PropertySet
{
private ScriptProvider provider;
//private RootBrowseNode parent;
- private Collection browsenodes;
+ private Collection<XBrowseNode> browsenodes;
private String name;
private ParcelContainer container;
private Parcel parcel;
@@ -134,7 +134,7 @@ public class ParcelBrowseNode extends PropertySet
if ( hasChildNodes() )
{
String[] names = parcel.getElementNames();
- browsenodes = new ArrayList( names.length );
+ browsenodes = new ArrayList<XBrowseNode>( names.length );
for ( int index = 0; index < names.length; index++ )
{
@@ -153,7 +153,7 @@ public class ParcelBrowseNode extends PropertySet
LogUtils.DEBUG( LogUtils.getTrace( e ) );
return new XBrowseNode[0];
}
- return (XBrowseNode[])browsenodes.toArray(new XBrowseNode[0]);
+ return browsenodes.toArray(new XBrowseNode[browsenodes.size()]);
}
public boolean hasChildNodes() {
@@ -245,7 +245,7 @@ public class ParcelBrowseNode extends PropertySet
if(browsenodes==null)
{
LogUtils.DEBUG("browsenodes null!!");
- browsenodes = new ArrayList(4);
+ browsenodes = new ArrayList<XBrowseNode>(4);
}
browsenodes.add(sbn);
@@ -319,7 +319,7 @@ public class ParcelBrowseNode extends PropertySet
{
getChildNodes();
}
- ScriptBrowseNode[] childNodes = (ScriptBrowseNode[])browsenodes.toArray(new ScriptBrowseNode[0]);
+ ScriptBrowseNode[] childNodes = browsenodes.toArray(new ScriptBrowseNode[browsenodes.size()]);
for ( int index = 0; index < childNodes.length; index++ )
{
diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
index 3756920e580f..881496dd7b0c 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java
@@ -47,7 +47,7 @@ public class ProviderBrowseNode extends PropertySet
implements XBrowseNode, XInvocation
{
protected ScriptProvider provider;
- protected Collection browsenodes;
+ protected Collection<XBrowseNode> browsenodes;
protected String name;
protected ParcelContainer container;
protected Parcel parcel;
@@ -105,7 +105,7 @@ public class ProviderBrowseNode extends PropertySet
// needs initialisation?
LogUtils.DEBUG("** ProviderBrowseNode.getChildNodes(), container is " + container );
String[] parcels = container.getElementNames();
- browsenodes = new ArrayList( parcels.length );
+ browsenodes = new ArrayList<XBrowseNode>( parcels.length );
for ( int index = 0; index < parcels.length; index++ )
{
try
@@ -133,7 +133,7 @@ public class ProviderBrowseNode extends PropertySet
LogUtils.DEBUG("*** No container available");
return new XBrowseNode[0];
}
- return ( XBrowseNode[] )browsenodes.toArray( new XBrowseNode[0] );
+ return browsenodes.toArray( new XBrowseNode[browsenodes.size()] );
}
public boolean hasChildNodes() {
@@ -231,7 +231,7 @@ public class ProviderBrowseNode extends PropertySet
LogUtils.DEBUG("created parcel node ");
if ( browsenodes == null )
{
- browsenodes = new ArrayList( 5 );
+ browsenodes = new ArrayList<XBrowseNode>( 5 );
}
browsenodes.add(parcel);
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 3ce059c652c6..9a9cb5eb4ef2 100644
--- a/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java
+++ b/scripting/java/com/sun/star/script/framework/container/DeployedUnoPackagesDB.java
@@ -70,7 +70,7 @@ public class DeployedUnoPackagesDB {
public String[] getDeployedPackages( String language )
{
- ArrayList packageUrls = new ArrayList(4);
+ ArrayList<String> packageUrls = new ArrayList<String>(4);
Element main = document.getDocumentElement();
Element root = null;
Element item;
@@ -108,7 +108,7 @@ public class DeployedUnoPackagesDB {
}
if ( !packageUrls.isEmpty() )
{
- return (String[])packageUrls.toArray( new String[0] );
+ return packageUrls.toArray( new String[packageUrls.size()] );
}
return new String[0];
}
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
index 90a31711ae4d..ff4678f7a97f 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
@@ -50,11 +50,11 @@ public class ParcelContainer implements XNameAccess
{
protected String language;
protected String containerUrl;
- protected Collection parcels = new ArrayList(10);
+ protected Collection<Parcel> parcels = new ArrayList<Parcel>(10);
static protected XSimpleFileAccess m_xSFA;
protected XComponentContext m_xCtx;
private ParcelContainer parent = null;
- private Collection childContainers = new ArrayList(10);;
+ private Collection<ParcelContainer> childContainers = new ArrayList<ParcelContainer>(10);
private boolean isPkgContainer = false;
/**
@@ -102,7 +102,7 @@ public class ParcelContainer implements XNameAccess
{
return new ParcelContainer[0];
}
- return (ParcelContainer[]) childContainers.toArray( new ParcelContainer[0] );
+ return childContainers.toArray( new ParcelContainer[childContainers.size()] );
}
/**
@@ -141,10 +141,10 @@ public class ParcelContainer implements XNameAccess
public ParcelContainer getChildContainer( String key )
{
ParcelContainer result = null;
- Iterator iter = childContainers.iterator();
+ Iterator<ParcelContainer> iter = childContainers.iterator();
while ( iter.hasNext() )
{
- ParcelContainer c = (ParcelContainer) iter.next();
+ ParcelContainer c = iter.next();
String location = ScriptMetaData.getLocationPlaceHolder(
c.containerUrl, c.getName());
@@ -171,10 +171,10 @@ public class ParcelContainer implements XNameAccess
public ParcelContainer getChildContainerForURL( String containerUrl )
{
ParcelContainer result = null;
- Iterator iter = childContainers.iterator();
+ Iterator<ParcelContainer> iter = childContainers.iterator();
while ( iter.hasNext() )
{
- ParcelContainer c = (ParcelContainer) iter.next();
+ ParcelContainer c = iter.next();
if ( containerUrl.equals( c.containerUrl ) )
{
result = c;
@@ -327,10 +327,10 @@ public class ParcelContainer implements XNameAccess
{
if ( hasElements() )
{
- Iterator iter = parcels.iterator();
+ Iterator<Parcel> iter = parcels.iterator();
while ( iter.hasNext() )
{
- Parcel parcelToCheck = (Parcel)iter.next();
+ Parcel parcelToCheck = iter.next();
if ( parcelToCheck.getName().equals( aName ) )
{
@@ -354,7 +354,7 @@ public class ParcelContainer implements XNameAccess
{
if ( hasElements() )
{
- Parcel[] theParcels = (Parcel[])parcels.toArray( new Parcel[0] );
+ Parcel[] theParcels = parcels.toArray( new Parcel[parcels.size()] );
String[] names = new String[ theParcels.length ];
for ( int count = 0; count < names.length; count++ )
{
@@ -404,7 +404,7 @@ public class ParcelContainer implements XNameAccess
{
LogUtils.DEBUG( getParcelContainerDir() + " is a folder " );
String[] children = m_xSFA.getFolderContents( getParcelContainerDir(), true );
- parcels = new ArrayList(children.length);
+ parcels = new ArrayList<Parcel>(children.length);
for ( int i = 0; i < children.length; i++)
{
LogUtils.DEBUG("Processing " + children[ i ] );
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
index 36edde14e86c..55c5c2fdd3a1 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java
@@ -46,7 +46,7 @@ public class ParcelDescriptor {
PARCEL_DESCRIPTOR_NAME = "parcel-descriptor.xml";
// Collection of all ParcelDescriptor created for files
- private static final Map PARCEL_DESCRIPTOR_MAP = new HashMap(5);
+ private static final Map<File,ParcelDescriptor> PARCEL_DESCRIPTOR_MAP = new HashMap<File,ParcelDescriptor>(5);
// This is the default contents of a parcel descriptor to be used when
// creating empty descriptors
@@ -58,7 +58,7 @@ public class ParcelDescriptor {
private File file = null;
private Document document = null;
private String language = null;
- private Map languagedepprops = new Hashtable(3);
+ private Map<String,String> languagedepprops = new Hashtable<String,String>(3);
public static synchronized void removeParcelDescriptor(File parent) {
File path = new File(parent, PARCEL_DESCRIPTOR_NAME);
@@ -67,7 +67,7 @@ public class ParcelDescriptor {
public static synchronized void renameParcelDescriptor(File oldFile, File newFile) {
File oldPath = new File(oldFile, PARCEL_DESCRIPTOR_NAME);
- ParcelDescriptor pd = (ParcelDescriptor)PARCEL_DESCRIPTOR_MAP.get(oldPath);
+ ParcelDescriptor pd = PARCEL_DESCRIPTOR_MAP.get(oldPath);
if(pd != null) {
PARCEL_DESCRIPTOR_MAP.remove(oldPath);
File newPath = new File(newFile, PARCEL_DESCRIPTOR_NAME);
@@ -82,7 +82,7 @@ public class ParcelDescriptor {
getParcelDescriptor(File parent) {
File path = new File(parent, PARCEL_DESCRIPTOR_NAME);
- ParcelDescriptor pd = (ParcelDescriptor)PARCEL_DESCRIPTOR_MAP.get(path);
+ ParcelDescriptor pd = PARCEL_DESCRIPTOR_MAP.get(path);
if (pd == null && path.exists()) {
try {
@@ -214,7 +214,7 @@ public class ParcelDescriptor {
}
public ScriptEntry[] getScriptEntries() {
- ArrayList scripts = new ArrayList();
+ ArrayList<ScriptEntry> scripts = new ArrayList<ScriptEntry>();
NodeList scriptNodes;
int len;
@@ -225,7 +225,7 @@ public class ParcelDescriptor {
for (int i = 0; i < len; i++) {
String language, languagename, logicalname, description = "";
- Map langProps = new HashMap();
+ Map<String,String> langProps = new HashMap<String,String>();
NodeList nl;
Element tmp;
@@ -285,7 +285,7 @@ public class ParcelDescriptor {
ScriptEntry entry = new ScriptEntry(language, languagename, logicalname, "",langProps, description);
scripts.add(entry);
}
- return (ScriptEntry[])scripts.toArray(new ScriptEntry[0]);
+ return scripts.toArray(new ScriptEntry[scripts.size()]);
}
public void setScriptEntries(ScriptEntry[] scripts) {
@@ -301,7 +301,7 @@ public class ParcelDescriptor {
}
public String getLanguageProperty(String name) {
- return (String)languagedepprops.get(name);
+ return languagedepprops.get(name);
}
public void setLanguageProperty(String name, String value) {
@@ -424,12 +424,12 @@ public class ParcelDescriptor {
String key;
item = document.createElement("languagedepprops");
- Iterator iter = languagedepprops.keySet().iterator();
+ Iterator<String> iter = languagedepprops.keySet().iterator();
while (iter.hasNext()) {
tempitem = document.createElement("prop");
key = (String)iter.next();
tempitem.setAttribute("name", key);
- tempitem.setAttribute("value", (String)languagedepprops.get(key));
+ tempitem.setAttribute("value", languagedepprops.get(key));
item.appendChild(tempitem);
}
root.appendChild(item);
diff --git a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
index e35abe671302..e0051aeaf87c 100644
--- a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
+++ b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
@@ -22,7 +22,7 @@ import java.net.URL;
import java.io.ByteArrayInputStream;
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.InputStream;
@@ -250,7 +250,7 @@ public class ScriptMetaData extends ScriptEntry implements Cloneable {
try
{
String classpath = (String)getLanguageProperties().get("classpath");
- Vector paths = null;
+ ArrayList paths = null;
if ( classpath == null )
{
@@ -267,7 +267,7 @@ public class ScriptMetaData extends ScriptEntry implements Cloneable {
// replace \ with /
parcelPath = parcelPath.replace( '\\', '/' );
- Vector classPathVec = new Vector();
+ ArrayList<URL> classPathVec = new ArrayList<URL>();
StringTokenizer stk = new StringTokenizer(classpath, ":");
while ( stk.hasMoreElements() )
{
@@ -289,7 +289,7 @@ public class ScriptMetaData extends ScriptEntry implements Cloneable {
}
}
- return (URL[])classPathVec.toArray( new URL[0]);
+ return classPathVec.toArray( new URL[classPathVec.size()]);
}
catch ( Exception e )
{
diff --git a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
index b08797819c69..b4389eec9b0d 100644
--- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java
@@ -40,7 +40,7 @@ import com.sun.star.deployment.ExtensionRemovedException;
public class UnoPkgContainer extends ParcelContainer
{
- private Map registeredPackages = new HashMap();
+ private Map<String,ParcelContainer> registeredPackages = new HashMap<String,ParcelContainer>();
protected String extensionDb;
protected String extensionRepository;
@@ -64,7 +64,7 @@ public class UnoPkgContainer extends ParcelContainer
LogUtils.DEBUG("** getRegisterPackage ctx = " + containerUrl );
LogUtils.DEBUG("** getRegisterPackage for uri " + url );
LogUtils.DEBUG("** getRegisterPackage for langugage " + language );
- ParcelContainer result = (ParcelContainer)registeredPackages.get( url );
+ ParcelContainer result = registeredPackages.get( url );
LogUtils.DEBUG("getRegisterPackage result is " + result );
return result;
}
@@ -110,8 +110,7 @@ public class UnoPkgContainer extends ParcelContainer
if ( db.removePackage( language, url ) )
{
writeUnoPackageDB( db );
- ParcelContainer container =
- ( ParcelContainer ) registeredPackages.get( url );
+ ParcelContainer container = registeredPackages.get( url );
if ( !container.hasElements() )
{
// When all libraries within a package bundle
diff --git a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java
index 0afe85cb45e8..69d94eb252c3 100644
--- a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java
+++ b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java
@@ -90,7 +90,7 @@ public class XMLParserFactory {
}
public void write(Document doc, OutputStream out) throws IOException {
- Class clazz = doc.getClass();
+ Class<?> clazz = doc.getClass();
String name = clazz.getName();
// depending on the class of the Document object use introspection
@@ -111,8 +111,8 @@ public class XMLParserFactory {
// try xerces serialize package using introspection
ClassLoader cl = this.getClass().getClassLoader();
- Class serializerClass = null;
- Class formatterClass = null;
+ Class<?> serializerClass = null;
+ Class<?> formatterClass = null;
try {
serializerClass = Class.forName(
diff --git a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
index 16c866431404..78f74d40e215 100644
--- a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
+++ b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
@@ -41,7 +41,7 @@ public class UCBStreamHandler extends URLStreamHandler {
private XComponentContext m_xContext = null;
private XMultiComponentFactory m_xMultiComponentFactory = null;
private XSimpleFileAccess m_xSimpleFileAccess = null;
- private HashMap m_jarStreamMap = new HashMap(12);
+ private HashMap<String,InputStream> m_jarStreamMap = new HashMap<String,InputStream>(12);
public static String m_ucbscheme;
public UCBStreamHandler( XComponentContext ctxt, String scheme, XSimpleFileAccess xSFA )
@@ -149,7 +149,7 @@ public class UCBStreamHandler extends URLStreamHandler {
try {
if (path.endsWith(".jar")) {
- is = (InputStream)m_jarStreamMap.get(path);
+ is = m_jarStreamMap.get(path);
if (is == null) {
is = getFileStreamFromUCB(path);
diff --git a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
index 6a3d90d3ac62..3752f8a766ab 100644
--- a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
+++ b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
@@ -56,7 +56,7 @@ public class XStorageHelper implements XEventListener
XStream xStream;
XInputStream xIs = null;
XOutputStream xOs = null;
- static Map modelMap = new HashMap();
+ static Map<String,XModel> modelMap = new HashMap<String,XModel>();
XModel xModel = null;
private static XStorageHelper listener = new XStorageHelper();
@@ -262,7 +262,7 @@ public class XStorageHelper implements XEventListener
public XModel getModelForURL( String url )
{
//TODO does not cater for untitled documents
- return (XModel)modelMap.get( url );
+ return modelMap.get( url );
}
}
diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java
index 6a4c490ba9fa..ea7b19dc781b 100644
--- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java
+++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptDescriptor.java
@@ -18,7 +18,8 @@
package com.sun.star.script.framework.provider.java;
-import java.util.Vector;
+import java.util.List;
+import java.util.ArrayList;
import java.util.StringTokenizer;
/**
@@ -33,8 +34,8 @@ public class ScriptDescriptor
private String m_name;
private String m_methodName;
private String m_className;
- private Vector m_classpath;
- private Vector m_argumentTypes = new Vector( 11 );
+ private List<String> m_classpath;
+ private ArrayList<Class<?>> m_argumentTypes = new ArrayList<Class<?>>( 11 );
/**
@@ -110,7 +111,7 @@ public class ScriptDescriptor
*
* @param classpath The new classpath value
*/
- public void setClasspath( Vector classpath )
+ public void setClasspath( List<String> classpath )
{
this.m_classpath = classpath;
}
@@ -121,7 +122,7 @@ public class ScriptDescriptor
*
* @return The classpath value
*/
- public Vector getClasspath()
+ public List<String> getClasspath()
{
return m_classpath;
}
@@ -133,9 +134,9 @@ public class ScriptDescriptor
*
* @param clazz The feature to be added to the ArgumentType attribute
*/
- public synchronized void addArgumentType( Class clazz )
+ public synchronized void addArgumentType( Class<?> clazz )
{
- m_argumentTypes.addElement( clazz );
+ m_argumentTypes.add( clazz );
}
@@ -162,11 +163,11 @@ public class ScriptDescriptor
*
* @return The argumentTypes value
*/
- public synchronized Class[]
+ public synchronized Class<?>[]
getArgumentTypes()
{
if ( m_argumentTypes.size() > 0 )
- return ( Class[] ) m_argumentTypes.toArray( new Class[ 0 ] );
+ return m_argumentTypes.toArray( new Class[ m_argumentTypes.size() ] );
else
return null;
}
diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
index 598089689e22..dbe8967beffc 100644
--- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
+++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
@@ -240,7 +240,7 @@ class ScriptImpl implements XScript
throw e2;
}
- ArrayList invocationArgList = new ArrayList();
+ ArrayList<Object> invocationArgList = new ArrayList<Object>();
Object[] invocationArgs = null;
LogUtils.DEBUG( "Parameter Mapping..." );
diff --git a/scripting/java/com/sun/star/script/framework/provider/java/StrictResolver.java b/scripting/java/com/sun/star/script/framework/provider/java/StrictResolver.java
index e596131a410e..3722b1fd5d22 100644
--- a/scripting/java/com/sun/star/script/framework/provider/java/StrictResolver.java
+++ b/scripting/java/com/sun/star/script/framework/provider/java/StrictResolver.java
@@ -110,7 +110,7 @@ public class StrictResolver implements Resolver
* @exception ClassNotFoundException
* @exception NoSuchMethodException
*/
- private Method resolveArguments( ScriptDescriptor sd, Class c )
+ private Method resolveArguments( ScriptDescriptor sd, Class<?> c )
throws ClassNotFoundException, NoSuchMethodException
{
return c.getMethod( sd.getMethodName(), sd.getArgumentTypes() );
diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index 6cc0de31bac1..37e6f994721a 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -60,6 +60,7 @@ import com.sun.star.uno.Type;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.XInterface;
+@SuppressWarnings("unchecked")
public class TestComponent {
static public final boolean DEBUG = false;
diff --git a/unotest/source/java/org/openoffice/test/tools/OfficeDocument.java b/unotest/source/java/org/openoffice/test/tools/OfficeDocument.java
index 5905bb9a7300..367bca1c3124 100644
--- a/unotest/source/java/org/openoffice/test/tools/OfficeDocument.java
+++ b/unotest/source/java/org/openoffice/test/tools/OfficeDocument.java
@@ -147,7 +147,7 @@ public class OfficeDocument
}
/* ------------------------------------------------------------------ */
- public Object query( Class aInterfaceClass )
+ public <T> T query( Class<T> aInterfaceClass )
{
return UnoRuntime.queryInterface( aInterfaceClass, m_documentComponent );
}