{ "id": "115327", "key": "TIMOB-14081", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15498", "description": "2013 Sprint 12 API", "name": "2013 Sprint 12 API", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15110", "description": "2013 Sprint 12", "name": "2013 Sprint 12", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-06-03T18:56:33.000+0000", "created": "2013-06-01T06:25:44.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam" ], "versions": [], "issuelinks": [ { "id": "29241", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "106881", "key": "TIMOB-12139", "fields": { "summary": "Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T18:25:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem description\r\nWhen trying to paste a string that is larger than the maximum allowed for a text field (e.g. greater than maxLength), the app crashes.\r\n\r\nh2. Steps to reproduce\r\nUSe the following code. The text field has a max length of 10 characters. Copy a string of at least 11 (e.g. '12345678910') and paste into it. The app will immediatly crash. Works fine in native Android.\r\n\r\nh2. Error Log\r\n06-01 07:19:59.548: E/TiApplication(18418): (main) [12162,12162] Sending event: exception on thread: main msg:java.lang.IndexOutOfBoundsException: setSpan (10 ... 10) ends beyond length 0; Titanium 3.1.0,2013/04/15 18:46,57634ef\r\n06-01 07:19:59.548: E/TiApplication(18418): java.lang.IndexOutOfBoundsException: setSpan (10 ... 10) ends beyond length 0\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1016)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:588)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.Selection.setSelection(Selection.java:76)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.Selection.setSelection(Selection.java:87)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.EditText.setSelection(EditText.java:94)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat ti.modules.titanium.ui.widget.TiUIText.onTextChanged(TiUIText.java:285)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.TextView.sendOnTextChanged(TextView.java:7231)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.TextView.handleTextChanged(TextView.java:7290)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:8880)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:962)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:496)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.TextView.paste(TextView.java:8275)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.TextView.onTextContextMenuItem(TextView.java:8036)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.widget.Editor$ActionPopupWindow.onClick(Editor.java:2862)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.view.View.performClick(View.java:4204)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.view.View$PerformClick.run(View.java:17355)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.os.Handler.handleCallback(Handler.java:725)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.os.Handler.dispatchMessage(Handler.java:92)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.os.Looper.loop(Looper.java:137)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat android.app.ActivityThread.main(ActivityThread.java:5041)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)\r\n06-01 07:19:59.548: E/TiApplication(18418): \tat dalvik.system.NativeStart.main(Native Method)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): FATAL EXCEPTION: main\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): java.lang.IndexOutOfBoundsException: setSpan (10 ... 10) ends beyond length 0\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1016)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:588)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.Selection.setSelection(Selection.java:76)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.Selection.setSelection(Selection.java:87)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.EditText.setSelection(EditText.java:94)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat ti.modules.titanium.ui.widget.TiUIText.onTextChanged(TiUIText.java:285)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.TextView.sendOnTextChanged(TextView.java:7231)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.TextView.handleTextChanged(TextView.java:7290)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:8880)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:962)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:496)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.TextView.paste(TextView.java:8275)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.TextView.onTextContextMenuItem(TextView.java:8036)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.widget.Editor$ActionPopupWindow.onClick(Editor.java:2862)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.view.View.performClick(View.java:4204)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.view.View$PerformClick.run(View.java:17355)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.os.Handler.handleCallback(Handler.java:725)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.os.Handler.dispatchMessage(Handler.java:92)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.os.Looper.loop(Looper.java:137)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat android.app.ActivityThread.main(ActivityThread.java:5041)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)\r\n06-01 07:19:59.588: E/AndroidRuntime(18418): \tat dalvik.system.NativeStart.main(Native Method)\r\n", "attachment": [], "flagged": false, "summary": "Android: app crashes when trying to paste more than maxLength characters in text field", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android 4.1\r\nSDK 3.1\r\nSDK 3.0.2", "comment": { "comments": [ { "id": "255554", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Should already be fixed in 3.1.1. The fix is in [PR#4072|https://github.com/appcelerator/titanium_mobile/pull/4072] and [PR#4193|https://github.com/appcelerator/titanium_mobile/pull/4193] for TIMOB-12139.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-03T18:53:39.000+0000", "updated": "2013-06-03T18:57:41.000+0000" }, { "id": "415336", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate with reference to the linked issues above.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T18:25:35.000+0000", "updated": "2017-03-23T18:25:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }