Revision: 7709
Author: [email protected]
Date: Thu Mar 11 11:04:12 2010
Log: reverting r5487 that was just for diagnostics
Patch by: amitmanjhi
Review by: scottb, jat
http://code.google.com/p/google-web-toolkit/source/detail?r=7709
Modified:
/trunk/user/src/com/google/gwt/i18n/client/Dictionary.java
/trunk/user/test/com/google/gwt/i18n/client/I18NTest.java
=======================================
--- /trunk/user/src/com/google/gwt/i18n/client/Dictionary.java Fri Nov 20
08:57:58 2009
+++ /trunk/user/src/com/google/gwt/i18n/client/Dictionary.java Thu Mar 11
11:04:12 2010
@@ -102,7 +102,6 @@
null, name);
}
- private JavaScriptObject accessedKeys;
private JavaScriptObject dict;
private String label;
@@ -124,13 +123,8 @@
"Cannot find JavaScript object with the name '" + name + "'",
name,
null);
}
- createAccessedKeysArray();
}
- private native void createAccessedKeysArray() /*-{
- [email protected]::accessedKeys = new
Array();
- }-*/;
-
/**
* Get the value associated with the given Dictionary key.
*
@@ -147,12 +141,6 @@
key = String(key);
var map = [email protected]::dict;
var value = map[key];
- var keys = [email protected]::accessedKeys;
- keys.unshift(key);
- // only keep the last 30 elements. Shrink it when array exceeds 60
- if (keys.length > 60) {
- keys.splice(30);
- }
if (value == null || !map.hasOwnProperty(key)) {
[email protected]::resourceError(Ljava/lang/String;)(key);
}
@@ -192,7 +180,6 @@
if (s.size() < MAX_KEYS_TO_SHOW) {
error += "\n keys found: " + s;
}
- error += "\n accessed keys: " + accessedKeys;
throw new MissingResourceException(error, this.toString(), key);
}
=======================================
--- /trunk/user/test/com/google/gwt/i18n/client/I18NTest.java Thu Feb 25
10:33:31 2010
+++ /trunk/user/test/com/google/gwt/i18n/client/I18NTest.java Thu Mar 11
11:04:12 2010
@@ -430,46 +430,6 @@
assertTrue(s.contains("a"));
assertTrue(s.contains("b"));
assertFalse(s.contains("c"));
- String nonExistentKey = "nonExistentKey";
- try {
- d.get(nonExistentKey);
- fail("should have thrown a MissingResourceException");
- } catch (MissingResourceException ex) {
- assertTrue(ex.getMessage(), ex.getMessage().indexOf(
- "accessed keys: " + nonExistentKey + ",d,formattedMessage") !=
-1);
- }
-
- /*
- * verify that accessedKeys maintains at least the last 30 entries in
the
- * correct order. Steps involved: (i) create expectedKeys array, (ii)
access
- * the dictionary, (iii) confirm that accessedKeys is maintained
correctly.
- */
- // expectedKeys: nonExistentKey, 9 a's, 9 b's, 9 d's, 2
formattedMessage's
- StringBuffer expectedKeys = new StringBuffer();
- expectedKeys.append(nonExistentKey);
- for (String key : new String[] {"a", "b", "d"}) {
- for (int i = 0; i < 9; i++) {
- expectedKeys.append(",");
- expectedKeys.append(key);
- }
- }
- expectedKeys.append(",formattedMessage,formattedMessage");
- // access 360 keys. last 30 should match expectedKeys
- for (int i = 0; i < 10; i++) {
- for (String key : new String[] {"formattedMessage", "d", "b", "a"}) {
- for (int j = 0; j < 9; j++) {
- d.get(key);
- }
- }
- }
- try {
- d.get(nonExistentKey);
- fail("should have thrown a MissingResourceException");
- } catch (MissingResourceException ex) {
- assertTrue(ex.getMessage(), ex.getMessage().indexOf(
- "accessed keys: " + expectedKeys.toString()) != -1);
- }
-
Collection<String> s2 = d.values();
assertTrue(s2.contains("A"));
assertTrue(s2.contains("B"));
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors