[TIMOB-4771] Android: apiXmlNodeCloneNode fails with exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-04T16:15:57.000+0000 |
Affected Version/s | Release 1.7.1 |
Fix Version/s | Sprint 2011-30, Release 1.8.0 |
Components | Android |
Labels | module_xml, qe-testadded |
Reporter | Opie Cyrus |
Assignee | Eric Merriman |
Created | 2011-07-25T15:17:27.000+0000 |
Updated | 2014-06-19T12:46:11.000+0000 |
Description
When trying to clone node, exception is thrown:
"07-25 16:29:33.160 13642 13651 E KrollMethod: (kroll$1: app://app.js) [7,2569] Exception calling kroll method cloneNode, invocation: null ]
07-25 16:29:33.160 13642 13651 E KrollMethod: org.w3c.dom.DOMException
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.NodeImpl.setNameNS(NodeImpl.java:228)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.ElementImpl.(ElementImpl.java:51)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.DocumentImpl.createElementNS(DocumentImpl.java:337)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.DocumentImpl.shallowCopy(DocumentImpl.java:157)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.DocumentImpl.cloneOrImportNode(DocumentImpl.java:209)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.apache.harmony.xml.dom.NodeImpl.cloneNode(NodeImpl.java:77)
07-25 16:29:33.160 13642 13651 E KrollMethod: at ti.modules.titanium.xml.NodeProxy.cloneNode(NodeProxy.java:122)
07-25 16:29:33.160 13642 13651 E KrollMethod: at ti.modules.titanium.xml.NodeProxyBindingGen$24.invoke(NodeProxyBindingGen.java:931)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.appcelerator.titanium.kroll.KrollCoverage$KrollFunctionCoverage.call(KrollCoverage.java:213)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.appcelerator.titanium.testharness.Test_harnessActivity$1.run(Test_harnessActivity.java:90)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:219)
07-25 16:29:33.160 13642 13651 E KrollMethod: at android.os.Handler.dispatchMessage(Handler.java:95)
07-25 16:29:33.160 13642 13651 E KrollMethod: at android.os.Looper.loop(Looper.java:143)
07-25 16:29:33.160 13642 13651 E KrollMethod: at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
07-25 16:29:33.551 13642 13651 D dalvikvm: GC_FOR_MALLOC freed 9833 objects / 572048 bytes in 95ms
07-25 16:29:33.840 13642 13651 W TiConvert: (kroll$1: app://app.js) [14,3258] Unsupported type class org.appcelerator.kroll.KrollProxy$1
07-25 16:29:33.918 13642 13651 D dalvikvm: GC_FOR_MALLOC freed 9055 objects / 556920 bytes in 54ms"
Google bug that is fixed in Honeycomb: http://code.google.com/p/android/issues/detail?id=2735
Changed
NodeProxy
code to simply display warning whencloneNode
called in pre-Honeycomb versions. Use this as test case and try both in pre-Honeycomb and Honeycomb or later:* In pre-Honeycomb (pre-3.0) you should get a DOMException on screen. Check logcat, look above the exception stack traces, and make sure you see two warnings, one from the Javascript code above (and thus beginning with
W/TiAPI
) and one from ourNodeProxy
(thus beginning withW/TiNodeProxy
). * In Honeycomb or later, you should get no exceptions, and you should not see any of the two warning messages described in the previous bullet.review and test.
Tested with 1.8.0.1.v20111205164258 v8/rhino on Galaxy 10.1 (3.1) Droid 1 (2.2.2) Nexus S (2.3.6) Emulator (4.0) Pre-HoneyComb: Do not get DOMException but get this warning W/TiAPI ( 1885): Call to .clone() will probably throw DOMException. You should also see another warning from core code prior to the exception. W/TiNodeProxy( 1885): (KrollRuntimeThread) [497,711] cloneNode will often throw exception in versions prior to Honeycomb.
open to add label
Reopening/closing to add/remove labels