{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-fineract/pulls/comments/92592264","pull_request_review_id":13109971,"id":92592264,"diff_hunk":"@@ -494,17 +494,29 @@ private void updateInstallmentCharges() {\n             this.loanInstallmentCharge.addAll(chargePerInstallments);\n         } else {\n             int index = 0;\n-            final LoanInstallmentCharge[] loanChargePerInstallments = new LoanInstallmentCharge[chargePerInstallments.size()];\n-            final LoanInstallmentCharge[] loanChargePerInstallmentArray = chargePerInstallments.toArray(loanChargePerInstallments);\n-            for (final LoanInstallmentCharge chargePerInstallment : this.loanInstallmentCharge) {\n+            //FINERACT-7: NB: this is really overkill and slow, without changing the Sets and or Entities this is the most\n+            //locally safe way to fix this issue\n+            ArrayList<LoanInstallmentCharge> oldChargeInstallments = new ArrayList<LoanInstallmentCharge>();\n+            ArrayList<LoanInstallmentCharge> newChargeInstallments = new ArrayList<LoanInstallmentCharge>();\n+\n+            oldChargeInstallments.addAll(this.loanInstallmentCharge);\n+            newChargeInstallments.addAll(chargePerInstallments);\n+            Collections.sort(oldChargeInstallments);\n+            Collections.sort(newChargeInstallments);\n+            final LoanInstallmentCharge[] loanChargePerInstallmentArray = chargePerInstallments.toArray(new LoanInstallmentCharge[chargePerInstallments.size()]);","path":"fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java","position":null,"original_position":16,"commit_id":"c0e689d83983131e6401449b5462bc0ed9a57159","original_commit_id":"515a4a28c8a945f35229e7f60098f010091baee3","user":{"login":"abdulazizali77","id":23547158,"avatar_url":"https://avatars.githubusercontent.com/u/23547158?v=3","gravatar_id":"","url":"https://api.github.com/users/abdulazizali77","html_url":"https://github.com/abdulazizali77","followers_url":"https://api.github.com/users/abdulazizali77/followers","following_url":"https://api.github.com/users/abdulazizali77/following{/other_user}","gists_url":"https://api.github.com/users/abdulazizali77/gists{/gist_id}","starred_url":"https://api.github.com/users/abdulazizali77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdulazizali77/subscriptions","organizations_url":"https://api.github.com/users/abdulazizali77/orgs","repos_url":"https://api.github.com/users/abdulazizali77/repos","events_url":"https://api.github.com/users/abdulazizali77/events{/privacy}","received_events_url":"https://api.github.com/users/abdulazizali77/received_events","type":"User","site_admin":false},"body":"Please rereview, thank you.","created_at":"2016-12-15T11:33:25Z","updated_at":"2016-12-15T11:33:25Z","html_url":"https://github.com/apache/incubator-fineract/pull/256#discussion_r92592264","pull_request_url":"https://api.github.com/repos/apache/incubator-fineract/pulls/256","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/comments/92592264"},"html":{"href":"https://github.com/apache/incubator-fineract/pull/256#discussion_r92592264"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/256"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-fineract/pulls/256","id":96695836,"html_url":"https://github.com/apache/incubator-fineract/pull/256","diff_url":"https://github.com/apache/incubator-fineract/pull/256.diff","patch_url":"https://github.com/apache/incubator-fineract/pull/256.patch","issue_url":"https://api.github.com/repos/apache/incubator-fineract/issues/256","number":256,"state":"open","locked":false,"title":"FINERACT-7: Sort loanInstallmentCharges before updating","user":{"login":"abdulazizali77","id":23547158,"avatar_url":"https://avatars.githubusercontent.com/u/23547158?v=3","gravatar_id":"","url":"https://api.github.com/users/abdulazizali77","html_url":"https://github.com/abdulazizali77","followers_url":"https://api.github.com/users/abdulazizali77/followers","following_url":"https://api.github.com/users/abdulazizali77/following{/other_user}","gists_url":"https://api.github.com/users/abdulazizali77/gists{/gist_id}","starred_url":"https://api.github.com/users/abdulazizali77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdulazizali77/subscriptions","organizations_url":"https://api.github.com/users/abdulazizali77/orgs","repos_url":"https://api.github.com/users/abdulazizali77/repos","events_url":"https://api.github.com/users/abdulazizali77/events{/privacy}","received_events_url":"https://api.github.com/users/abdulazizali77/received_events","type":"User","site_admin":false},"body":"Less than ideal fix (sorting overhead), but most topically contained. Potentially we should change the Sets to Lists, and or redefine the Entities, but that would affect too many things.\r\n\r\nHave left a potentially iffy corner case in updateInstallmentCharges as is.\r\n\r\nAdditionally there is a pre-existing defect where a PersistenceException caused by an FK constraint is raised when all of the charges are waived. Have not investigated, potentially there is an existing bug.","created_at":"2016-12-06T10:18:34Z","updated_at":"2016-12-15T11:33:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4771f6b5eb2f26275701cc69dca6bf0564967fda","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-fineract/pulls/256/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-fineract/pulls/256/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-fineract/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-fineract/issues/256/comments","statuses_url":"https://api.github.com/repos/apache/incubator-fineract/statuses/c0e689d83983131e6401449b5462bc0ed9a57159","head":{"label":"abdulazizali77:FINERACT-7","ref":"FINERACT-7","sha":"c0e689d83983131e6401449b5462bc0ed9a57159","user":{"login":"abdulazizali77","id":23547158,"avatar_url":"https://avatars.githubusercontent.com/u/23547158?v=3","gravatar_id":"","url":"https://api.github.com/users/abdulazizali77","html_url":"https://github.com/abdulazizali77","followers_url":"https://api.github.com/users/abdulazizali77/followers","following_url":"https://api.github.com/users/abdulazizali77/following{/other_user}","gists_url":"https://api.github.com/users/abdulazizali77/gists{/gist_id}","starred_url":"https://api.github.com/users/abdulazizali77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdulazizali77/subscriptions","organizations_url":"https://api.github.com/users/abdulazizali77/orgs","repos_url":"https://api.github.com/users/abdulazizali77/repos","events_url":"https://api.github.com/users/abdulazizali77/events{/privacy}","received_events_url":"https://api.github.com/users/abdulazizali77/received_events","type":"User","site_admin":false},"repo":{"id":74205211,"name":"incubator-fineract","full_name":"abdulazizali77/incubator-fineract","owner":{"login":"abdulazizali77","id":23547158,"avatar_url":"https://avatars.githubusercontent.com/u/23547158?v=3","gravatar_id":"","url":"https://api.github.com/users/abdulazizali77","html_url":"https://github.com/abdulazizali77","followers_url":"https://api.github.com/users/abdulazizali77/followers","following_url":"https://api.github.com/users/abdulazizali77/following{/other_user}","gists_url":"https://api.github.com/users/abdulazizali77/gists{/gist_id}","starred_url":"https://api.github.com/users/abdulazizali77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abdulazizali77/subscriptions","organizations_url":"https://api.github.com/users/abdulazizali77/orgs","repos_url":"https://api.github.com/users/abdulazizali77/repos","events_url":"https://api.github.com/users/abdulazizali77/events{/privacy}","received_events_url":"https://api.github.com/users/abdulazizali77/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abdulazizali77/incubator-fineract","description":"Mirror of Apache Fineract (Incubating)","fork":true,"url":"https://api.github.com/repos/abdulazizali77/incubator-fineract","forks_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/forks","keys_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/teams","hooks_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/hooks","issue_events_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/issues/events{/number}","events_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/events","assignees_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/assignees{/user}","branches_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/branches{/branch}","tags_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/tags","blobs_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/git/refs{/sha}","trees_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/statuses/{sha}","languages_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/languages","stargazers_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/stargazers","contributors_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/contributors","subscribers_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/subscribers","subscription_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/subscription","commits_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/commits{/sha}","git_commits_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/git/commits{/sha}","comments_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/comments{/number}","issue_comment_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/issues/comments{/number}","contents_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/contents/{+path}","compare_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/merges","archive_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/downloads","issues_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/issues{/number}","pulls_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/pulls{/number}","milestones_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/milestones{/number}","notifications_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/labels{/name}","releases_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/releases{/id}","deployments_url":"https://api.github.com/repos/abdulazizali77/incubator-fineract/deployments","created_at":"2016-11-19T11:46:47Z","updated_at":"2016-11-19T11:46:56Z","pushed_at":"2016-12-15T11:30:07Z","git_url":"git://github.com/abdulazizali77/incubator-fineract.git","ssh_url":"git@github.com:abdulazizali77/incubator-fineract.git","clone_url":"https://github.com/abdulazizali77/incubator-fineract.git","svn_url":"https://github.com/abdulazizali77/incubator-fineract","homepage":null,"size":34038,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"apache:develop","ref":"develop","sha":"94baf15b976677cb74479e4a1444620d3c1f515b","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":48418599,"name":"incubator-fineract","full_name":"apache/incubator-fineract","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-fineract","description":"Mirror of Apache Fineract (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-fineract","forks_url":"https://api.github.com/repos/apache/incubator-fineract/forks","keys_url":"https://api.github.com/repos/apache/incubator-fineract/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-fineract/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-fineract/teams","hooks_url":"https://api.github.com/repos/apache/incubator-fineract/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-fineract/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-fineract/events","assignees_url":"https://api.github.com/repos/apache/incubator-fineract/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-fineract/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-fineract/tags","blobs_url":"https://api.github.com/repos/apache/incubator-fineract/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-fineract/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-fineract/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-fineract/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-fineract/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-fineract/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-fineract/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-fineract/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-fineract/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-fineract/subscription","commits_url":"https://api.github.com/repos/apache/incubator-fineract/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-fineract/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-fineract/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-fineract/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-fineract/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-fineract/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-fineract/merges","archive_url":"https://api.github.com/repos/apache/incubator-fineract/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-fineract/downloads","issues_url":"https://api.github.com/repos/apache/incubator-fineract/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-fineract/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-fineract/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-fineract/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-fineract/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-fineract/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-fineract/deployments","created_at":"2015-12-22T08:00:06Z","updated_at":"2016-12-06T03:31:40Z","pushed_at":"2016-12-15T11:30:08Z","git_url":"git://github.com/apache/incubator-fineract.git","ssh_url":"git@github.com:apache/incubator-fineract.git","clone_url":"https://github.com/apache/incubator-fineract.git","svn_url":"https://github.com/apache/incubator-fineract","homepage":null,"size":34033,"stargazers_count":37,"watchers_count":37,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":153,"mirror_url":"git://git.apache.org/incubator-fineract.git","open_issues_count":27,"forks":153,"open_issues":27,"watchers":37,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/256"},"html":{"href":"https://github.com/apache/incubator-fineract/pull/256"},"issue":{"href":"https://api.github.com/repos/apache/incubator-fineract/issues/256"},"comments":{"href":"https://api.github.com/repos/apache/incubator-fineract/issues/256/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/256/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-fineract/pulls/256/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-fineract/statuses/c0e689d83983131e6401449b5462bc0ed9a57159"}}}}
{"actor":{"display_login":"abdulazizali77"}}