{"action":"created","comment":{"url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/comments/244572596","pull_request_review_id":188481915,"id":244572596,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDU3MjU5Ng==","diff_hunk":"@@ -334,4 +416,72 @@ public boolean isEmpty() {\n     }\n     return true;\n   }\n+\n+  /**\n+   * Add punctuation before the given code unless the given excluded punc is already present.\n+   *\n+   * @param code the code\n+   * @param punc the punc\n+   * @param excludedPunc the excluded punc\n+   */\n+  public void addPrecedingPunctuation(String code, String punc, String excludedPunc) {\n+    int subfieldIndex = 0;\n+    for (Object o : getSubfieldList()) {\n+      Subfield s = (Subfield) o;\n+      if (s.getCode().equals(code) && subfieldIndex > 0) {\n+        Subfield before = getSubfield(subfieldIndex - 1);\n+          if (!before.getContent().endsWith(excludedPunc)) {\n+            before.setContent(before.getContent() + punc);\n+          }\n+       }\n+      subfieldIndex++;\n+    }\n+  }\n+\n+  /**\n+   * Remove the given punctuation if preceding the given subfield code.\n+   *\n+   * @param code the code\n+   * @param punc the punc\n+   */\n+  public void removePrecedingPunctuation(String code, String punc) {\n+    int subfieldIndex = 0;\n+    for (Object o : getSubfieldList()) {\n+      Subfield s = (Subfield) o;\n+      if (s.getCode().equals(code)) {\n+        if (subfieldIndex > 0) {\n+          Subfield before = getSubfield(subfieldIndex - 1);\n+          String bc = before.getContent();\n+          if (bc.endsWith(punc)) {\n+            before.setContent(bc.substring(0, bc.length() - punc.length() + 1));\n+          }\n+        }\n+      }\n+      subfieldIndex++;\n+    }\n+  }\n+\n+  /**\n+   * Ensures that the given subfield codes end in the given punctuation.\n+   *\n+   * @param codes the codes\n+   * @param otherTerminals the other terminals\n+   * @param terminalChar the terminal char\n+   * @return true if given subfield is found\n+   */\n+  public boolean addTerminalPunctuation(String codes, String otherTerminals, String terminalChar) {\n+    int subfieldIndex = 0;","path":"src/main/java/org/folio/marccat/util/StringText.java","position":461,"original_position":461,"commit_id":"1e48a08470c379007f3600f3e38eccc6f79d9ce0","original_commit_id":"1e48a08470c379007f3600f3e38eccc6f79d9ce0","user":{"login":"sonarcloud[bot]","id":39514782,"node_id":"MDM6Qm90Mzk1MTQ3ODI=","avatar_url":"https://avatars2.githubusercontent.com/in/12526?v=4","gravatar_id":"","url":"https://api.github.com/users/sonarcloud%5Bbot%5D","html_url":"https://github.com/apps/sonarcloud","followers_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/followers","following_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/repos","events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"![Code Smell](https://sonarsource.github.io/sonar-github/code_smell.png 'Code Smell') Code Smell: Remove this unused \"subfieldIndex\" local variable. ([squid:S1481](https://sonarcloud.io/organizations/folio-org/rules#rule_key=squid%3AS1481))\n\n[See it in SonarCloud](https://sonarcloud.io/project/issues?id=org.folio%3Amod-marccat&pullRequest=60&issues=AWf1T9mnXONnvcWDs1j8&open=AWf1T9mnXONnvcWDs1j8)\n\n[ISSUE_KEY]: AWf1T9mnXONnvcWDs1j8","created_at":"2018-12-31T10:34:30Z","updated_at":"2018-12-31T10:34:32Z","html_url":"https://github.com/folio-org/mod-marccat/pull/60#discussion_r244572596","pull_request_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/comments/244572596"},"html":{"href":"https://github.com/folio-org/mod-marccat/pull/60#discussion_r244572596"},"pull_request":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60","id":241346275,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMzQ2Mjc1","html_url":"https://github.com/folio-org/mod-marccat/pull/60","diff_url":"https://github.com/folio-org/mod-marccat/pull/60.diff","patch_url":"https://github.com/folio-org/mod-marccat/pull/60.patch","issue_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/60","number":60,"state":"open","locked":false,"title":"Save record and edit in full_cache","user":{"login":"carmentrazza","id":32632248,"node_id":"MDQ6VXNlcjMyNjMyMjQ4","avatar_url":"https://avatars0.githubusercontent.com/u/32632248?v=4","gravatar_id":"","url":"https://api.github.com/users/carmentrazza","html_url":"https://github.com/carmentrazza","followers_url":"https://api.github.com/users/carmentrazza/followers","following_url":"https://api.github.com/users/carmentrazza/following{/other_user}","gists_url":"https://api.github.com/users/carmentrazza/gists{/gist_id}","starred_url":"https://api.github.com/users/carmentrazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carmentrazza/subscriptions","organizations_url":"https://api.github.com/users/carmentrazza/orgs","repos_url":"https://api.github.com/users/carmentrazza/repos","events_url":"https://api.github.com/users/carmentrazza/events{/privacy}","received_events_url":"https://api.github.com/users/carmentrazza/received_events","type":"User","site_admin":false},"body":"Save record and edit in full_cache","created_at":"2018-12-28T14:53:11Z","updated_at":"2018-12-31T10:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5dca93d1974f9262c8e2484a8481aaf7c44ab275","assignee":{"login":"cchiama","id":39725134,"node_id":"MDQ6VXNlcjM5NzI1MTM0","avatar_url":"https://avatars0.githubusercontent.com/u/39725134?v=4","gravatar_id":"","url":"https://api.github.com/users/cchiama","html_url":"https://github.com/cchiama","followers_url":"https://api.github.com/users/cchiama/followers","following_url":"https://api.github.com/users/cchiama/following{/other_user}","gists_url":"https://api.github.com/users/cchiama/gists{/gist_id}","starred_url":"https://api.github.com/users/cchiama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchiama/subscriptions","organizations_url":"https://api.github.com/users/cchiama/orgs","repos_url":"https://api.github.com/users/cchiama/repos","events_url":"https://api.github.com/users/cchiama/events{/privacy}","received_events_url":"https://api.github.com/users/cchiama/received_events","type":"User","site_admin":false},"assignees":[{"login":"cchiama","id":39725134,"node_id":"MDQ6VXNlcjM5NzI1MTM0","avatar_url":"https://avatars0.githubusercontent.com/u/39725134?v=4","gravatar_id":"","url":"https://api.github.com/users/cchiama","html_url":"https://github.com/cchiama","followers_url":"https://api.github.com/users/cchiama/followers","following_url":"https://api.github.com/users/cchiama/following{/other_user}","gists_url":"https://api.github.com/users/cchiama/gists{/gist_id}","starred_url":"https://api.github.com/users/cchiama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchiama/subscriptions","organizations_url":"https://api.github.com/users/cchiama/orgs","repos_url":"https://api.github.com/users/cchiama/repos","events_url":"https://api.github.com/users/cchiama/events{/privacy}","received_events_url":"https://api.github.com/users/cchiama/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60/commits","review_comments_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60/comments","review_comment_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/60/comments","statuses_url":"https://api.github.com/repos/folio-org/mod-marccat/statuses/1e48a08470c379007f3600f3e38eccc6f79d9ce0","head":{"label":"folio-org:folio-mod-marccat-fullcache","ref":"folio-mod-marccat-fullcache","sha":"1e48a08470c379007f3600f3e38eccc6f79d9ce0","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":155926197,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU5MjYxOTc=","name":"mod-marccat","full_name":"folio-org/mod-marccat","private":false,"owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/folio-org/mod-marccat","description":"FOLIO metadata management / marccat module","fork":false,"url":"https://api.github.com/repos/folio-org/mod-marccat","forks_url":"https://api.github.com/repos/folio-org/mod-marccat/forks","keys_url":"https://api.github.com/repos/folio-org/mod-marccat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-marccat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-marccat/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-marccat/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-marccat/events","assignees_url":"https://api.github.com/repos/folio-org/mod-marccat/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-marccat/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-marccat/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-marccat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-marccat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-marccat/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-marccat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-marccat/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-marccat/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-marccat/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-marccat/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-marccat/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-marccat/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-marccat/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-marccat/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-marccat/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-marccat/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-marccat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-marccat/merges","archive_url":"https://api.github.com/repos/folio-org/mod-marccat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-marccat/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-marccat/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-marccat/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-marccat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-marccat/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-marccat/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-marccat/deployments","created_at":"2018-11-02T22:04:39Z","updated_at":"2018-12-28T17:20:45Z","pushed_at":"2018-12-31T10:32:07Z","git_url":"git://github.com/folio-org/mod-marccat.git","ssh_url":"git@github.com:folio-org/mod-marccat.git","clone_url":"https://github.com/folio-org/mod-marccat.git","svn_url":"https://github.com/folio-org/mod-marccat","homepage":"","size":6904,"stargazers_count":1,"watchers_count":1,"language":"PLpgSQL","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"folio-org:master","ref":"master","sha":"91dd47dcda62b531d379bcc9c64e50533fe34f6a","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":155926197,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU5MjYxOTc=","name":"mod-marccat","full_name":"folio-org/mod-marccat","private":false,"owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/folio-org/mod-marccat","description":"FOLIO metadata management / marccat module","fork":false,"url":"https://api.github.com/repos/folio-org/mod-marccat","forks_url":"https://api.github.com/repos/folio-org/mod-marccat/forks","keys_url":"https://api.github.com/repos/folio-org/mod-marccat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-marccat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-marccat/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-marccat/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-marccat/events","assignees_url":"https://api.github.com/repos/folio-org/mod-marccat/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-marccat/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-marccat/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-marccat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-marccat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-marccat/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-marccat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-marccat/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-marccat/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-marccat/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-marccat/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-marccat/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-marccat/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-marccat/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-marccat/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-marccat/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-marccat/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-marccat/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-marccat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-marccat/merges","archive_url":"https://api.github.com/repos/folio-org/mod-marccat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-marccat/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-marccat/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-marccat/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-marccat/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-marccat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-marccat/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-marccat/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-marccat/deployments","created_at":"2018-11-02T22:04:39Z","updated_at":"2018-12-28T17:20:45Z","pushed_at":"2018-12-31T10:32:07Z","git_url":"git://github.com/folio-org/mod-marccat.git","ssh_url":"git@github.com:folio-org/mod-marccat.git","clone_url":"https://github.com/folio-org/mod-marccat.git","svn_url":"https://github.com/folio-org/mod-marccat","homepage":"","size":6904,"stargazers_count":1,"watchers_count":1,"language":"PLpgSQL","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60"},"html":{"href":"https://github.com/folio-org/mod-marccat/pull/60"},"issue":{"href":"https://api.github.com/repos/folio-org/mod-marccat/issues/60"},"comments":{"href":"https://api.github.com/repos/folio-org/mod-marccat/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/folio-org/mod-marccat/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/folio-org/mod-marccat/statuses/1e48a08470c379007f3600f3e38eccc6f79d9ce0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sonarcloud"}}