{ "id": "105444", "key": "AC-2199", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-04-01T22:14:24.000+0000", "created": "2012-11-22T14:26:26.000+0000", "labels": [ "android", "arguments", "kroll", "optional", "v8" ], "versions": [], "issuelinks": [], "assignee": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:11.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I am trying to add default values support to Ti.App.Properties.\r\nSomething like this\r\n{code}\r\n@Kroll.method\r\npublic double getDouble(String key, @Kroll.argument(optional=true) double defaultValue)\r\n{\r\n\treturn appProperties.getDouble(key, defaultValue);\r\n}\r\n{code}\r\nIf i try to compile with that code i get an error:\r\n{code}\r\n[exec] src/native/../../generated/ti.modules.titanium.app.properties.PropertiesModule.cpp:314:22: error: invalid suffix \"d\" on integer constant\r\n[exec] make: *** [/Volumes/data/dev/titanium/titanium_mobile/android/runtime/v8/obj/local/armeabi/objs/kroll-v8/__/__/generated/ti.modules.titanium.app.properties.PropertiesModule.o] Error 1\r\n[exec] make: *** Waiting for unfinished jobs....\r\n{code}", "attachment": [], "flagged": false, "summary": "[android] v8 optional float/double argument failure", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Titanium 3.1.0 master\r\nandroid v8", "comment": { "comments": [ { "id": "228336", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "I had another at this using another method\n{code}\n@Kroll.method\npublic double getDouble(String key, @Kroll.argument(optional=true) Object obj)\n{\n\tdouble defaultValue = 0D;\n\tif (obj != null) {\n\t\tdefaultValue = TiConvert.toDouble(obj);\n\t}\n\treturn appProperties.getDouble(key, defaultValue);\n}\n{code}\nAnd it worked. I am actually wondering if what i was doing was correct :s", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-11-22T15:15:19.000+0000", "updated": "2012-11-22T15:15:19.000+0000" }, { "id": "245048", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "For assistance, please use the Q&A:\r\nhttp://developer.appcelerator.com/questions/newest", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-01T22:14:24.000+0000", "updated": "2013-04-01T22:14:24.000+0000" }, { "id": "328959", "author": { "name": "s.stefanek", "key": "s.stefanek", "displayName": "Szymon Tomasz Stefanek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This bug is still present in 3.4.0GA.\r\nThe cpp code generator adds invalid suffixes on float and double optional Kroll.arguments.\r\n", "updateAuthor": { "name": "s.stefanek", "key": "s.stefanek", "displayName": "Szymon Tomasz Stefanek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-22T01:51:03.000+0000", "updated": "2014-10-22T01:51:03.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }