[TIMOB-8074] Android: String.format fails in android.string Drillbit test
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-19T08:22:35.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | Android |
Labels | regression |
Reporter | Marshall Culpepper |
Assignee | Josh Roesslein |
Created | 2012-03-18T22:07:39.000+0000 |
Updated | 2012-03-19T16:22:22.000+0000 |
Description
Run the
android.string
drillbit test for V8, and you should see this error for the stringFormat
test:
should be: "Pi to 2 decimal places is 3.14", was: "null"
This might be related to the fix we made in TypeConverter.cpp around line 468 that does integer casting. String.format in Java may not accept an "int" primitive for "%f" format strings.
This was caused due to how we converted %d -> %f in the stringFormat() method. With the change to V8's conversion layer we no longer require this, but still need it for Rhino which always gives us double values. Will add a conditional to only enable this when running with Rhino runtime.
Sent [Pull Request #1738](https://github.com/appcelerator/titanium_mobile/pull/1738) to fix this regression. All test cases in android.string appear to be passing for both runtimes with this change.
Tested with version=2.0.0 module_apiversion=2 timestamp=03/19/12 16:15 githash=a1ddab3 with v8/rhino on Nexus Galaxy 4.0.2