{"action":"closed","issue":{"url":"https://api.github.com/repos/remulasce/metroapp/issues/216","labels_url":"https://api.github.com/repos/remulasce/metroapp/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/remulasce/metroapp/issues/216/comments","events_url":"https://api.github.com/repos/remulasce/metroapp/issues/216/events","html_url":"https://github.com/remulasce/metroapp/issues/216","id":70554817,"number":216,"title":"User reported crash","user":{"login":"remulasce","id":1064048,"avatar_url":"https://avatars.githubusercontent.com/u/1064048?v=3","gravatar_id":"","url":"https://api.github.com/users/remulasce","html_url":"https://github.com/remulasce","followers_url":"https://api.github.com/users/remulasce/followers","following_url":"https://api.github.com/users/remulasce/following{/other_user}","gists_url":"https://api.github.com/users/remulasce/gists{/gist_id}","starred_url":"https://api.github.com/users/remulasce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remulasce/subscriptions","organizations_url":"https://api.github.com/users/remulasce/orgs","repos_url":"https://api.github.com/users/remulasce/repos","events_url":"https://api.github.com/users/remulasce/events{/privacy}","received_events_url":"https://api.github.com/users/remulasce/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/remulasce/metroapp/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"remulasce","id":1064048,"avatar_url":"https://avatars.githubusercontent.com/u/1064048?v=3","gravatar_id":"","url":"https://api.github.com/users/remulasce","html_url":"https://github.com/remulasce","followers_url":"https://api.github.com/users/remulasce/followers","following_url":"https://api.github.com/users/remulasce/following{/other_user}","gists_url":"https://api.github.com/users/remulasce/gists{/gist_id}","starred_url":"https://api.github.com/users/remulasce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remulasce/subscriptions","organizations_url":"https://api.github.com/users/remulasce/orgs","repos_url":"https://api.github.com/users/remulasce/repos","events_url":"https://api.github.com/users/remulasce/events{/privacy}","received_events_url":"https://api.github.com/users/remulasce/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/remulasce/metroapp/milestones/9","html_url":"https://github.com/remulasce/metroapp/milestones/User%20Feedback","labels_url":"https://api.github.com/repos/remulasce/metroapp/milestones/9/labels","id":994409,"number":9,"title":"User Feedback","description":"","creator":{"login":"remulasce","id":1064048,"avatar_url":"https://avatars.githubusercontent.com/u/1064048?v=3","gravatar_id":"","url":"https://api.github.com/users/remulasce","html_url":"https://github.com/remulasce","followers_url":"https://api.github.com/users/remulasce/followers","following_url":"https://api.github.com/users/remulasce/following{/other_user}","gists_url":"https://api.github.com/users/remulasce/gists{/gist_id}","starred_url":"https://api.github.com/users/remulasce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remulasce/subscriptions","organizations_url":"https://api.github.com/users/remulasce/orgs","repos_url":"https://api.github.com/users/remulasce/repos","events_url":"https://api.github.com/users/remulasce/events{/privacy}","received_events_url":"https://api.github.com/users/remulasce/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":7,"state":"open","created_at":"2015-02-25T01:30:33Z","updated_at":"2015-04-24T01:33:24Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-04-24T01:12:48Z","updated_at":"2015-04-24T01:33:24Z","closed_at":"2015-04-24T01:33:24Z","body":"Looks like I goofed in a priority comparison method.\r\n\r\nOffending comparison:\r\n        public int compare(Trip lhs, Trip rhs) {\r\n            return (lhs.getPriority() < rhs.getPriority()) ? 1 : -1;\r\n        }\r\n\r\nViolates the contract of comparitors, because if the priorities are equal, -1 will be returned, which denotes that one side is greater.\r\n\r\nThis is obviously incorrect.\r\n\r\nAlso, it's a simple fix.\r\n\r\nUser reports this happened with screen off when notification sounded. I think it was when he turned on his phone, all the priorities got recalculated and reordered, revealing this issue.\r\n\r\nIt was likely for priorities to be exactly equal because each trip in a stop has identical priority.\r\n\r\n\r\nUSER_COMMENT=alarm sounded when the screen was off\r\nANDROID_VERSION=4.4.2\r\nAPP_VERSION_NAME=0.71\r\nBRAND=MetroPCS\r\nPHONE_MODEL=LGMS323\r\nCUSTOM_DATA=\r\nSTACK_TRACE=java.lang.IllegalArgumentException: Comparison method violates its general contract!\r\nat java.util.TimSort.mergeHi(TimSort.java:864)\r\nat java.util.TimSort.mergeAt(TimSort.java:481)\r\nat java.util.TimSort.mergeForceCollapse(TimSort.java:422)\r\nat java.util.TimSort.sort(TimSort.java:219)\r\nat java.util.TimSort.sort(TimSort.java:169)\r\nat java.util.Arrays.sort(Arrays.java:2023)\r\nat java.util.Collections.sort(Collections.java:1883)\r\nat com.remulasce.lametroapp.c.b.a(ServiceRequestHandler.java:39)\r\nat com.remulasce.lametroapp.c.b.a(ServiceRequestHandler.java:51)\r\nat com.remulasce.lametroapp.p.a(TripPopulator.java:226)\r\nat com.remulasce.lametroapp.p.run(TripPopulator.java:195)\r\nat java.lang.Thread.run(Thread.java:841)"}}