{"action":"opened","number":2605,"pull_request":{"url":"https://api.github.com/repos/jruby/jruby/pulls/2605","id":29467778,"html_url":"https://github.com/jruby/jruby/pull/2605","diff_url":"https://github.com/jruby/jruby/pull/2605.diff","patch_url":"https://github.com/jruby/jruby/pull/2605.patch","issue_url":"https://api.github.com/repos/jruby/jruby/issues/2605","number":2605,"state":"open","locked":false,"title":"Fix File.read with UTF-16LE","user":{"login":"lumeet","id":7588782,"avatar_url":"https://avatars.githubusercontent.com/u/7588782?v=3","gravatar_id":"","url":"https://api.github.com/users/lumeet","html_url":"https://github.com/lumeet","followers_url":"https://api.github.com/users/lumeet/followers","following_url":"https://api.github.com/users/lumeet/following{/other_user}","gists_url":"https://api.github.com/users/lumeet/gists{/gist_id}","starred_url":"https://api.github.com/users/lumeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumeet/subscriptions","organizations_url":"https://api.github.com/users/lumeet/orgs","repos_url":"https://api.github.com/users/lumeet/repos","events_url":"https://api.github.com/users/lumeet/events{/privacy}","received_events_url":"https://api.github.com/users/lumeet/received_events","type":"User","site_admin":false},"body":"```shell\r\nFile.open(\"a.txt\", \"w+\") do |f|\r\n  f.write \"\\xFF\\xFE\"\r\n  f.close\r\nend\r\nFile.read(\"a.txt\", mode: \"rb:bom|utf-8\")\r\n```\r\n...results in...\r\n```\r\n<java.lang.ClassCastException: org.jruby.RubyNil cannot be cast to org.jruby.RubyFixnum>\r\n```\r\n\r\nA check for a null value seems to be missing after the BOM. \r\n\r\nThe `test_truncate_wbuf` removal is just general cleanup. It doesn't have anything to do with the fix. I guess it's ok. :)","created_at":"2015-02-17T18:59:03Z","updated_at":"2015-02-17T18:59:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jruby/jruby/pulls/2605/commits","review_comments_url":"https://api.github.com/repos/jruby/jruby/pulls/2605/comments","review_comment_url":"https://api.github.com/repos/jruby/jruby/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/2605/comments","statuses_url":"https://api.github.com/repos/jruby/jruby/statuses/36b929af73f1701ddc57c361dd150f9b63f4334a","head":{"label":"lumeet:file_bom_16le","ref":"file_bom_16le","sha":"36b929af73f1701ddc57c361dd150f9b63f4334a","user":{"login":"lumeet","id":7588782,"avatar_url":"https://avatars.githubusercontent.com/u/7588782?v=3","gravatar_id":"","url":"https://api.github.com/users/lumeet","html_url":"https://github.com/lumeet","followers_url":"https://api.github.com/users/lumeet/followers","following_url":"https://api.github.com/users/lumeet/following{/other_user}","gists_url":"https://api.github.com/users/lumeet/gists{/gist_id}","starred_url":"https://api.github.com/users/lumeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumeet/subscriptions","organizations_url":"https://api.github.com/users/lumeet/orgs","repos_url":"https://api.github.com/users/lumeet/repos","events_url":"https://api.github.com/users/lumeet/events{/privacy}","received_events_url":"https://api.github.com/users/lumeet/received_events","type":"User","site_admin":false},"repo":{"id":27502326,"name":"jruby","full_name":"lumeet/jruby","owner":{"login":"lumeet","id":7588782,"avatar_url":"https://avatars.githubusercontent.com/u/7588782?v=3","gravatar_id":"","url":"https://api.github.com/users/lumeet","html_url":"https://github.com/lumeet","followers_url":"https://api.github.com/users/lumeet/followers","following_url":"https://api.github.com/users/lumeet/following{/other_user}","gists_url":"https://api.github.com/users/lumeet/gists{/gist_id}","starred_url":"https://api.github.com/users/lumeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumeet/subscriptions","organizations_url":"https://api.github.com/users/lumeet/orgs","repos_url":"https://api.github.com/users/lumeet/repos","events_url":"https://api.github.com/users/lumeet/events{/privacy}","received_events_url":"https://api.github.com/users/lumeet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lumeet/jruby","description":"JRuby, an implementation of Ruby on the JVM","fork":true,"url":"https://api.github.com/repos/lumeet/jruby","forks_url":"https://api.github.com/repos/lumeet/jruby/forks","keys_url":"https://api.github.com/repos/lumeet/jruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lumeet/jruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lumeet/jruby/teams","hooks_url":"https://api.github.com/repos/lumeet/jruby/hooks","issue_events_url":"https://api.github.com/repos/lumeet/jruby/issues/events{/number}","events_url":"https://api.github.com/repos/lumeet/jruby/events","assignees_url":"https://api.github.com/repos/lumeet/jruby/assignees{/user}","branches_url":"https://api.github.com/repos/lumeet/jruby/branches{/branch}","tags_url":"https://api.github.com/repos/lumeet/jruby/tags","blobs_url":"https://api.github.com/repos/lumeet/jruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lumeet/jruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lumeet/jruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/lumeet/jruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lumeet/jruby/statuses/{sha}","languages_url":"https://api.github.com/repos/lumeet/jruby/languages","stargazers_url":"https://api.github.com/repos/lumeet/jruby/stargazers","contributors_url":"https://api.github.com/repos/lumeet/jruby/contributors","subscribers_url":"https://api.github.com/repos/lumeet/jruby/subscribers","subscription_url":"https://api.github.com/repos/lumeet/jruby/subscription","commits_url":"https://api.github.com/repos/lumeet/jruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/lumeet/jruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/lumeet/jruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/lumeet/jruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/lumeet/jruby/contents/{+path}","compare_url":"https://api.github.com/repos/lumeet/jruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lumeet/jruby/merges","archive_url":"https://api.github.com/repos/lumeet/jruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lumeet/jruby/downloads","issues_url":"https://api.github.com/repos/lumeet/jruby/issues{/number}","pulls_url":"https://api.github.com/repos/lumeet/jruby/pulls{/number}","milestones_url":"https://api.github.com/repos/lumeet/jruby/milestones{/number}","notifications_url":"https://api.github.com/repos/lumeet/jruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lumeet/jruby/labels{/name}","releases_url":"https://api.github.com/repos/lumeet/jruby/releases{/id}","created_at":"2014-12-03T18:52:33Z","updated_at":"2015-02-13T17:20:19Z","pushed_at":"2015-02-17T18:57:30Z","git_url":"git://github.com/lumeet/jruby.git","ssh_url":"git@github.com:lumeet/jruby.git","clone_url":"https://github.com/lumeet/jruby.git","svn_url":"https://github.com/lumeet/jruby","homepage":"http://www.jruby.org","size":158693,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jruby:master","ref":"master","sha":"6c8f7dde8636ff8dccf7aba929095126a5532f36","user":{"login":"jruby","id":55687,"avatar_url":"https://avatars.githubusercontent.com/u/55687?v=3","gravatar_id":"","url":"https://api.github.com/users/jruby","html_url":"https://github.com/jruby","followers_url":"https://api.github.com/users/jruby/followers","following_url":"https://api.github.com/users/jruby/following{/other_user}","gists_url":"https://api.github.com/users/jruby/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby/subscriptions","organizations_url":"https://api.github.com/users/jruby/orgs","repos_url":"https://api.github.com/users/jruby/repos","events_url":"https://api.github.com/users/jruby/events{/privacy}","received_events_url":"https://api.github.com/users/jruby/received_events","type":"Organization","site_admin":false},"repo":{"id":168370,"name":"jruby","full_name":"jruby/jruby","owner":{"login":"jruby","id":55687,"avatar_url":"https://avatars.githubusercontent.com/u/55687?v=3","gravatar_id":"","url":"https://api.github.com/users/jruby","html_url":"https://github.com/jruby","followers_url":"https://api.github.com/users/jruby/followers","following_url":"https://api.github.com/users/jruby/following{/other_user}","gists_url":"https://api.github.com/users/jruby/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby/subscriptions","organizations_url":"https://api.github.com/users/jruby/orgs","repos_url":"https://api.github.com/users/jruby/repos","events_url":"https://api.github.com/users/jruby/events{/privacy}","received_events_url":"https://api.github.com/users/jruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jruby/jruby","description":"JRuby, an implementation of Ruby on the JVM","fork":false,"url":"https://api.github.com/repos/jruby/jruby","forks_url":"https://api.github.com/repos/jruby/jruby/forks","keys_url":"https://api.github.com/repos/jruby/jruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jruby/jruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jruby/jruby/teams","hooks_url":"https://api.github.com/repos/jruby/jruby/hooks","issue_events_url":"https://api.github.com/repos/jruby/jruby/issues/events{/number}","events_url":"https://api.github.com/repos/jruby/jruby/events","assignees_url":"https://api.github.com/repos/jruby/jruby/assignees{/user}","branches_url":"https://api.github.com/repos/jruby/jruby/branches{/branch}","tags_url":"https://api.github.com/repos/jruby/jruby/tags","blobs_url":"https://api.github.com/repos/jruby/jruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jruby/jruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jruby/jruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/jruby/jruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jruby/jruby/statuses/{sha}","languages_url":"https://api.github.com/repos/jruby/jruby/languages","stargazers_url":"https://api.github.com/repos/jruby/jruby/stargazers","contributors_url":"https://api.github.com/repos/jruby/jruby/contributors","subscribers_url":"https://api.github.com/repos/jruby/jruby/subscribers","subscription_url":"https://api.github.com/repos/jruby/jruby/subscription","commits_url":"https://api.github.com/repos/jruby/jruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/jruby/jruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/jruby/jruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/jruby/jruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/jruby/jruby/contents/{+path}","compare_url":"https://api.github.com/repos/jruby/jruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jruby/jruby/merges","archive_url":"https://api.github.com/repos/jruby/jruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jruby/jruby/downloads","issues_url":"https://api.github.com/repos/jruby/jruby/issues{/number}","pulls_url":"https://api.github.com/repos/jruby/jruby/pulls{/number}","milestones_url":"https://api.github.com/repos/jruby/jruby/milestones{/number}","notifications_url":"https://api.github.com/repos/jruby/jruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jruby/jruby/labels{/name}","releases_url":"https://api.github.com/repos/jruby/jruby/releases{/id}","created_at":"2009-04-05T03:54:35Z","updated_at":"2015-02-17T17:10:16Z","pushed_at":"2015-02-17T17:10:16Z","git_url":"git://github.com/jruby/jruby.git","ssh_url":"git@github.com:jruby/jruby.git","clone_url":"https://github.com/jruby/jruby.git","svn_url":"https://github.com/jruby/jruby","homepage":"http://www.jruby.org","size":317646,"stargazers_count":2012,"watchers_count":2012,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":552,"mirror_url":null,"open_issues_count":723,"forks":552,"open_issues":723,"watchers":2012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jruby/jruby/pulls/2605"},"html":{"href":"https://github.com/jruby/jruby/pull/2605"},"issue":{"href":"https://api.github.com/repos/jruby/jruby/issues/2605"},"comments":{"href":"https://api.github.com/repos/jruby/jruby/issues/2605/comments"},"review_comments":{"href":"https://api.github.com/repos/jruby/jruby/pulls/2605/comments"},"review_comment":{"href":"https://api.github.com/repos/jruby/jruby/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jruby/jruby/pulls/2605/commits"},"statuses":{"href":"https://api.github.com/repos/jruby/jruby/statuses/36b929af73f1701ddc57c361dd150f9b63f4334a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":3,"changed_files":2}}