From: srowen Date: Tue, 8 Dec 2009 12:02:35 +0000 (+0000) Subject: Remove use of Hashtable.clone(), doesn't work in J2ME X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=829c2efa186932b2a55a6b6a73c02cc651a70e51;hp=1b67d19946b5f8a29f0b7ea97c6764f821a3f744;p=zxing.git Remove use of Hashtable.clone(), doesn't work in J2ME git-svn-id: http://zxing.googlecode.com/svn/trunk@1139 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/core/src/com/google/zxing/oned/OneDReader.java b/core/src/com/google/zxing/oned/OneDReader.java index fba71fd0..b3d4f5ee 100644 --- a/core/src/com/google/zxing/oned/OneDReader.java +++ b/core/src/com/google/zxing/oned/OneDReader.java @@ -25,6 +25,7 @@ import com.google.zxing.ResultMetadataType; import com.google.zxing.ResultPoint; import com.google.zxing.common.BitArray; +import java.util.Enumeration; import java.util.Hashtable; /** @@ -125,8 +126,15 @@ public abstract class OneDReader implements Reader { // don't want to clutter with noise from every single row scan -- just the scans // that start on the center line. if (hints != null && hints.containsKey(DecodeHintType.NEED_RESULT_POINT_CALLBACK)) { - hints = (Hashtable) hints.clone(); - hints.remove(DecodeHintType.NEED_RESULT_POINT_CALLBACK); + Hashtable newHints = new Hashtable(); // Can't use clone() in J2ME + Enumeration hintEnum = hints.keys(); + while (hintEnum.hasMoreElements()) { + Object key = hintEnum.nextElement(); + if (!key.equals(DecodeHintType.NEED_RESULT_POINT_CALLBACK)) { + newHints.put(key, hints.get(key)); + } + } + hints = newHints; } } try {