summaryrefslogtreecommitdiffstats
path: root/qadevOOo/runner/helper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 15:40:17 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:01 +0200
commitb65017a2a7af290f6681da7b197a52efe83d5185 (patch)
tree06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo/runner/helper
parentJava5 update - Convert Hashtable to HashMap (diff)
downloadcore-b65017a2a7af290f6681da7b197a52efe83d5185.tar.gz
core-b65017a2a7af290f6681da7b197a52efe83d5185.zip
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/runner/helper')
-rw-r--r--qadevOOo/runner/helper/APIDescGetter.java32
-rw-r--r--qadevOOo/runner/helper/ComplexDescGetter.java4
-rw-r--r--qadevOOo/runner/helper/ConfigHelper.java20
-rw-r--r--qadevOOo/runner/helper/ConfigurationRead.java5
-rw-r--r--qadevOOo/runner/helper/ContextMenuInterceptor.java10
-rw-r--r--qadevOOo/runner/helper/CwsDataExchangeImpl.java2
-rw-r--r--qadevOOo/runner/helper/InetTools.java4
-rw-r--r--qadevOOo/runner/helper/PropertyHelper.java4
-rw-r--r--qadevOOo/runner/helper/StreamSimulator.java9
-rw-r--r--qadevOOo/runner/helper/URLHelper.java8
-rw-r--r--qadevOOo/runner/helper/UnoProvider.java2
11 files changed, 48 insertions, 52 deletions
diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java
index a99bd979d37e..7dad332e2908 100644
--- a/qadevOOo/runner/helper/APIDescGetter.java
+++ b/qadevOOo/runner/helper/APIDescGetter.java
@@ -99,7 +99,7 @@ public class APIDescGetter extends DescGetter
}
else
{
- ArrayList subs = getSubInterfaces(job);
+ ArrayList<String> subs = getSubInterfaces(job);
String partjob = job.substring(0, job.indexOf(",")).trim();
DescEntry entry = getDescriptionForSingleJob(partjob, descPath,
debug);
@@ -167,13 +167,13 @@ public class APIDescGetter extends DescGetter
{
//look the scenarion like this? :
// sw.SwXBodyText,sw.SwXTextCursor
- ArrayList subs = getSubObjects(job);
+ ArrayList<String> subs = getSubObjects(job);
DescEntry[] entries = new DescEntry[subs.size()];
for (int i = 0; i < subs.size(); i++)
{
entries[i] = getDescriptionForSingleJob(
- (String) subs.get(i), descPath, debug);
+ subs.get(i), descPath, debug);
}
return entries;
}
@@ -263,8 +263,8 @@ public class APIDescGetter extends DescGetter
{
String line = "";
String old_ifc_name = "";
- ArrayList ifc_names = new ArrayList();
- ArrayList meth_names = new ArrayList();
+ ArrayList<DescEntry> ifc_names = new ArrayList<DescEntry>();
+ ArrayList<DescEntry> meth_names = new ArrayList<DescEntry>();
DescEntry ifcDesc = null;
while (line != null)
@@ -464,17 +464,17 @@ public class APIDescGetter extends DescGetter
return methDesc;
}
- private static void createIfcName(String ifc_name, ArrayList meth_names, DescEntry ifcDesc)
+ private static void createIfcName(String ifc_name, ArrayList<String> meth_names, DescEntry ifcDesc)
{
}
/**
* This method ensures that XComponent will be the last in the list of interfaces
*/
- protected static Object[] makeArray(ArrayList entries)
+ protected static Object[] makeArray(ArrayList<DescEntry> entries)
{
Object[] entriesArray = entries.toArray();
- ArrayList returnArray = new ArrayList();
+ ArrayList<Object> returnArray = new ArrayList<Object>();
Object addAtEnd = null;
for (int k = 0; k < entriesArray.length; k++)
@@ -730,9 +730,9 @@ public class APIDescGetter extends DescGetter
return aEntry;
}
- protected ArrayList getSubInterfaces(String job)
+ protected ArrayList<String> getSubInterfaces(String job)
{
- ArrayList namesList = new ArrayList();
+ ArrayList<String> namesList = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(job, ",");
for (int i = 0; st.hasMoreTokens(); i++)
@@ -748,9 +748,9 @@ public class APIDescGetter extends DescGetter
return namesList;
}
- protected ArrayList getSubObjects(String job)
+ protected ArrayList<String> getSubObjects(String job)
{
- ArrayList namesList = new ArrayList();
+ ArrayList<String> namesList = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(job, ",");
for (int i = 0; st.hasMoreTokens(); i++)
@@ -792,7 +792,7 @@ public class APIDescGetter extends DescGetter
boolean debug)
{
String[] modules = null;
- ArrayList componentList = new ArrayList();
+ ArrayList<String> componentList = new ArrayList<String>();
if (!job.equals("unknown") && !job.equals("listall"))
{
@@ -841,7 +841,7 @@ public class APIDescGetter extends DescGetter
for (int i = 0; i < componentList.size(); i++)
{
- scenario[i] = (String) componentList.get(i);
+ scenario[i] = componentList.get(i);
}
return scenario;
@@ -864,7 +864,7 @@ public class APIDescGetter extends DescGetter
return null;
}
- ArrayList scenarioList = new ArrayList();
+ ArrayList<String> scenarioList = new ArrayList<String>();
try
{
@@ -945,7 +945,7 @@ public class APIDescGetter extends DescGetter
protected boolean isUnusedModule(String moduleName)
{
- ArrayList removed = new ArrayList();
+ ArrayList<String> removed = new ArrayList<String>();
removed.add("acceptor");
removed.add("brdgfctr");
removed.add("connectr");
diff --git a/qadevOOo/runner/helper/ComplexDescGetter.java b/qadevOOo/runner/helper/ComplexDescGetter.java
index 413733342be1..e269e1816d1c 100644
--- a/qadevOOo/runner/helper/ComplexDescGetter.java
+++ b/qadevOOo/runner/helper/ComplexDescGetter.java
@@ -85,7 +85,7 @@ public class ComplexDescGetter extends DescGetter
// case3: method1(param1,param2),method2(param1,param2)
String method = className.substring(index + 2);
className = className.substring(0, index);
- ArrayList methods = new ArrayList();
+ ArrayList<String> methods = new ArrayList<String>();
String[] split = method.split("(?<=\\)),(?=\\w+)");
@@ -102,7 +102,7 @@ public class ComplexDescGetter extends DescGetter
}
methodNames = new String[methods.size()];
- methodNames = (String[]) methods.toArray(methodNames);
+ methodNames = methods.toArray(methodNames);
}
// create an instance
diff --git a/qadevOOo/runner/helper/ConfigHelper.java b/qadevOOo/runner/helper/ConfigHelper.java
index a5d1191f1e5b..b65056ef229a 100644
--- a/qadevOOo/runner/helper/ConfigHelper.java
+++ b/qadevOOo/runner/helper/ConfigHelper.java
@@ -96,11 +96,10 @@ public class ConfigHelper
{
m_xSMGR = xSMGR;
- XMultiServiceFactory xConfigRoot = (XMultiServiceFactory)
- UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- m_xSMGR.createInstance(
- "com.sun.star.configuration.ConfigurationProvider"));
+ XMultiServiceFactory xConfigRoot = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ m_xSMGR.createInstance(
+ "com.sun.star.configuration.ConfigurationProvider"));
PropertyValue[] lParams = new PropertyValue[1];
lParams[0] = new PropertyValue();
@@ -117,7 +116,7 @@ public class ConfigHelper
"com.sun.star.configuration.ConfigurationUpdateAccess",
lParams);
- m_xConfig = (XHierarchicalNameAccess)UnoRuntime.queryInterface(
+ m_xConfig = UnoRuntime.queryInterface(
XHierarchicalNameAccess.class,
aConfig);
@@ -172,7 +171,7 @@ public class ConfigHelper
{
try
{
- XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface(
+ XChangesBatch xBatch = UnoRuntime.queryInterface(
XChangesBatch.class,
m_xConfig);
xBatch.commitChanges();
@@ -228,7 +227,7 @@ public class ConfigHelper
try {
Object xChild=xSetCont.getByName(groupName);
- xChildAccess = (XNameReplace) UnoRuntime.queryInterface(
+ xChildAccess = UnoRuntime.queryInterface(
XNameReplace.class,xSetCont);
} catch(com.sun.star.container.NoSuchElementException e) {
// proceed with inserting
@@ -311,7 +310,7 @@ public class ConfigHelper
try {
Object xGroup=xSetCont.getByName(group);
- xGroupAccess = (XNameReplace) UnoRuntime.queryInterface(
+ xGroupAccess = UnoRuntime.queryInterface(
XNameReplace.class,xGroup);
} catch(com.sun.star.container.NoSuchElementException e) {
throw new com.sun.star.uno.Exception(
@@ -350,8 +349,7 @@ public class ConfigHelper
public XNameContainer getSet(String setName)
throws com.sun.star.uno.Exception
{
- XNameReplace xCont = (XNameReplace)
- UnoRuntime.queryInterface(XNameReplace.class, m_xConfig);
+ XNameReplace xCont = UnoRuntime.queryInterface(XNameReplace.class, m_xConfig);
Object oSet = xCont.getByName(setName);
diff --git a/qadevOOo/runner/helper/ConfigurationRead.java b/qadevOOo/runner/helper/ConfigurationRead.java
index b865c3064925..3940edc5e361 100644
--- a/qadevOOo/runner/helper/ConfigurationRead.java
+++ b/qadevOOo/runner/helper/ConfigurationRead.java
@@ -53,9 +53,8 @@ public class ConfigurationRead {
"com.sun.star.configuration.ConfigurationAccess",
nodeArgs);
- root = (XHierarchicalNameAccess)
- UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class, rootObject);
+ root = UnoRuntime.queryInterface(
+ XHierarchicalNameAccess.class, rootObject);
}
catch(com.sun.star.uno.Exception e) {
e.printStackTrace();
diff --git a/qadevOOo/runner/helper/ContextMenuInterceptor.java b/qadevOOo/runner/helper/ContextMenuInterceptor.java
index ea377c2e0158..6d80e1fdbbaf 100644
--- a/qadevOOo/runner/helper/ContextMenuInterceptor.java
+++ b/qadevOOo/runner/helper/ContextMenuInterceptor.java
@@ -37,8 +37,8 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
// create sub menus, menu entries and separators
XIndexContainer xContextMenu = aEvent.ActionTriggerContainer;
XMultiServiceFactory xMenuElementFactory =
- (XMultiServiceFactory)UnoRuntime.queryInterface(
- XMultiServiceFactory.class, xContextMenu );
+ UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, xContextMenu );
if ( xMenuElementFactory != null ) {
@@ -58,9 +58,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
// query sub menu for index container to get access
XIndexContainer xSubMenuContainer =
- (XIndexContainer)UnoRuntime.queryInterface(
- XIndexContainer.class,
- xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" ));
+ UnoRuntime.queryInterface(
+ XIndexContainer.class,
+ xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" ));
// intialize root menu entry "Help"
xRootMenuEntry.setPropertyValue( "Text", new String( "Help" ));
diff --git a/qadevOOo/runner/helper/CwsDataExchangeImpl.java b/qadevOOo/runner/helper/CwsDataExchangeImpl.java
index ba873d6ff149..1619a8146c88 100644
--- a/qadevOOo/runner/helper/CwsDataExchangeImpl.java
+++ b/qadevOOo/runner/helper/CwsDataExchangeImpl.java
@@ -49,7 +49,7 @@ public class CwsDataExchangeImpl implements CwsDataExchange
mDebug = param.getBool(PropertyName.DEBUG_IS_ACTIVE);
}
- public ArrayList getModules()
+ public ArrayList<String> getModules()
{
// the cwstouched command send its version information to StdErr.
// A piping from StdErr to SdtOut the tcsh does not support.
diff --git a/qadevOOo/runner/helper/InetTools.java b/qadevOOo/runner/helper/InetTools.java
index b7529920a3f6..b4c5a8443239 100644
--- a/qadevOOo/runner/helper/InetTools.java
+++ b/qadevOOo/runner/helper/InetTools.java
@@ -45,7 +45,7 @@ public class InetTools {
Object oProvider = xMSF.createInstance(
"com.sun.star.configuration.ConfigurationProvider");
- XMultiServiceFactory oProviderMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory oProviderMSF = UnoRuntime.queryInterface(
XMultiServiceFactory.class,
oProvider);
@@ -67,7 +67,7 @@ public class InetTools {
oInetProps.setPropertyValue("ooInetHTTPProxyPort", HTTPProxyPort);
oInetProps.setPropertyValue("ooInetProxyType", new Long(2));
- XChangesBatch oSecureChange = (XChangesBatch) UnoRuntime.queryInterface(
+ XChangesBatch oSecureChange = UnoRuntime.queryInterface(
XChangesBatch.class, oInet);
oSecureChange.commitChanges();
}
diff --git a/qadevOOo/runner/helper/PropertyHelper.java b/qadevOOo/runner/helper/PropertyHelper.java
index 76179927cd87..c91b4053aeb4 100644
--- a/qadevOOo/runner/helper/PropertyHelper.java
+++ b/qadevOOo/runner/helper/PropertyHelper.java
@@ -29,7 +29,7 @@ public class PropertyHelper
@param _aArrayList
@return a PropertyValue[]
*/
- public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList)
+ public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList<PropertyValue> _aPropertyList)
{
// copy the whole PropertyValue List to an PropertyValue Array
PropertyValue[] aSaveProperties = null;
@@ -40,7 +40,7 @@ public class PropertyHelper
}
else
{
- aSaveProperties = (PropertyValue[])_aPropertyList.toArray(new PropertyValue[_aPropertyList.size()]);
+ aSaveProperties = _aPropertyList.toArray(new PropertyValue[_aPropertyList.size()]);
// old java 1.4
// if (_aPropertyList.size() > 0)
// {
diff --git a/qadevOOo/runner/helper/StreamSimulator.java b/qadevOOo/runner/helper/StreamSimulator.java
index f53f17de5cab..fe4a19deda09 100644
--- a/qadevOOo/runner/helper/StreamSimulator.java
+++ b/qadevOOo/runner/helper/StreamSimulator.java
@@ -88,9 +88,8 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
try
{
- XSimpleFileAccess xHelper = (XSimpleFileAccess)
- UnoRuntime.queryInterface(XSimpleFileAccess.class,
- ((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.ucb.SimpleFileAccess"));
+ XSimpleFileAccess xHelper = UnoRuntime.queryInterface(XSimpleFileAccess.class,
+ ((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.ucb.SimpleFileAccess"));
/* com.sun.star.ucb.XSimpleFileAccess xHelper = (com.sun.star.ucb.XSimpleFileAccess)OfficeConnect.createRemoteInstance(
com.sun.star.ucb.XSimpleFileAccess.class,
"com.sun.star.ucb.SimpleFileAccess");*/
@@ -101,14 +100,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
if (bInput)
{
m_xInStream = xHelper.openFileRead(m_sFileName);
- m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+ m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xInStream);
}
else
{
m_xOutStream = xHelper.openFileWrite(m_sFileName);
- m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
+ m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xOutStream);
}
diff --git a/qadevOOo/runner/helper/URLHelper.java b/qadevOOo/runner/helper/URLHelper.java
index c33ac40ffb8b..bd091a988f01 100644
--- a/qadevOOo/runner/helper/URLHelper.java
+++ b/qadevOOo/runner/helper/URLHelper.java
@@ -240,7 +240,7 @@ public class URLHelper
* a filtered list of java File objects of all available files of the start dir
* and all accessable sub directories.
*/
- public static ArrayList getSystemFilesFromDir(String sStartDir)
+ public static ArrayList<File> getSystemFilesFromDir(String sStartDir)
{
File aRoot = new File(sStartDir);
@@ -254,7 +254,7 @@ public class URLHelper
if (lAllFiles == null )
return null;
- ArrayList lFilteredFiles = new ArrayList(lAllFiles.length);
+ ArrayList<File> lFilteredFiles = new ArrayList<File>(lAllFiles.length);
for (int i=0; i<lAllFiles.length; ++i)
{
@@ -264,10 +264,10 @@ public class URLHelper
if (lAllFiles[i].isDirectory())
{
// recursion!
- ArrayList lSubFiles = URLHelper.getSystemFilesFromDir(lAllFiles[i].getPath());
+ ArrayList<File> lSubFiles = URLHelper.getSystemFilesFromDir(lAllFiles[i].getPath());
if (lSubFiles != null)
{
- Iterator aSnapshot = lSubFiles.iterator();
+ Iterator<File> aSnapshot = lSubFiles.iterator();
while (aSnapshot.hasNext())
lFilteredFiles.add(aSnapshot.next());
}
diff --git a/qadevOOo/runner/helper/UnoProvider.java b/qadevOOo/runner/helper/UnoProvider.java
index 9194ec54e549..e8b444cb9ef3 100644
--- a/qadevOOo/runner/helper/UnoProvider.java
+++ b/qadevOOo/runner/helper/UnoProvider.java
@@ -105,7 +105,7 @@ public class UnoProvider implements AppProvider {
return null;
}
XMultiComponentFactory xMCF = xContext.getServiceManager();
- xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface(
+ xMSF = UnoRuntime.queryInterface(
XMultiServiceFactory.class, xMCF);
}
return xMSF;