Closed Bug 810248 Opened 12 years ago Closed 12 years ago

java.lang.UnsupportedOperationException: at org.mozilla.gecko.GeckoEditable.length(GeckoEditable.java)

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect, P1)

19 Branch
ARM
Android
defect

Tracking

(firefox18 unaffected, firefox19 fixed)

RESOLVED FIXED
Firefox 19
Tracking Status
firefox18 --- unaffected
firefox19 --- fixed

People

(Reporter: scoobidiver, Assigned: jchen)

References

Details

(Keywords: crash, regression, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file, 1 obsolete file)

There are two crashes from 19.0a1/20121104, including bp-b4ebb2eb-dff5-4281-9a45-a71b52121109.

java.lang.UnsupportedOperationException
	at org.mozilla.gecko.GeckoEditable.length(GeckoEditable.java:802)
	at org.mozilla.gecko.GeckoEditable.clear(GeckoEditable.java:734)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:507)
	at org.mozilla.gecko.GeckoEditable.invoke(GeckoEditable.java:606)
	at $Proxy0.clear(Native Method)
	at org.mozilla.gecko.GeckoInputConnection.performContextMenuAction(GeckoInputConnection.java:125)
	at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:310)
	at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:79)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:130)
	at android.app.ActivityThread.main(ActivityThread.java:3687)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:507)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.UnsupportedOperationException%3A+at+org.mozilla.gecko.GeckoEditable.length%28GeckoEditable.java%29
Some of the methods in GeckoEditable call length() on GeckoEditable itself instead of through the proxy. This patch changes all these length() calls to go through the proxy.
Attachment #680077 - Flags: review?(cpeterson)
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Priority: -- → P1
Blocks: 805162
Keywords: regression
Version: Trunk → Firefox 19
Component: General → Keyboards and IME
Comment on attachment 680077 [details] [diff] [review]
Fix GeckoEditable call on wrong object (v1)

Review of attachment 680077 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/GeckoEditable.java
@@ +665,5 @@
>      // Appendable interface
>  
>      @Override
>      public Editable append(CharSequence text) {
> +        return replace(mProxy.length(), mProxy.length(), text, 0, text.length());

1. If the problem is that GeckoEditable.length() is throwing an UnsupportedOperationException, why not change GeckoEditable.length() to call mProxy.length() instead of avoid calling GeckoEditable.length()?

2. Why not implement all of GeckoEditable's CharSequence overrides to call mProxy instead of throwing UnsupportedOperationExceptions?
Attachment #680077 - Flags: review?(cpeterson) → review-
Comment on attachment 680077 [details] [diff] [review]
Fix GeckoEditable call on wrong object (v1)

Review of attachment 680077 [details] [diff] [review]:
-----------------------------------------------------------------

r+ after IRC discussion. Please add an error string to the UnsupportedOperationExceptions explaining that we want Android to call Editable via our proxy object, not through GeckoEditable's interface overrides.
Attachment #680077 - Flags: review- → review+
Added error strings. Carried over r+.
Attachment #680077 - Attachment is obsolete: true
Attachment #680374 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/d2458d28343c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: