You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2007/12/22 20:44:48 UTC
svn commit: r606480 -
/xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java
Author: mrglavas
Date: Sat Dec 22 11:44:47 2007
New Revision: 606480
URL: http://svn.apache.org/viewvc?rev=606480&view=rev
Log:
Some minor performance improvements. Replace the
usage of Hashtable with the unsynchronized HashMap.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java
Modified: xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java?rev=606480&r1=606479&r2=606480&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/validation/ValidationState.java Sat Dec 22 11:44:47 2007
@@ -17,15 +17,15 @@
package org.apache.xerces.impl.validation;
-import org.apache.xerces.util.SymbolTable;
-import org.apache.xerces.impl.dv.ValidationContext;
+import java.util.HashMap;
+import java.util.Iterator;
+import org.apache.xerces.impl.dv.ValidationContext;
+import org.apache.xerces.util.SymbolTable;
import org.apache.xerces.xni.NamespaceContext;
-import java.util.Hashtable;
-import java.util.Enumeration;
/**
- * Implementation of ValidationContext inteface. Used to establish an
+ * Implementation of the ValidationContext interface. Used to establish an
* environment for simple type validation.
*
* @xerces.internal
@@ -48,8 +48,8 @@
private SymbolTable fSymbolTable = null;
//REVISIT: Should replace with a lighter structure.
- private final Hashtable fIdTable = new Hashtable();
- private final Hashtable fIdRefTable = new Hashtable();
+ private final HashMap fIdTable = new HashMap();
+ private final HashMap fIdRefTable = new HashMap();
private final static Object fNullValue = new Object();
//
@@ -88,11 +88,10 @@
* otherwise return the first IDREF value without a matching ID value.
*/
public String checkIDRefID () {
- Enumeration en = fIdRefTable.keys();
-
+ Iterator iter = fIdRefTable.keySet().iterator();
String key;
- while (en.hasMoreElements()) {
- key = (String)en.nextElement();
+ while (iter.hasNext()) {
+ key = (String) iter.next();
if (!fIdTable.containsKey(key)) {
return key;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org