diff --git a/bridges/test/java_uno/equals/TestEquals.java b/bridges/test/java_uno/equals/TestEquals.java index bc79835dc67c..515c8e496f87 100644 --- a/bridges/test/java_uno/equals/TestEquals.java +++ b/bridges/test/java_uno/equals/TestEquals.java @@ -115,7 +115,7 @@ public final class TestEquals { } } - private final HashMap map = new HashMap(); + private final HashMap map = new HashMap(); } private final class Done implements XDone { @@ -160,7 +160,7 @@ public final class TestEquals { UnoRuntime.queryInterface( XDerived.class, test2Aa); - Hashtable params = new Hashtable(); + Hashtable params = new Hashtable(); params.put("UNO_TYPES", unoTypes); params.put("UNO_SERVICES", unoServices); XComponentContext context = Bootstrap. diff --git a/extensions/qa/integration/extensions/MethodHandler.java b/extensions/qa/integration/extensions/MethodHandler.java index 8508dca8fbda..b6259e9b790e 100644 --- a/extensions/qa/integration/extensions/MethodHandler.java +++ b/extensions/qa/integration/extensions/MethodHandler.java @@ -31,13 +31,13 @@ public class MethodHandler implements XPropertyHandler private XIntrospectionAccess m_introspectionAccess; private XIdlClass m_idlClass; private XIdlMethod[] m_methods; - private java.util.HashMap m_methodsHash; + private java.util.HashMap m_methodsHash; /** Creates a new instance of MethodHandler */ public MethodHandler( XComponentContext _context ) { m_context = _context; - m_methodsHash = new java.util.HashMap(); + m_methodsHash = new java.util.HashMap(); try { @@ -169,7 +169,7 @@ public class MethodHandler implements XPropertyHandler m_introspectionAccess = null; m_methods = null; - m_methodsHash = new java.util.HashMap(); + m_methodsHash = new java.util.HashMap(); m_introspectionAccess = m_introspection.inspect( _component ); if ( m_introspectionAccess == null ) @@ -217,7 +217,7 @@ public class MethodHandler implements XPropertyHandler */ private XIdlMethod impl_getMethod( String _methodName ) throws UnknownPropertyException { - XIdlMethod method = (XIdlMethod)m_methodsHash.get( _methodName ); + XIdlMethod method = m_methodsHash.get( _methodName ); if ( method == null ) throw new com.sun.star.beans.UnknownPropertyException(); diff --git a/forms/qa/integration/forms/TableCellTextBinding.java b/forms/qa/integration/forms/TableCellTextBinding.java index 40a5d698617b..8a1d1fb8ce18 100644 --- a/forms/qa/integration/forms/TableCellTextBinding.java +++ b/forms/qa/integration/forms/TableCellTextBinding.java @@ -48,7 +48,7 @@ public class TableCellTextBinding private String m_newCellText; private String m_lastKnownCellText; private boolean m_haveNewCellText; - private java.util.List m_listeners; + private java.util.List m_listeners; /** Creates a new instance of TableCellTextBinding */ public TableCellTextBinding( XCell cell ) @@ -56,7 +56,7 @@ public class TableCellTextBinding m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell ); m_newCellText = new String(); - m_listeners = new java.util.LinkedList(); + m_listeners = new java.util.LinkedList(); start(); } diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java index 7ca0e2973c66..80d1f97e28a7 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString.java @@ -1,149 +1,148 @@ -/** - * Description: operations for the a text string. - * - * @ Author Create/Modi Note - * Xiaofeng Xie Feb 22, 2001 - * Xiaofeng Xie May 12, 2004 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * Please acknowledge the author(s) if you use this code in any way. - * - * @version 1.0 - * @Since MAOS1.0 - */ - -package net.adaptivebox.global; - -import java.io.*; -import java.util.*; - -public class GlobalString { - public static final String NEGLECT_TAG = "#$@"; - public static final String EQUAL_TAG = "="; - -/** - * Tokenize a String with given key. - * @param input the String to be tokenized. - * @param tokenKey the delimiters. - * @return a String array that include the elements of input string that - * divided by the tokenKey. - */ - public static String[] tokenize(String input , String tokenKey) { - Vector v = new Vector(); - StringTokenizer t = new StringTokenizer(input, tokenKey); - String cmd[]; - while (t.hasMoreTokens()) - v.addElement(t.nextToken()); - cmd = new String[v.size()]; - for (int i = 0; i < cmd.length; i++) - cmd[i] = (String) v.elementAt(i); - return cmd; - } - - public static String[] getMeaningfulLines(String srcStr) throws Exception { - return getMeaningfulLines(srcStr, NEGLECT_TAG); - } - - public static String getMeaningfulLine(BufferedReader outReader) throws Exception { - return getMeaningfulLine(outReader, NEGLECT_TAG); - } - - public static int getCharLoc(char data, String str) { - for(int i=0; i0) { - isNeglect = getFirstCharExist(str, neglectFirstChars); - } - } while (isNeglect); - return str; - } - - public static String[] getMeaningfulLines(String srcStr, String neglectFirstChars) throws Exception { - StringReader outStringReader = new StringReader(srcStr); - BufferedReader outReader = new BufferedReader(outStringReader); - Vector origData = new Vector(); - String str = null; - while(true) { - str = getMeaningfulLine(outReader, neglectFirstChars); - if (str==null) { - break; - } - origData.add(str); - } - return convert1DVectorToStringArray(origData); - } - - /** - * convert vector to 1D String array - */ - public static String[] convert1DVectorToStringArray(Vector toToConvert) { - if (toToConvert==null) return null; - String[] objs = new String[toToConvert.size()]; - for (int i=0; i0) { + isNeglect = getFirstCharExist(str, neglectFirstChars); + } + } while (isNeglect); + return str; + } + + public static String[] getMeaningfulLines(String srcStr, String neglectFirstChars) throws Exception { + StringReader outStringReader = new StringReader(srcStr); + BufferedReader outReader = new BufferedReader(outStringReader); + ArrayList origData = new ArrayList(); + while(true) { + String str = getMeaningfulLine(outReader, neglectFirstChars); + if (str==null) { + break; + } + origData.add(str); + } + return convert1DVectorToStringArray(origData); + } + + /** + * convert vector to 1D String array + */ + public static String[] convert1DVectorToStringArray(ArrayList toToConvert) { + if (toToConvert==null) return null; + String[] objs = new String[toToConvert.size()]; + for (int i=0; i recipient = new HashMap(); recipient.put("Company", "Manatee Books"); recipient.put("Contact", "Rod Martin"); recipient.put("ZIP", "34567"); @@ -195,10 +187,9 @@ public class TextDocuments { XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields(); // iterate over hashtable and insert values into field masters - java.util.Enumeration keys = recipient.keys(); - while(keys.hasMoreElements()) { + for(Iterator iter = recipient.keySet().iterator(); iter.hasNext(); ) { // get column name - String key = (String)keys.nextElement(); + String key = iter.next(); // access corresponding field master Object fieldMaster = xNamedFieldMasters.getByName( diff --git a/scripting/workben/ifc/scripting/_XScriptInvocation.java b/scripting/workben/ifc/scripting/_XScriptInvocation.java index a9b9b72c8255..38863de54397 100644 --- a/scripting/workben/ifc/scripting/_XScriptInvocation.java +++ b/scripting/workben/ifc/scripting/_XScriptInvocation.java @@ -88,7 +88,7 @@ public class _XScriptInvocation extends MultiMethodTest { if (!context.equals("null")) ctx = loadDocument(context); - HashMap map = new HashMap(); + HashMap map = new HashMap(); map.put("SCRIPTING_DOC_STORAGE_ID", new Integer(storageId)); map.put("SCRIPTING_DOC_URI", "hahaha"); if (ctx != null) diff --git a/scripting/workben/ifc/scripting/_XScriptNameResolver.java b/scripting/workben/ifc/scripting/_XScriptNameResolver.java index 95601ca95666..fcee4802c5d4 100644 --- a/scripting/workben/ifc/scripting/_XScriptNameResolver.java +++ b/scripting/workben/ifc/scripting/_XScriptNameResolver.java @@ -81,7 +81,7 @@ public class _XScriptNameResolver extends MultiMethodTest { log.println(description + ": " + logicalname); - HashMap map = new HashMap(); + HashMap map = new HashMap(); map.put("SCRIPTING_DOC_STORAGE_ID", new Integer(storageId)); map.put("SCRIPTING_DOC_URI", util.utils.getFullTestURL(location)); diff --git a/scripting/workben/mod/_scripting/TestDataLoader.java b/scripting/workben/mod/_scripting/TestDataLoader.java index 530b8f2d7a07..c76d4351aad5 100644 --- a/scripting/workben/mod/_scripting/TestDataLoader.java +++ b/scripting/workben/mod/_scripting/TestDataLoader.java @@ -84,7 +84,7 @@ public class TestDataLoader { private static Parameters getParameters(StringTokenizer st) { String separator = "="; - HashMap map = new HashMap(5); + HashMap map = new HashMap(5); while (st.hasMoreTokens()) { String pair = st.nextToken();