{"action":"closed","number":82,"pull_request":{"url":"https://api.github.com/repos/SKCraft/Launcher/pulls/82","id":41193715,"html_url":"https://github.com/SKCraft/Launcher/pull/82","diff_url":"https://github.com/SKCraft/Launcher/pull/82.diff","patch_url":"https://github.com/SKCraft/Launcher/pull/82.patch","issue_url":"https://api.github.com/repos/SKCraft/Launcher/issues/82","number":82,"state":"closed","locked":false,"title":"Avoid pathological failure mode when trimming lines","user":{"login":"seebs","id":166725,"avatar_url":"https://avatars.githubusercontent.com/u/166725?v=3","gravatar_id":"","url":"https://api.github.com/users/seebs","html_url":"https://github.com/seebs","followers_url":"https://api.github.com/users/seebs/followers","following_url":"https://api.github.com/users/seebs/following{/other_user}","gists_url":"https://api.github.com/users/seebs/gists{/gist_id}","starred_url":"https://api.github.com/users/seebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seebs/subscriptions","organizations_url":"https://api.github.com/users/seebs/orgs","repos_url":"https://api.github.com/users/seebs/repos","events_url":"https://api.github.com/users/seebs/events{/privacy}","received_events_url":"https://api.github.com/users/seebs/received_events","type":"User","site_admin":false},"body":"If for any reason the document associated with a LimitLinesDocumentListener\r\nended up not getting shorter when its first line was removed (this is,\r\nof course, impossible), sklauncher would wedge in a busy loop that\r\ncompletely killed the GUI thread forever.\r\n\r\nSolution, part #1: Don't do a while loop, just remove multiple lines\r\nif you need to.\r\n\r\nBut wait, why are we having this problem at all? It turns out that there\r\nare problems when the document's length changes, which can manifest as\r\ntons of BadLocationExceptions going uncaught in the AWT thread which is\r\ntrying to refresh the window. Why? Probably because the insert into the\r\ndocument isn't happening in the Swing run queue, but concurrently with\r\nit. So use an invokeLater to do the actual insertion.\r\n\r\nWith these two changes, and a console set to 125 lines, I got no failures.\r\nPreviously, if I set the console to 125 lines, it would die catastrophically\r\nbefore Minecraft was done starting up.\r\n\r\nAlso performance may be noticably better. It's pretty common for things\r\nto dump 20+ lines into the buffer at once. If you have a 10,000 line buffer,\r\nand you then delete the first line of it 20 times, that's actually a whole\r\nlot of allocation and shuffling going on.\r\n\r\nMuch thanks to \"kenzierocks\" from IRC for helping debug this!","created_at":"2015-07-30T02:53:39Z","updated_at":"2015-08-03T20:40:54Z","closed_at":"2015-08-03T20:40:54Z","merged_at":"2015-08-03T20:40:54Z","merge_commit_sha":"bbcaa2577e36372abe00abc5e7d9eccc282494ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SKCraft/Launcher/pulls/82/commits","review_comments_url":"https://api.github.com/repos/SKCraft/Launcher/pulls/82/comments","review_comment_url":"https://api.github.com/repos/SKCraft/Launcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SKCraft/Launcher/issues/82/comments","statuses_url":"https://api.github.com/repos/SKCraft/Launcher/statuses/2a50a19d73ef4b8f5321d4e393262f416b38e5ac","head":{"label":"seebs:master","ref":"master","sha":"2a50a19d73ef4b8f5321d4e393262f416b38e5ac","user":{"login":"seebs","id":166725,"avatar_url":"https://avatars.githubusercontent.com/u/166725?v=3","gravatar_id":"","url":"https://api.github.com/users/seebs","html_url":"https://github.com/seebs","followers_url":"https://api.github.com/users/seebs/followers","following_url":"https://api.github.com/users/seebs/following{/other_user}","gists_url":"https://api.github.com/users/seebs/gists{/gist_id}","starred_url":"https://api.github.com/users/seebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seebs/subscriptions","organizations_url":"https://api.github.com/users/seebs/orgs","repos_url":"https://api.github.com/users/seebs/repos","events_url":"https://api.github.com/users/seebs/events{/privacy}","received_events_url":"https://api.github.com/users/seebs/received_events","type":"User","site_admin":false},"repo":{"id":35340015,"name":"Launcher","full_name":"seebs/Launcher","owner":{"login":"seebs","id":166725,"avatar_url":"https://avatars.githubusercontent.com/u/166725?v=3","gravatar_id":"","url":"https://api.github.com/users/seebs","html_url":"https://github.com/seebs","followers_url":"https://api.github.com/users/seebs/followers","following_url":"https://api.github.com/users/seebs/following{/other_user}","gists_url":"https://api.github.com/users/seebs/gists{/gist_id}","starred_url":"https://api.github.com/users/seebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seebs/subscriptions","organizations_url":"https://api.github.com/users/seebs/orgs","repos_url":"https://api.github.com/users/seebs/repos","events_url":"https://api.github.com/users/seebs/events{/privacy}","received_events_url":"https://api.github.com/users/seebs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seebs/Launcher","description":"A custom Minecraft launcher for installing modpacks","fork":true,"url":"https://api.github.com/repos/seebs/Launcher","forks_url":"https://api.github.com/repos/seebs/Launcher/forks","keys_url":"https://api.github.com/repos/seebs/Launcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seebs/Launcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seebs/Launcher/teams","hooks_url":"https://api.github.com/repos/seebs/Launcher/hooks","issue_events_url":"https://api.github.com/repos/seebs/Launcher/issues/events{/number}","events_url":"https://api.github.com/repos/seebs/Launcher/events","assignees_url":"https://api.github.com/repos/seebs/Launcher/assignees{/user}","branches_url":"https://api.github.com/repos/seebs/Launcher/branches{/branch}","tags_url":"https://api.github.com/repos/seebs/Launcher/tags","blobs_url":"https://api.github.com/repos/seebs/Launcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seebs/Launcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seebs/Launcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/seebs/Launcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seebs/Launcher/statuses/{sha}","languages_url":"https://api.github.com/repos/seebs/Launcher/languages","stargazers_url":"https://api.github.com/repos/seebs/Launcher/stargazers","contributors_url":"https://api.github.com/repos/seebs/Launcher/contributors","subscribers_url":"https://api.github.com/repos/seebs/Launcher/subscribers","subscription_url":"https://api.github.com/repos/seebs/Launcher/subscription","commits_url":"https://api.github.com/repos/seebs/Launcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/seebs/Launcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/seebs/Launcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/seebs/Launcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/seebs/Launcher/contents/{+path}","compare_url":"https://api.github.com/repos/seebs/Launcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seebs/Launcher/merges","archive_url":"https://api.github.com/repos/seebs/Launcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seebs/Launcher/downloads","issues_url":"https://api.github.com/repos/seebs/Launcher/issues{/number}","pulls_url":"https://api.github.com/repos/seebs/Launcher/pulls{/number}","milestones_url":"https://api.github.com/repos/seebs/Launcher/milestones{/number}","notifications_url":"https://api.github.com/repos/seebs/Launcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seebs/Launcher/labels{/name}","releases_url":"https://api.github.com/repos/seebs/Launcher/releases{/id}","created_at":"2015-05-09T18:24:44Z","updated_at":"2015-05-09T18:24:45Z","pushed_at":"2015-07-31T00:00:21Z","git_url":"git://github.com/seebs/Launcher.git","ssh_url":"git@github.com:seebs/Launcher.git","clone_url":"https://github.com/seebs/Launcher.git","svn_url":"https://github.com/seebs/Launcher","homepage":"","size":647,"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":"SKCraft:master","ref":"master","sha":"454aa327a4c3c888f4432836d56d0500e64016ee","user":{"login":"SKCraft","id":1677045,"avatar_url":"https://avatars.githubusercontent.com/u/1677045?v=3","gravatar_id":"","url":"https://api.github.com/users/SKCraft","html_url":"https://github.com/SKCraft","followers_url":"https://api.github.com/users/SKCraft/followers","following_url":"https://api.github.com/users/SKCraft/following{/other_user}","gists_url":"https://api.github.com/users/SKCraft/gists{/gist_id}","starred_url":"https://api.github.com/users/SKCraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SKCraft/subscriptions","organizations_url":"https://api.github.com/users/SKCraft/orgs","repos_url":"https://api.github.com/users/SKCraft/repos","events_url":"https://api.github.com/users/SKCraft/events{/privacy}","received_events_url":"https://api.github.com/users/SKCraft/received_events","type":"Organization","site_admin":false},"repo":{"id":16112592,"name":"Launcher","full_name":"SKCraft/Launcher","owner":{"login":"SKCraft","id":1677045,"avatar_url":"https://avatars.githubusercontent.com/u/1677045?v=3","gravatar_id":"","url":"https://api.github.com/users/SKCraft","html_url":"https://github.com/SKCraft","followers_url":"https://api.github.com/users/SKCraft/followers","following_url":"https://api.github.com/users/SKCraft/following{/other_user}","gists_url":"https://api.github.com/users/SKCraft/gists{/gist_id}","starred_url":"https://api.github.com/users/SKCraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SKCraft/subscriptions","organizations_url":"https://api.github.com/users/SKCraft/orgs","repos_url":"https://api.github.com/users/SKCraft/repos","events_url":"https://api.github.com/users/SKCraft/events{/privacy}","received_events_url":"https://api.github.com/users/SKCraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SKCraft/Launcher","description":"A custom Minecraft launcher for installing modpacks","fork":false,"url":"https://api.github.com/repos/SKCraft/Launcher","forks_url":"https://api.github.com/repos/SKCraft/Launcher/forks","keys_url":"https://api.github.com/repos/SKCraft/Launcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SKCraft/Launcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SKCraft/Launcher/teams","hooks_url":"https://api.github.com/repos/SKCraft/Launcher/hooks","issue_events_url":"https://api.github.com/repos/SKCraft/Launcher/issues/events{/number}","events_url":"https://api.github.com/repos/SKCraft/Launcher/events","assignees_url":"https://api.github.com/repos/SKCraft/Launcher/assignees{/user}","branches_url":"https://api.github.com/repos/SKCraft/Launcher/branches{/branch}","tags_url":"https://api.github.com/repos/SKCraft/Launcher/tags","blobs_url":"https://api.github.com/repos/SKCraft/Launcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SKCraft/Launcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SKCraft/Launcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/SKCraft/Launcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SKCraft/Launcher/statuses/{sha}","languages_url":"https://api.github.com/repos/SKCraft/Launcher/languages","stargazers_url":"https://api.github.com/repos/SKCraft/Launcher/stargazers","contributors_url":"https://api.github.com/repos/SKCraft/Launcher/contributors","subscribers_url":"https://api.github.com/repos/SKCraft/Launcher/subscribers","subscription_url":"https://api.github.com/repos/SKCraft/Launcher/subscription","commits_url":"https://api.github.com/repos/SKCraft/Launcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/SKCraft/Launcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/SKCraft/Launcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/SKCraft/Launcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/SKCraft/Launcher/contents/{+path}","compare_url":"https://api.github.com/repos/SKCraft/Launcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SKCraft/Launcher/merges","archive_url":"https://api.github.com/repos/SKCraft/Launcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SKCraft/Launcher/downloads","issues_url":"https://api.github.com/repos/SKCraft/Launcher/issues{/number}","pulls_url":"https://api.github.com/repos/SKCraft/Launcher/pulls{/number}","milestones_url":"https://api.github.com/repos/SKCraft/Launcher/milestones{/number}","notifications_url":"https://api.github.com/repos/SKCraft/Launcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SKCraft/Launcher/labels{/name}","releases_url":"https://api.github.com/repos/SKCraft/Launcher/releases{/id}","created_at":"2014-01-21T18:03:36Z","updated_at":"2015-08-03T13:04:56Z","pushed_at":"2015-08-03T20:40:54Z","git_url":"git://github.com/SKCraft/Launcher.git","ssh_url":"git@github.com:SKCraft/Launcher.git","clone_url":"https://github.com/SKCraft/Launcher.git","svn_url":"https://github.com/SKCraft/Launcher","homepage":"","size":6392,"stargazers_count":92,"watchers_count":92,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":173,"mirror_url":null,"open_issues_count":21,"forks":173,"open_issues":21,"watchers":92,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SKCraft/Launcher/pulls/82"},"html":{"href":"https://github.com/SKCraft/Launcher/pull/82"},"issue":{"href":"https://api.github.com/repos/SKCraft/Launcher/issues/82"},"comments":{"href":"https://api.github.com/repos/SKCraft/Launcher/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/SKCraft/Launcher/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/SKCraft/Launcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SKCraft/Launcher/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/SKCraft/Launcher/statuses/2a50a19d73ef4b8f5321d4e393262f416b38e5ac"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"sk89q","id":38949,"avatar_url":"https://avatars.githubusercontent.com/u/38949?v=3","gravatar_id":"","url":"https://api.github.com/users/sk89q","html_url":"https://github.com/sk89q","followers_url":"https://api.github.com/users/sk89q/followers","following_url":"https://api.github.com/users/sk89q/following{/other_user}","gists_url":"https://api.github.com/users/sk89q/gists{/gist_id}","starred_url":"https://api.github.com/users/sk89q/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sk89q/subscriptions","organizations_url":"https://api.github.com/users/sk89q/orgs","repos_url":"https://api.github.com/users/sk89q/repos","events_url":"https://api.github.com/users/sk89q/events{/privacy}","received_events_url":"https://api.github.com/users/sk89q/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"commits":1,"additions":46,"deletions":28,"changed_files":2}}