{"issue":{"created_at":"2011-10-27T21:16:08Z","state":"open","updated_at":"2011-12-01T12:11:43Z","comments":1,"user":{"gravatar_id":"b4a400c51bda0f616eb4fab16dd3a275","id":148066,"url":"https://api.github.com/users/plowman","login":"plowman","avatar_url":"https://secure.gravatar.com/avatar/b4a400c51bda0f616eb4fab16dd3a275?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"This is a simple fix that takes care of annoying log spam. Would love it if a Facebook engineer could pull this. :-)\r\n\r\nFor each request made to facebook using this library, 5-10 instances of the following message is logged:\r\n```10-27 13:28:04.342: WARN/Bundle(3671): Key format expected byte[] but value was a java.lang.String.  The default value <null> was returned.\r\n10-27 13:28:04.346: WARN/Bundle(3671): Attempt to cast generated internal exception:\r\n        java.lang.ClassCastException: java.lang.String\r\n        at android.os.Bundle.getByteArray(Bundle.java:1305)\r\n        at com.facebook.android.Util.encodePostBody(Util.java:52)\r\n        at com.facebook.android.Util.openUrl(Util.java:173)\r\n        at com.facebook.android.Facebook.request(Facebook.java:544)\r\n        at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:239)\r\n```\r\n\r\nThis is caused by calling Bundle.getByteArray() on a key that maps to a value which cannot be cast to a byte array, for example a String. For example, this code would cause the above log message:\r\n\r\n```\r\nBundle bundle = new Bundle();\r\nbundle.putString(\"format\", \"json\");\r\nbundle.getByteArray(\"format\");\r\n```\r\n\r\nSince we never need to call setByteArray() on this Bundle, and since all of our parameters are just plain Strings, I have changed a few lines to use Bundle.getString() and Bundle.setString() exclusively, and then check that Bundle.get() returns a String where we expect one.\r\n\r\nI have tested this against all the API requests my client uses. The API requests continue to work and the log message no longer appears.","assignee":null,"id":2072801,"labels":[],"pull_request":{"patch_url":"https://github.com/facebook/facebook-android-sdk/pull/246.patch","html_url":"https://github.com/facebook/facebook-android-sdk/pull/246","diff_url":"https://github.com/facebook/facebook-android-sdk/pull/246.diff"},"number":246,"title":"Fix for Issue #160: ClassCastExceptions filling up the logs.","html_url":"https://github.com/facebook/facebook-android-sdk/issues/246","closed_at":null,"url":"https://api.github.com/repos/facebook/facebook-android-sdk/issues/246","milestone":null},"action":"created","comment":{"created_at":"2011-12-01T12:11:43Z","updated_at":"2011-12-01T12:11:43Z","user":{"gravatar_id":"3d417dd85d3a8faad755cd23593eacdf","id":555642,"url":"https://api.github.com/users/gurnetko","login":"gurnetko","avatar_url":"https://secure.gravatar.com/avatar/3d417dd85d3a8faad755cd23593eacdf?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"This bug prevents from posting any data. I don't see necessity of using `byte[]` as SDK supports only string data for now","id":2974010,"url":"https://api.github.com/repos/facebook/facebook-android-sdk/issues/comments/2974010"}}