diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 15:03:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:45:53 +0200 |
commit | 8be40d31d78723debd47f671544f480c1c606db7 (patch) | |
tree | 0051888bb41793e4d65704a93a4cfc659119c8bc /qadevOOo | |
parent | e527a340051b55a6f05d05f397d82ec797165163 (diff) |
Java cleanup, convert Hashtable to HashMap
Change-Id: If8a9c0c3a4b357fb9c0ff096f44ed1b44ebbcef4
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/helper/UnoProvider.java | 12 | ||||
-rw-r--r-- | qadevOOo/runner/util/XMLTools.java | 3 | ||||
-rw-r--r-- | qadevOOo/tests/java/ifc/style/_ParagraphProperties.java | 35 |
3 files changed, 22 insertions, 28 deletions
diff --git a/qadevOOo/runner/helper/UnoProvider.java b/qadevOOo/runner/helper/UnoProvider.java index ec63699f8cbb..e3628de63a0a 100644 --- a/qadevOOo/runner/helper/UnoProvider.java +++ b/qadevOOo/runner/helper/UnoProvider.java @@ -17,15 +17,17 @@ */ package helper; +import java.util.HashMap; + +import lib.TestParameters; +import util.PropertyName; +import util.utils; + import com.sun.star.comp.helper.Bootstrap; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; -import java.util.Hashtable; -import lib.TestParameters; -import util.PropertyName; -import util.utils; /** * Bootstrap UNO from a Java environment. @@ -89,7 +91,7 @@ public class UnoProvider implements AppProvider { if (xMSF == null) { // bootstrap UNO. String unorcName = getUnorcName(param); - Hashtable<String,String> env = new Hashtable<String,String>(); + HashMap<String,String> env = new HashMap<String,String>(); env.put("SYSBINDIR", getSysBinDir(param)); XComponentContext xContext = null; diff --git a/qadevOOo/runner/util/XMLTools.java b/qadevOOo/runner/util/XMLTools.java index cd73daf47304..b658aa58f185 100644 --- a/qadevOOo/runner/util/XMLTools.java +++ b/qadevOOo/runner/util/XMLTools.java @@ -22,7 +22,6 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Hashtable; import java.util.Iterator; import com.sun.star.beans.PropertyValue; @@ -58,7 +57,7 @@ public class XMLTools { public String Type ; public String Value ; } - private Hashtable<String, Attribute> attrByName = new Hashtable<String, Attribute>() ; + private HashMap<String, Attribute> attrByName = new HashMap<String, Attribute>() ; private ArrayList<Attribute> attributes = new ArrayList<Attribute>() ; private PrintWriter log = null ; diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java index 7be6f0ecb4be..9f4ba6ad8806 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java @@ -17,6 +17,15 @@ */ package ifc.style; +import ifc.text._NumberingLevel; + +import java.util.HashMap; + +import lib.MultiPropertyTest; +import lib.Status; +import share.LogWriter; +import util.utils; + import com.sun.star.beans.PropertyValue; import com.sun.star.beans.UnknownPropertyException; import com.sun.star.container.XIndexReplace; @@ -25,16 +34,6 @@ import com.sun.star.lang.WrappedTargetException; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Type; import com.sun.star.xml.AttributeData; -import ifc.text._NumberingLevel; -import java.util.Enumeration; -import java.util.Hashtable; - -import lib.MultiPropertyTest; -import lib.Status; -import share.LogWriter; - - -import util.utils; /** @@ -446,11 +445,11 @@ public class _ParagraphProperties extends MultiPropertyTest { } private class OwnUserDefinedAttributes implements XNameContainer{ - Hashtable<String, Object> members = null; + HashMap<String, Object> members = null; public OwnUserDefinedAttributes() { - members = new Hashtable<String, Object>(); + members = new HashMap<String, Object>(); } public Object getByName(String str) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException { @@ -458,18 +457,12 @@ public class _ParagraphProperties extends MultiPropertyTest { } public String[] getElementNames() { - Enumeration<String> oEnum = members.keys(); - int count = members.size(); - String[] res = new String[count]; - int i=0; - while(oEnum.hasMoreElements()) - res[i] = oEnum.nextElement(); - return res; + java.util.Set<String> keySet = members.keySet(); + return keySet.toArray(new String[keySet.size()]); } public com.sun.star.uno.Type getElementType() { - Enumeration<String> oEnum = members.keys(); - String key = oEnum.nextElement(); + String key = members.keySet().iterator().next(); Object o = members.get(key); return new Type(o.getClass()); } |