{"action":"closed","number":353,"pull_request":{"url":"https://api.github.com/repos/samtools/htsjdk/pulls/353","id":48044021,"html_url":"https://github.com/samtools/htsjdk/pull/353","diff_url":"https://github.com/samtools/htsjdk/pull/353.diff","patch_url":"https://github.com/samtools/htsjdk/pull/353.patch","issue_url":"https://api.github.com/repos/samtools/htsjdk/issues/353","number":353,"state":"closed","locked":false,"title":"Make cramFile, inputStream and iterator variables in CRAMFileReader final","user":{"login":"pityka","id":106101,"avatar_url":"https://avatars.githubusercontent.com/u/106101?v=3","gravatar_id":"","url":"https://api.github.com/users/pityka","html_url":"https://github.com/pityka","followers_url":"https://api.github.com/users/pityka/followers","following_url":"https://api.github.com/users/pityka/following{/other_user}","gists_url":"https://api.github.com/users/pityka/gists{/gist_id}","starred_url":"https://api.github.com/users/pityka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pityka/subscriptions","organizations_url":"https://api.github.com/users/pityka/orgs","repos_url":"https://api.github.com/users/pityka/repos","events_url":"https://api.github.com/users/pityka/events{/privacy}","received_events_url":"https://api.github.com/users/pityka/received_events","type":"User","site_admin":false},"body":"CRAMFileReader.getFileHeader() forwards to iterator, therefore the same CRAMFileReader instance could return different references from getFileHeader() during the lifetime of the instance.\r\nThis will make NPE in SamFileHeaderMerger and MergingSamRecordIterator because they rely on reference equality in IdentityHashMap.\r\n\r\nThe original version assigned a new CRAMIterator to the `iterator` instance variable in CRAMFileReader each time getIterator() was called and `cramFile` was not null. As a consequence after each call of getIterator() the reference returned by getFileHeader() was different.\r\n\r\nI changed the `iterator`, `cramFile` and `inputStream` instance variables to final to ensure that they don't get reassigned. I adapted the constructors to accommodate this change.","created_at":"2015-10-19T08:40:15Z","updated_at":"2016-04-19T18:12:57Z","closed_at":"2016-04-19T18:12:56Z","merged_at":null,"merge_commit_sha":"b13b41ee67d1eedcf7ce0b9897ace24c759295d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/samtools/htsjdk/pulls/353/commits","review_comments_url":"https://api.github.com/repos/samtools/htsjdk/pulls/353/comments","review_comment_url":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samtools/htsjdk/issues/353/comments","statuses_url":"https://api.github.com/repos/samtools/htsjdk/statuses/efb50b37b3019ac55a1ab2b81f64c9f586651df5","head":{"label":"pityka:cramfilereader_finalvars","ref":"cramfilereader_finalvars","sha":"efb50b37b3019ac55a1ab2b81f64c9f586651df5","user":{"login":"pityka","id":106101,"avatar_url":"https://avatars.githubusercontent.com/u/106101?v=3","gravatar_id":"","url":"https://api.github.com/users/pityka","html_url":"https://github.com/pityka","followers_url":"https://api.github.com/users/pityka/followers","following_url":"https://api.github.com/users/pityka/following{/other_user}","gists_url":"https://api.github.com/users/pityka/gists{/gist_id}","starred_url":"https://api.github.com/users/pityka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pityka/subscriptions","organizations_url":"https://api.github.com/users/pityka/orgs","repos_url":"https://api.github.com/users/pityka/repos","events_url":"https://api.github.com/users/pityka/events{/privacy}","received_events_url":"https://api.github.com/users/pityka/received_events","type":"User","site_admin":false},"repo":{"id":44397304,"name":"htsjdk","full_name":"pityka/htsjdk","owner":{"login":"pityka","id":106101,"avatar_url":"https://avatars.githubusercontent.com/u/106101?v=3","gravatar_id":"","url":"https://api.github.com/users/pityka","html_url":"https://github.com/pityka","followers_url":"https://api.github.com/users/pityka/followers","following_url":"https://api.github.com/users/pityka/following{/other_user}","gists_url":"https://api.github.com/users/pityka/gists{/gist_id}","starred_url":"https://api.github.com/users/pityka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pityka/subscriptions","organizations_url":"https://api.github.com/users/pityka/orgs","repos_url":"https://api.github.com/users/pityka/repos","events_url":"https://api.github.com/users/pityka/events{/privacy}","received_events_url":"https://api.github.com/users/pityka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pityka/htsjdk","description":"A Java API for high-throughput sequencing data (HTS) formats.","fork":true,"url":"https://api.github.com/repos/pityka/htsjdk","forks_url":"https://api.github.com/repos/pityka/htsjdk/forks","keys_url":"https://api.github.com/repos/pityka/htsjdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pityka/htsjdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pityka/htsjdk/teams","hooks_url":"https://api.github.com/repos/pityka/htsjdk/hooks","issue_events_url":"https://api.github.com/repos/pityka/htsjdk/issues/events{/number}","events_url":"https://api.github.com/repos/pityka/htsjdk/events","assignees_url":"https://api.github.com/repos/pityka/htsjdk/assignees{/user}","branches_url":"https://api.github.com/repos/pityka/htsjdk/branches{/branch}","tags_url":"https://api.github.com/repos/pityka/htsjdk/tags","blobs_url":"https://api.github.com/repos/pityka/htsjdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pityka/htsjdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pityka/htsjdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/pityka/htsjdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pityka/htsjdk/statuses/{sha}","languages_url":"https://api.github.com/repos/pityka/htsjdk/languages","stargazers_url":"https://api.github.com/repos/pityka/htsjdk/stargazers","contributors_url":"https://api.github.com/repos/pityka/htsjdk/contributors","subscribers_url":"https://api.github.com/repos/pityka/htsjdk/subscribers","subscription_url":"https://api.github.com/repos/pityka/htsjdk/subscription","commits_url":"https://api.github.com/repos/pityka/htsjdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/pityka/htsjdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/pityka/htsjdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/pityka/htsjdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/pityka/htsjdk/contents/{+path}","compare_url":"https://api.github.com/repos/pityka/htsjdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pityka/htsjdk/merges","archive_url":"https://api.github.com/repos/pityka/htsjdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pityka/htsjdk/downloads","issues_url":"https://api.github.com/repos/pityka/htsjdk/issues{/number}","pulls_url":"https://api.github.com/repos/pityka/htsjdk/pulls{/number}","milestones_url":"https://api.github.com/repos/pityka/htsjdk/milestones{/number}","notifications_url":"https://api.github.com/repos/pityka/htsjdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pityka/htsjdk/labels{/name}","releases_url":"https://api.github.com/repos/pityka/htsjdk/releases{/id}","deployments_url":"https://api.github.com/repos/pityka/htsjdk/deployments","created_at":"2015-10-16T16:25:28Z","updated_at":"2015-10-16T16:25:36Z","pushed_at":"2016-01-15T06:07:33Z","git_url":"git://github.com/pityka/htsjdk.git","ssh_url":"git@github.com:pityka/htsjdk.git","clone_url":"https://github.com/pityka/htsjdk.git","svn_url":"https://github.com/pityka/htsjdk","homepage":"http://samtools.github.io/htsjdk/","size":58217,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"samtools:master","ref":"master","sha":"897bd96267b5419ea4388b686307b906ed9516d4","user":{"login":"samtools","id":1518450,"avatar_url":"https://avatars.githubusercontent.com/u/1518450?v=3","gravatar_id":"","url":"https://api.github.com/users/samtools","html_url":"https://github.com/samtools","followers_url":"https://api.github.com/users/samtools/followers","following_url":"https://api.github.com/users/samtools/following{/other_user}","gists_url":"https://api.github.com/users/samtools/gists{/gist_id}","starred_url":"https://api.github.com/users/samtools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samtools/subscriptions","organizations_url":"https://api.github.com/users/samtools/orgs","repos_url":"https://api.github.com/users/samtools/repos","events_url":"https://api.github.com/users/samtools/events{/privacy}","received_events_url":"https://api.github.com/users/samtools/received_events","type":"Organization","site_admin":false},"repo":{"id":19272315,"name":"htsjdk","full_name":"samtools/htsjdk","owner":{"login":"samtools","id":1518450,"avatar_url":"https://avatars.githubusercontent.com/u/1518450?v=3","gravatar_id":"","url":"https://api.github.com/users/samtools","html_url":"https://github.com/samtools","followers_url":"https://api.github.com/users/samtools/followers","following_url":"https://api.github.com/users/samtools/following{/other_user}","gists_url":"https://api.github.com/users/samtools/gists{/gist_id}","starred_url":"https://api.github.com/users/samtools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samtools/subscriptions","organizations_url":"https://api.github.com/users/samtools/orgs","repos_url":"https://api.github.com/users/samtools/repos","events_url":"https://api.github.com/users/samtools/events{/privacy}","received_events_url":"https://api.github.com/users/samtools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/samtools/htsjdk","description":"A Java API for high-throughput sequencing data (HTS) formats.","fork":false,"url":"https://api.github.com/repos/samtools/htsjdk","forks_url":"https://api.github.com/repos/samtools/htsjdk/forks","keys_url":"https://api.github.com/repos/samtools/htsjdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samtools/htsjdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samtools/htsjdk/teams","hooks_url":"https://api.github.com/repos/samtools/htsjdk/hooks","issue_events_url":"https://api.github.com/repos/samtools/htsjdk/issues/events{/number}","events_url":"https://api.github.com/repos/samtools/htsjdk/events","assignees_url":"https://api.github.com/repos/samtools/htsjdk/assignees{/user}","branches_url":"https://api.github.com/repos/samtools/htsjdk/branches{/branch}","tags_url":"https://api.github.com/repos/samtools/htsjdk/tags","blobs_url":"https://api.github.com/repos/samtools/htsjdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samtools/htsjdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samtools/htsjdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/samtools/htsjdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samtools/htsjdk/statuses/{sha}","languages_url":"https://api.github.com/repos/samtools/htsjdk/languages","stargazers_url":"https://api.github.com/repos/samtools/htsjdk/stargazers","contributors_url":"https://api.github.com/repos/samtools/htsjdk/contributors","subscribers_url":"https://api.github.com/repos/samtools/htsjdk/subscribers","subscription_url":"https://api.github.com/repos/samtools/htsjdk/subscription","commits_url":"https://api.github.com/repos/samtools/htsjdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/samtools/htsjdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/samtools/htsjdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/samtools/htsjdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/samtools/htsjdk/contents/{+path}","compare_url":"https://api.github.com/repos/samtools/htsjdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samtools/htsjdk/merges","archive_url":"https://api.github.com/repos/samtools/htsjdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samtools/htsjdk/downloads","issues_url":"https://api.github.com/repos/samtools/htsjdk/issues{/number}","pulls_url":"https://api.github.com/repos/samtools/htsjdk/pulls{/number}","milestones_url":"https://api.github.com/repos/samtools/htsjdk/milestones{/number}","notifications_url":"https://api.github.com/repos/samtools/htsjdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samtools/htsjdk/labels{/name}","releases_url":"https://api.github.com/repos/samtools/htsjdk/releases{/id}","deployments_url":"https://api.github.com/repos/samtools/htsjdk/deployments","created_at":"2014-04-29T10:11:28Z","updated_at":"2016-03-28T21:39:56Z","pushed_at":"2016-04-19T18:10:04Z","git_url":"git://github.com/samtools/htsjdk.git","ssh_url":"git@github.com:samtools/htsjdk.git","clone_url":"https://github.com/samtools/htsjdk.git","svn_url":"https://github.com/samtools/htsjdk","homepage":"http://samtools.github.io/htsjdk/","size":68647,"stargazers_count":75,"watchers_count":75,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":110,"mirror_url":null,"open_issues_count":134,"forks":110,"open_issues":134,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/353"},"html":{"href":"https://github.com/samtools/htsjdk/pull/353"},"issue":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/353"},"comments":{"href":"https://api.github.com/repos/samtools/htsjdk/issues/353/comments"},"review_comments":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/353/comments"},"review_comment":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samtools/htsjdk/pulls/353/commits"},"statuses":{"href":"https://api.github.com/repos/samtools/htsjdk/statuses/efb50b37b3019ac55a1ab2b81f64c9f586651df5"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":5,"review_comments":12,"commits":3,"additions":41,"deletions":59,"changed_files":2}}