{ "id": "85117", "key": "TIMOB-7829", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-03-20T04:32:49.000+0000", "created": "2012-01-19T09:18:45.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:26:56.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": "h4. Problem Description\r\nInteger format strings that contain positional arguments result in an IllegalFormatConversionException when passed to String.format(). If the positional part of the format is removed, the call works fine.\r\n\r\nh4. Expected Results\r\nStrings with positional should work fine.\r\n\r\nh4. Actual results\r\nThe strings with positional information are throwing an exception. \r\n\r\nh4. Test case \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nTi.API.info(String.format('non-positional: %d', 1));\r\nTi.API.info(String.format('positional: %1$d', 1));\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\nh4. Crashlog\r\n{code}\r\n/TiAPI ( 275): non-positional: 1\r\nE/TitaniumModule( 275): (KrollRuntimeThread) [363,3214] Error in string format\r\nE/TitaniumModule( 275): java.util.IllegalFormatConversionException: d is incompatible with java.lang.Double\r\nE/TitaniumModule( 275): \tat java.util.Formatter$Transformer.badArgumentType(Formatter.java:1452)\r\nE/TitaniumModule( 275): \tat java.util.Formatter$Transformer.transformFromInteger(Formatter.java:1683)\r\nE/TitaniumModule( 275): \tat java.util.Formatter$Transformer.transform(Formatter.java:1410)\r\nE/TitaniumModule( 275): \tat java.util.Formatter.doFormat(Formatter.java:1082)\r\nE/TitaniumModule( 275): \tat java.util.Formatter.format(Formatter.java:994)\r\nE/TitaniumModule( 275): \tat java.lang.String.format(String.java:2254)\r\nE/TitaniumModule( 275): \tat java.lang.String.format(String.java:2219)\r\nE/TitaniumModule( 275): \tat ti.modules.titanium.TitaniumModule.stringFormat(TitaniumModule.java:294)\r\nE/TitaniumModule( 275): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\nE/TitaniumModule( 275): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:116)\r\nE/TitaniumModule( 275): \tat org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:207)\r\nE/TitaniumModule( 275): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:136)\r\nE/TitaniumModule( 275): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/TitaniumModule( 275): \tat android.os.Looper.loop(Looper.java:123)\r\nE/TitaniumModule( 275): \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:102)\r\nI/TiAPI ( 275): null\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: IllegalFormatConversionException in String.format for integers with positional arguments", "creator": { "name": "pegli", "key": "pegli", "displayName": "Paul Mietz Egli", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pegli", "key": "pegli", "displayName": "Paul Mietz Egli", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.7.2\r\nAndroid 2.2 v8 \r\nTitanium SDK 1.9CI/1.8.0.1", "comment": { "comments": [ { "id": "179870", "author": { "name": "pegli", "key": "pegli", "displayName": "Paul Mietz Egli", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Workaround is to use \".0f\" as the format instead of \"d\":\r\n\r\n{code:javascript}\r\nTi.API.info(String.format('positional: %1$.0f', 1));\r\n{code}", "updateAuthor": { "name": "pegli", "key": "pegli", "displayName": "Paul Mietz Egli", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-19T09:20:42.000+0000", "updated": "2012-01-19T09:29:32.000+0000" }, { "id": "187998", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I get the same exception when launching KS from current master branch on:\r\n\r\nSDK build: 2.0.0.v20120321231752\r\nRuntime: V8\r\nTitanium Studio, build: 2.0.0.201203211914\r\nOS: Linux 11.10\r\nDevice: Droid 3 (2.3.4)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-22T10:10:57.000+0000", "updated": "2012-03-22T10:10:57.000+0000" }, { "id": "243114", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "log:\r\n\r\n[INFO][TiAPI (28480)] non-positional: 1\r\n[INFO][TiAPI (28480)] positional: 1\r\n\r\n\r\nIssue does not reproduces \r\n\r\nTested with\r\n\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0 (03/11/13 15:43 0c88429)\r\nTitanium SDK version: 3.0.2 (02/07/13 16:46 a4def81)\r\nDevice: Samsung galaxy s duos Android version: 4.0.4\r\n\r\njithinpv", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T04:32:49.000+0000", "updated": "2013-03-20T04:32:49.000+0000" }, { "id": "414443", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:26:56.000+0000", "updated": "2017-03-21T21:26:56.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }