Merge "Jit: MethodTrace + Jit fix"
diff --git a/docs/embedded-vm-control.html b/docs/embedded-vm-control.html
index 0b279e8..1e54453 100644
--- a/docs/embedded-vm-control.html
+++ b/docs/embedded-vm-control.html
@@ -8,7 +8,7 @@
 <h1>Controlling the Embedded VM</h1>
 
 <ul>
-    <li><a href="#overview">Overview</a>
+    <li><a href="#introduction">Introduction</a> (read this first!)
     <li><a href="#checkjni">Extended JNI Checks</a>
     <li><a href="#assertions">Assertions</a>
     <li><a href="#verifier">Bytecode Verification and Optimization</a>
@@ -18,7 +18,7 @@
     <li><a href="#dexcheck">DEX File Checksums</a>
 </ul>
 
-<h2><a name="overview">Overview</a></h2>
+<h2><a name="introduction">Introduction (read this first!)</a></h2>
 
 <p>The Dalvik VM supports a variety of command-line arguments
 (use <code>adb shell dalvikvm -help</code> to get a summary), but
@@ -31,12 +31,13 @@
 issuing a shell command on the device like this:
 <pre>adb shell setprop &lt;name&gt; &lt;value&gt;</pre>
 
-<p>The Android runtime must be restarted before the changes will take
-effect (<code>adb shell stop; adb shell start</code>).  This is because the
+<p><strong>The Android runtime must be restarted before the changes will take
+effect</strong> (<code>adb shell stop; adb shell start</code>).  This is because the
 settings are processed in the "zygote" process, which starts early and stays
 around "forever".
 
-<p>You may not be able to set this as an unprivileged user.  You can use
+<p>You may not be able to set <code>dalvik.*</code> properties or restart
+the system as an unprivileged user.  You can use
 <code>adb root</code> or run the <code>su</code> command from the device
 shell on "userdebug" builds to become root first.  When in doubt,
 <pre>adb shell getprop &lt;name&gt;</pre>
@@ -48,7 +49,7 @@
 
 <p>Such changes will survive reboots, but will be lost if the data
 partition is wiped.  (Hint: create a <code>local.prop</code>
-on your workstation, then <code>adb push local.prop /data</code> .  Or,
+on your workstation, then <code>adb push local.prop /data</code>.  Or,
 use one-liners like
 <code>adb shell "echo name = value &gt;&gt; /data/local.prop"</code> -- note
 the quotes are important.)
diff --git a/docs/heap-profiling.html b/docs/heap-profiling.html
index 3c80b4a..a9c949e 100644
--- a/docs/heap-profiling.html
+++ b/docs/heap-profiling.html
@@ -11,6 +11,10 @@
 of the virtual heap.  This is very useful for debugging memory usage
 and looking for memory leaks.  Getting at the information can be tricky,
 but has become easier in recent releases.
+</p><p>
+In what follows, the version number refers to the software release
+running on the phone.  To take advantage of the DDMS integration, you will
+also need a sufficiently recent version of DDMS.
 
 
 <h2>Getting the data</h2>
@@ -148,6 +152,7 @@
 permission, which is required to write data to the SD card.  If you're
 accustomed to writing profile data to <code>/sdcard</code>, you will
 need to enable the permission in your application's manifest.
+</p>
 
 
 <h3>Android 2.0 ("Eclair")</h3>
@@ -157,8 +162,15 @@
 and click the "dump HPROF file" button in the top left.  This always
 writes files to the SD card, so
 you must have a card inserted and the permission enabled in your application.
+</p>
 
 
+<h3>Android 2.x ("Froyo")</h3>
+<p>
+DDMS heap dump requests are now streamed directly out of the VM, removing
+the external storage requirement.
+</p>
+
 <h2>Examining the data</h2>
 <p>
 The data file format was augmented slightly from the common hprof format,
diff --git a/libcore/dom/src/test/java/org/w3c/domts/DOMTest.java b/libcore/dom/src/test/java/org/w3c/domts/DOMTest.java
index b39ea67..7dd8f26 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/DOMTest.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/DOMTest.java
@@ -165,8 +165,8 @@
           //
           //   if available use JDK 1.4's File.toURI().toString()
           //
-          Method method = File.class.getMethod("toURI", null);
-          Object uri = method.invoke(tempFile, null);
+          Method method = File.class.getMethod("toURI", (Class<?>) null);
+          Object uri = method.invoke(tempFile, (Class<?>) null);
           return uri.toString();
         }
         catch (NoSuchMethodException ex) {
diff --git a/libcore/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java b/libcore/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java
index 7ed0f54..b769602 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/LSDocumentBuilderFactory.java
@@ -272,8 +272,8 @@
     try {
       Class domImplRegistryClass = Class.forName(
           "org.w3c.dom.bootstrap.DOMImplementationRegistry");
-      Method newInstanceMethod = domImplRegistryClass.getMethod("newInstance", null);
-      Object domRegistry = newInstanceMethod.invoke(null, null);
+      Method newInstanceMethod = domImplRegistryClass.getMethod("newInstance", (Class<?>) null);
+      Object domRegistry = newInstanceMethod.invoke(null, (Class<?>) null);
       Method getDOMImplementationMethod = domImplRegistryClass.getMethod(
           "getDOMImplementation", new Class[] {String.class});
       impl = (DOMImplementation) getDOMImplementationMethod.invoke(domRegistry,
diff --git a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java
index d2e38ca..f3484da 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue1.java
@@ -69,7 +69,7 @@
       attributes = testNode.getAttributes();
       titleAttr = (Attr) attributes.getNamedItem("class");
       value = titleAttr.getValue();
-      assertEquals("attrValue1", "Yα", value);
+      assertEquals("attrValue1", "Y\u03b1", value); // android-changed: GREEK LOWER CASE ALPHA
       }
    /**
     *  Gets URI that identifies the test.
diff --git a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java
index fd5b211..814b693 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrgetvalue2.java
@@ -89,7 +89,7 @@
       firstChild = titleAttr.getFirstChild();
       retval = titleAttr.insertBefore(alphaRef, firstChild);
       value = titleAttr.getValue();
-      assertEquals("attrValue1", "αYα", value);
+      assertEquals("attrValue1", "\u03b1Y\u03b1", value); // android-changed: GREEK LOWER CASE ALPHA
       }
         
     }
diff --git a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java
index c9a2e62..8ba4c57 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_attrspecifiedvaluechanged.java
@@ -71,7 +71,7 @@
       doc = (Document) load("hc_staff", true);
       addressList = doc.getElementsByTagName("acronym");
       testNode = addressList.item(2);
-      ((Element) /*Node */testNode).setAttribute("class", "Yα");
+      ((Element) /*Node */testNode).setAttribute("class", "Y\u03b1"); // android-changed: GREEK LOWER CASE ALPHA
       attributes = testNode.getAttributes();
       streetAttr = (Attr) attributes.getNamedItem("class");
       state = streetAttr.getSpecified();
diff --git a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java
index e8d3268..36dc3f8 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_namednodemapinuseattributeerr.java
@@ -75,7 +75,7 @@
       elementList = doc.getElementsByTagName("acronym");
       firstNode = (Element) elementList.item(0);
       domesticAttr = doc.createAttribute("title");
-      domesticAttr.setValue("Yα");
+      domesticAttr.setValue("Y\u03b1"); // android-changed: GREEK LOWER CASE ALPHA
       setAttr = firstNode.setAttributeNode(domesticAttr);
       elementList = doc.getElementsByTagName("acronym");
       testNode = elementList.item(2);
diff --git a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java
index 5694a4a..2a10501 100644
--- a/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java
+++ b/libcore/dom/src/test/java/org/w3c/domts/level1/core/hc_textparseintolistofelements.java
@@ -72,13 +72,13 @@
       java.util.List result = new java.util.ArrayList();
       
       java.util.List expectedNormal = new java.util.ArrayList();
-      expectedNormal.add("β");
+      expectedNormal.add("\u03b2"); // android-changed: GREEK LOWER CASE BETA
       expectedNormal.add(" Dallas, ");
-      expectedNormal.add("γ");
+      expectedNormal.add("\u03b3"); // android-changed: GREEK LOWER CASE GAMMA
       expectedNormal.add("\n 98554");
       
       java.util.List expectedExpanded = new java.util.ArrayList();
-      expectedExpanded.add("β Dallas, γ\n 98554");
+      expectedExpanded.add("\u03b2 Dallas, \u03b3\n 98554"); // android-changed: GREEK LOWER CASE BETA, GREEK LOWER CASE GAMMA
       
       doc = (Document) load("hc_staff", false);
       elementList = doc.getElementsByTagName("acronym");
diff --git a/libcore/luni/src/main/java/java/util/Currency.java b/libcore/luni/src/main/java/java/util/Currency.java
index ed9868f..6aa295a 100644
--- a/libcore/luni/src/main/java/java/util/Currency.java
+++ b/libcore/luni/src/main/java/java/util/Currency.java
@@ -174,7 +174,9 @@
             return localeData.currencySymbol;
         }
 
-        return Resources.getCurrencySymbolNative(locale.toString(), currencyCode);
+        // Try ICU, and fall back to the currency code if ICU has nothing.
+        String symbol = Resources.getCurrencySymbolNative(locale.toString(), currencyCode);
+        return symbol != null ? symbol : currencyCode;
         // END android-changed
     }
 
diff --git a/libcore/luni/src/test/java/java/util/AllTests.java b/libcore/luni/src/test/java/java/util/AllTests.java
index fdeb03a..f675328 100644
--- a/libcore/luni/src/test/java/java/util/AllTests.java
+++ b/libcore/luni/src/test/java/java/util/AllTests.java
@@ -22,6 +22,7 @@
 public class AllTests {
     public static final Test suite() {
         TestSuite suite = tests.TestSuiteFactory.createTestSuite();
+        suite.addTestSuite(java.util.CurrencyTest.class);
         suite.addTestSuite(java.util.DateTest.class);
         suite.addTestSuite(java.util.FormatterTest.class);
         return suite;
diff --git a/libcore/luni/src/test/java/java/util/CurrencyTest.java b/libcore/luni/src/test/java/java/util/CurrencyTest.java
new file mode 100644
index 0000000..16111d5
--- /dev/null
+++ b/libcore/luni/src/test/java/java/util/CurrencyTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class CurrencyTest extends junit.framework.TestCase {
+    // Regression test to ensure that Currency.getSymbol(Locale) returns the
+    // currency code if ICU doesn't have a localization of the symbol. The
+    // harmony Currency tests don't test this, and their DecimalFormat tests
+    // only test it as a side-effect, and in a way that only detected my
+    // specific mistake of returning null (returning "stinky" would have
+    // passed).
+    public void test_getSymbol_fallback() throws Exception {
+        // This assumes that AED never becomes a currency important enough to
+        // Canada that Canadians give it a localized (to Canada) symbol.
+        assertEquals("AED", Currency.getInstance("AED").getSymbol(Locale.CANADA));
+    }
+}
diff --git a/libcore/luni/src/test/java/java/util/FormatterTest.java b/libcore/luni/src/test/java/java/util/FormatterTest.java
index 11d82fb..1722e67 100644
--- a/libcore/luni/src/test/java/java/util/FormatterTest.java
+++ b/libcore/luni/src/test/java/java/util/FormatterTest.java
@@ -37,8 +37,8 @@
     public void test_formatNull() throws Exception {
         // We fast-path %s and %d (with no configuration) but need to make sure we handle the
         // special case of the null argument...
-        assertEquals("null", String.format(Locale.US, "%s", null));
-        assertEquals("null", String.format(Locale.US, "%d", null));
+        assertEquals("null", String.format(Locale.US, "%s", (String) null));
+        assertEquals("null", String.format(Locale.US, "%d", (Integer) null));
         // ...without screwing up conversions that don't take an argument.
         assertEquals("%", String.format(Locale.US, "%%"));
     }
diff --git a/libcore/text/src/main/java/java/text/DecimalFormat.java b/libcore/text/src/main/java/java/text/DecimalFormat.java
index f483c59..65d4d48 100644
--- a/libcore/text/src/main/java/java/text/DecimalFormat.java
+++ b/libcore/text/src/main/java/java/text/DecimalFormat.java
@@ -946,7 +946,7 @@
         // END android-added
 
         if (this.isParseIntegerOnly() && number.equals(NEGATIVE_ZERO_DOUBLE)) {
-            return new Long(0);
+            return Long.valueOf(0); // android-changed
         }
         return number;
 
@@ -1208,18 +1208,10 @@
         fields.put("positiveSuffix", dform.getPositiveSuffix());
         fields.put("negativePrefix", dform.getNegativePrefix());
         fields.put("negativeSuffix", dform.getNegativeSuffix());
-        String posPrefixPattern = (String) Format.getInternalField(
-                "posPrefixPattern", dform);
-        fields.put("posPrefixPattern", posPrefixPattern);
-        String posSuffixPattern = (String) Format.getInternalField(
-                "posSuffixPattern", dform);
-        fields.put("posSuffixPattern", posSuffixPattern);
-        String negPrefixPattern = (String) Format.getInternalField(
-                "negPrefixPattern", dform);
-        fields.put("negPrefixPattern", negPrefixPattern);
-        String negSuffixPattern = (String) Format.getInternalField(
-                "negSuffixPattern", dform);
-        fields.put("negSuffixPattern", negSuffixPattern);
+        fields.put("posPrefixPattern", (String) null);
+        fields.put("posSuffixPattern", (String) null);
+        fields.put("negPrefixPattern", (String) null);
+        fields.put("negSuffixPattern", (String) null);
         fields.put("multiplier", dform.getMultiplier());
         fields.put("groupingSize", (byte) dform.getGroupingSize());
         // BEGIN android-added
@@ -1254,52 +1246,24 @@
     private void readObject(ObjectInputStream stream) throws IOException,
             ClassNotFoundException {
 
-        ObjectInputStream.GetField fields = stream.readFields();
-        String positivePrefix = (String) fields.get("positivePrefix", "");
-        String positiveSuffix = (String) fields.get("positiveSuffix", "");
-        String negativePrefix = (String) fields.get("negativePrefix", "-");
-        String negativeSuffix = (String) fields.get("negativeSuffix", "");
-
-        String posPrefixPattern = (String) fields.get("posPrefixPattern", "");
-        String posSuffixPattern = (String) fields.get("posSuffixPattern", "");
-        String negPrefixPattern = (String) fields.get("negPrefixPattern", "-");
-        String negSuffixPattern = (String) fields.get("negSuffixPattern", "");
-
-        int multiplier = fields.get("multiplier", 1);
-        byte groupingSize = fields.get("groupingSize", (byte) 3);
-        // BEGIN android-added
-        boolean groupingUsed = fields.get("groupingUsed", true);
-        // END android-added
-        boolean decimalSeparatorAlwaysShown = fields.get(
-                "decimalSeparatorAlwaysShown", false);
-        boolean parseBigDecimal = fields.get("parseBigDecimal", false);
-        symbols = (DecimalFormatSymbols) fields.get("symbols", null);
-
-        int maximumIntegerDigits = fields.get("maximumIntegerDigits", 309);
-        int minimumIntegerDigits = fields.get("minimumIntegerDigits", 309);
-        int maximumFractionDigits = fields.get("maximumFractionDigits", 340);
-        int minimumFractionDigits = fields.get("minimumFractionDigits", 340);
-        int serialVersionOnStream = fields.get("serialVersionOnStream", 0);
-
-        Locale locale = (Locale) Format.getInternalField("locale", symbols);
         // BEGIN android-changed
+        ObjectInputStream.GetField fields = stream.readFields();
+        this.symbols = (DecimalFormatSymbols) fields.get("symbols", null);
+
         initNative("");
-        // END android-changed
-        dform.setPositivePrefix(positivePrefix);
-        dform.setPositiveSuffix(positiveSuffix);
-        dform.setNegativePrefix(negativePrefix);
-        dform.setNegativeSuffix(negativeSuffix);
-        setInternalField("posPrefixPattern", dform, posPrefixPattern);
-        setInternalField("posSuffixPattern", dform, posSuffixPattern);
-        setInternalField("negPrefixPattern", dform, negPrefixPattern);
-        setInternalField("negSuffixPattern", dform, negSuffixPattern);
-        dform.setMultiplier(multiplier);
-        dform.setGroupingSize(groupingSize);
-        // BEGIN android-added
-        dform.setGroupingUsed(groupingUsed);
-        // END android-added
-        dform.setDecimalSeparatorAlwaysShown(decimalSeparatorAlwaysShown);
-        setMinimumIntegerDigits(minimumIntegerDigits);
+        dform.setPositivePrefix((String) fields.get("positivePrefix", ""));
+        dform.setPositiveSuffix((String) fields.get("positiveSuffix", ""));
+        dform.setNegativePrefix((String) fields.get("negativePrefix", "-"));
+        dform.setNegativeSuffix((String) fields.get("negativeSuffix", ""));
+        dform.setMultiplier(fields.get("multiplier", 1));
+        dform.setGroupingSize(fields.get("groupingSize", (byte) 3));
+        dform.setGroupingUsed(fields.get("groupingUsed", true));
+        dform.setDecimalSeparatorAlwaysShown(fields.get("decimalSeparatorAlwaysShown", false));
+
+        final int maximumIntegerDigits = fields.get("maximumIntegerDigits", 309);
+        final int minimumIntegerDigits = fields.get("minimumIntegerDigits", 309);
+        final int maximumFractionDigits = fields.get("maximumFractionDigits", 340);
+        final int minimumFractionDigits = fields.get("minimumFractionDigits", 340);
         // BEGIN android-changed: tell ICU what we want, then ask it what we can have, and then
         // set that in our Java object. This isn't RI-compatible, but then very little of our
         // behavior in this area is, and it's not obvious how we can second-guess ICU (or tell
@@ -1307,41 +1271,18 @@
         // because ICU doesn't seem to have its own ideas about the other options.
         dform.setMaximumIntegerDigits(maximumIntegerDigits);
         super.setMaximumIntegerDigits(dform.getMaximumIntegerDigits());
-        // END android-changed
+
+        setMinimumIntegerDigits(minimumIntegerDigits);
         setMinimumFractionDigits(minimumFractionDigits);
         setMaximumFractionDigits(maximumFractionDigits);
-        setParseBigDecimal(parseBigDecimal);
+        setParseBigDecimal(fields.get("parseBigDecimal", false));
 
-        if (serialVersionOnStream < 3) {
+        if (fields.get("serialVersionOnStream", 0) < 3) {
             setMaximumIntegerDigits(super.getMaximumIntegerDigits());
             setMinimumIntegerDigits(super.getMinimumIntegerDigits());
             setMaximumFractionDigits(super.getMaximumFractionDigits());
             setMinimumFractionDigits(super.getMinimumFractionDigits());
         }
-    }
-
-    /*
-     * Sets private field value by reflection.
-     * 
-     * @param fieldName the field name to be set @param target the object which
-     * field to be set @param value the value to be set
-     */
-    private void setInternalField(final String fieldName, final Object target,
-            final Object value) {
-        AccessController
-                .doPrivileged(new PrivilegedAction<java.lang.reflect.Field>() {
-                    public java.lang.reflect.Field run() {
-                        java.lang.reflect.Field field = null;
-                        try {
-                            field = target.getClass().getDeclaredField(
-                                    fieldName);
-                            field.setAccessible(true);
-                            field.set(target, value);
-                        } catch (Exception e) {
-                            return null;
-                        }
-                        return field;
-                    }
-                });
+        // END android-changed
     }
 }
diff --git a/libcore/text/src/main/java/java/text/Format.java b/libcore/text/src/main/java/java/text/Format.java
index 567b0f6..18b0490 100644
--- a/libcore/text/src/main/java/java/text/Format.java
+++ b/libcore/text/src/main/java/java/text/Format.java
@@ -216,32 +216,6 @@
      */
     public abstract Object parseObject(String string, ParsePosition position);
 
-    /*
-     * Gets private field value by reflection.
-     * 
-     * @param fieldName the field name to be set @param target the object which
-     * field to be gotten
-     */
-    static Object getInternalField(final String fieldName, final Object target) {
-        Object value = AccessController
-                .doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        Object result = null;
-                        java.lang.reflect.Field field = null;
-                        try {
-                            field = target.getClass().getDeclaredField(
-                                    fieldName);
-                            field.setAccessible(true);
-                            result = field.get(target);
-                        } catch (Exception e1) {
-                            return null;
-                        }
-                        return result;
-                    }
-                });
-        return value;
-    }
-
     static boolean upTo(String string, ParsePosition position,
             StringBuffer buffer, char stop) {
         int index = position.getIndex(), length = string.length();
diff --git a/libcore/text/src/main/java/java/text/SimpleDateFormat.java b/libcore/text/src/main/java/java/text/SimpleDateFormat.java
index a67c7e6..20fff63 100644
--- a/libcore/text/src/main/java/java/text/SimpleDateFormat.java
+++ b/libcore/text/src/main/java/java/text/SimpleDateFormat.java
@@ -509,11 +509,6 @@
 
     // BEGIN android-removed
     // SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat){
-    //     this(locale);
-    //     this.icuFormat = icuFormat;
-    //     this.icuFormat.setTimeZone(com.ibm.icu.util.TimeZone.getTimeZone(tzId));
-    //     pattern = (String)Format.getInternalField("pattern", icuFormat); //$NON-NLS-1$
-    //     formatData = new DateFormatSymbols(locale);
     // }
     // END android-removed
     
diff --git a/libcore/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java b/libcore/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java
index b92e37b..7a615d5 100644
--- a/libcore/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java
+++ b/libcore/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java
@@ -776,17 +776,17 @@
         // Values based on Java 1.5 RI DecimalFormatSymbols for Locale.FRANCE
         /*
          * currency = [EUR]
-         * currencySymbol = [€][U+20ac]
+         * currencySymbol = [U+20ac] // EURO SIGN
          * decimalSeparator = [,][U+002c]
          * digit = [#][U+0023]
-         * groupingSeparator = [ ][U+00a0]
-         * infinity = [∞][U+221e]
+         * groupingSeparator = [U+00a0] // NON-BREAKING SPACE
+         * infinity = [U+221e] // INFINITY
          * internationalCurrencySymbol = [EUR]
          * minusSign = [-][U+002d]
          * monetaryDecimalSeparator = [,][U+002c]
-         * naN = [�][U+fffd]
+         * naN = [U+fffd] // REPLACEMENT CHARACTER
          * patternSeparator = [;][U+003b]
-         * perMill = [‰][U+2030]
+         * perMill = [U+2030] // PER MILLE
          * percent = [%][U+0025]
          * zeroDigit = [0][U+0030]
          */
@@ -800,6 +800,8 @@
         assertEquals('-', dfs.getMinusSign());
         assertEquals(',', dfs.getMonetaryDecimalSeparator());
         // RI's default NaN is U+FFFD, Harmony's is based on ICU
+        // This suggests an RI bug, assuming that non-UTF8 bytes are UTF8 and
+        // getting a conversion failure.
         assertEquals("\uFFFD", dfs.getNaN());
         assertEquals('\u003b', dfs.getPatternSeparator());
         assertEquals('\u2030', dfs.getPerMill());
diff --git a/libcore/xml/src/main/java/org/apache/xml/dtm/DTMException.java b/libcore/xml/src/main/java/org/apache/xml/dtm/DTMException.java
index ebb3024..030dc1f 100644
--- a/libcore/xml/src/main/java/org/apache/xml/dtm/DTMException.java
+++ b/libcore/xml/src/main/java/org/apache/xml/dtm/DTMException.java
@@ -323,7 +323,7 @@
 
         boolean isJdk14OrHigher = false;
         try {
-            Throwable.class.getMethod("getCause",null);
+            Throwable.class.getMethod("getCause", (Class<?>) null);
             isJdk14OrHigher = true;
         } catch (NoSuchMethodException nsme) {
             // do nothing
@@ -357,12 +357,12 @@
                 try {
                     Method meth =
                         ((Object) exception).getClass().getMethod("getException",
-                            null);
+                            (Class<?>) null);
     
                     if (null != meth) {
                         Throwable prev = exception;
     
-                        exception = (Throwable) meth.invoke(exception, null);
+                        exception = (Throwable) meth.invoke(exception, (Class<?>) null);
     
                         if (prev == exception) {
                             break;
diff --git a/libcore/xml/src/main/java/org/apache/xpath/XPathException.java b/libcore/xml/src/main/java/org/apache/xpath/XPathException.java
index b5e682a..315a5d6 100644
--- a/libcore/xml/src/main/java/org/apache/xpath/XPathException.java
+++ b/libcore/xml/src/main/java/org/apache/xpath/XPathException.java
@@ -267,7 +267,7 @@
     
     boolean isJdk14OrHigher = false;
     try {
-        Throwable.class.getMethod("getCause",null);
+        Throwable.class.getMethod("getCause", (Class<?>) null);
         isJdk14OrHigher = true;
     } catch (NoSuchMethodException nsme) {
         // do nothing
diff --git a/libcore/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java b/libcore/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
index 2b8bb5c..ca7cf71 100644
--- a/libcore/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
+++ b/libcore/xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
@@ -347,8 +347,6 @@
         method = "parse",
         args = {java.io.File.class, org.xml.sax.helpers.DefaultHandler.class}
     )
-    @KnownFailure("The default handler doesn't get the qName value supplied. " +
-            "We either need to change the test, or fix the parser.")
     public void test_parseLjava_io_FileLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -456,8 +454,6 @@
         method = "parse",
         args = {org.xml.sax.InputSource.class, org.xml.sax.helpers.DefaultHandler.class}
     )
-    @KnownFailure("The default handler doesn't get the qName value supplied. " +
-            "We either need to change the test, or fix the parser.")
     public void test_parseLorg_xml_sax_InputSourceLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -623,8 +619,6 @@
         method = "parse",
         args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
     )
-    @KnownFailure("The default handler doesn't get the qName value supplied. " +
-            "We either need to change the test, or fix the parser.")
     public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -675,8 +669,6 @@
         method = "parse",
         args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class, java.lang.String.class}
     )
-    @KnownFailure("The default handler doesn't get the qName value supplied. " +
-            "We either need to change the test, or fix the parser.")
     public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String() {
         for(int i = 0; i < list_wf.length; i++) {
             try {
@@ -952,8 +944,6 @@
         method = "parse",
         args = {java.lang.String.class, org.xml.sax.helpers.DefaultHandler.class}
     )
-    @KnownFailure("The default handler doesn't get the qName value supplied. " +
-            "We either need to change the test, or fix the parser.")
     public void test_parseLjava_lang_StringLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -1174,4 +1164,3 @@
     }
     
 }
-
diff --git a/vm/AllocTracker.c b/vm/AllocTracker.c
index 9649e68..9fb1c4d 100644
--- a/vm/AllocTracker.c
+++ b/vm/AllocTracker.c
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 /*
  * Allocation tracking and reporting.  We maintain a circular buffer with
  * the most recent allocations.  The data can be viewed through DDMS.
@@ -37,10 +38,12 @@
  *
  * TODO: consider making the parameters configurable, so DDMS can decide
  * how many allocations it wants to see and what the stack depth should be.
+ * Changing the window size is easy, changing the max stack depth is harder
+ * because we go from an array of fixed-size structs to variable-sized data.
  */
 #include "Dalvik.h"
 
-#define kMaxAllocRecordStackDepth   8       /* max 255 */
+#define kMaxAllocRecordStackDepth   16      /* max 255 */
 #define kNumAllocRecords            512     /* MUST be power of 2 */
 
 /*
@@ -108,8 +111,9 @@
     dvmLockMutex(&gDvm.allocTrackerLock);
 
     if (gDvm.allocRecords == NULL) {
-        LOGI("Enabling alloc tracker (%d entries / %d bytes)\n",
-            kNumAllocRecords, sizeof(AllocRecord) * kNumAllocRecords);
+        LOGI("Enabling alloc tracker (%d entries, %d frames --> %d bytes)\n",
+            kNumAllocRecords, kMaxAllocRecordStackDepth,
+            sizeof(AllocRecord) * kNumAllocRecords);
         gDvm.allocRecordHead = gDvm.allocRecordCount = 0;
         gDvm.allocRecords =
             (AllocRecord*) malloc(sizeof(AllocRecord) * kNumAllocRecords);