{ "id": "63274", "key": "TIMOB-2642", "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": "11235", "name": "Release 1.6.0 M02", "archived": true, "released": true, "releaseDate": "2010-12-27" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:59:41.000+0000", "created": "2011-04-15T03:25:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "kroll", "release-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2011-04-17T01:59:41.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": "{html}

Kroll get method returns undefined due to the \"get\" name check\nin KrollBindingUtils.java : createAccessorMethod never actually\nbeing passed when a get method is invoked. The name that is checked\nfor either \"get\" or \"set\" is actually the name of the property\nwithout either of the prefixed modifiers.

\n

The \"get\" check always fails so the execution passes to the\n\"set\" block and so set calls work correctly. When a get call is\nmade, a null value is returned because the set logic is executed\nbut no argument is passed in for a new value like a real set call\nwould contain.

{html}", "attachment": [ { "id": "18182", "filename": "app.js", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:25:38.000+0000", "size": 668, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android : Kroll get method for properties does not work correctly", "creator": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "129063", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [717ec1ad88b14e60a630c6aaa23bf2172627e208])\n[#2642 state:fixed-in-qa] Modified Kroll property\nbinding so get methods will return actual values

\n

createAccessorMethod now takes a boolean isSet argument to\nspecifc if the accessor request is for the get or set method. Value\nreturned is not the actual stored value rather than null.
\n\nhttps://github.com/appcelerator/titanium_mobile/commit/717ec1ad88b1...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:39.000+0000", "updated": "2011-04-15T03:25:39.000+0000" }, { "id": "129064", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

Please verify the fix via the attached test app. Basically, if\nyou are able to set the property via both methods made available in\nthe test app then the fix is good. The issue was with the default\nkroll generated get methods. So before the win.getTitle()call would\nfail.

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:25:39.000+0000", "updated": "2011-04-15T03:25:39.000+0000" }, { "id": "129065", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Verified on G1/1.6 and Nexus One/2.2.1 using build #e1cb22a

\n

Used this modified version of app.js. It wasn't using the\nproperty.

\n
\nvar win = Titanium.UI.createWindow({  \n    title:'Window 1',\n    backgroundColor:'#fff',\n    navBarHidden: false\n});\n\nvar button1 = Ti.UI.createButton({\n    title: 'Set by method',\n    top: 50\n});\nbutton1.addEventListener('click', function(e) {\n    win.setTitle(\"New title set by method\");\n\n    var alertDialog = Ti.UI.createAlertDialog({message: win.getTitle()});\n    alertDialog.show();\n});\nwin.add(button1);\n\nvar button2 = Ti.UI.createButton({\n    title: 'Set by property',\n    top: 150\n});\nbutton2.addEventListener('click', function(e) {\n    win.title = \"New title set by property\";\n\n    var alertDialog = Ti.UI.createAlertDialog({message: win.title});\n    alertDialog.show();\n});\nwin.add(button2);\n\nwin.open();\n
{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:39.000+0000", "updated": "2011-04-15T03:25:39.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }