{"action":"created","issue":{"url":"https://api.github.com/repos/JabRef/jabref/issues/3830","repository_url":"https://api.github.com/repos/JabRef/jabref","labels_url":"https://api.github.com/repos/JabRef/jabref/issues/3830/labels{/name}","comments_url":"https://api.github.com/repos/JabRef/jabref/issues/3830/comments","events_url":"https://api.github.com/repos/JabRef/jabref/issues/3830/events","html_url":"https://github.com/JabRef/jabref/issues/3830","id":304041619,"number":3830,"title":"Suggestion : performance about multiple calls to replace","user":{"login":"o0lwj0o","id":9102377,"avatar_url":"https://avatars0.githubusercontent.com/u/9102377?v=4","gravatar_id":"","url":"https://api.github.com/users/o0lwj0o","html_url":"https://github.com/o0lwj0o","followers_url":"https://api.github.com/users/o0lwj0o/followers","following_url":"https://api.github.com/users/o0lwj0o/following{/other_user}","gists_url":"https://api.github.com/users/o0lwj0o/gists{/gist_id}","starred_url":"https://api.github.com/users/o0lwj0o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o0lwj0o/subscriptions","organizations_url":"https://api.github.com/users/o0lwj0o/orgs","repos_url":"https://api.github.com/users/o0lwj0o/repos","events_url":"https://api.github.com/users/o0lwj0o/events{/privacy}","received_events_url":"https://api.github.com/users/o0lwj0o/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-10T04:45:29Z","updated_at":"2018-03-10T08:11:08Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n&nbsp;&nbsp;&nbsp;&nbsp;I have found multiple calls to `String.replace(.. , ..)` about the same pattern in the project.\r\nFor example, in the file jabref/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java:\r\n```Java\r\n...\r\n                } else if (\"AU\".equals(beg)) {\r\n                    String author = IsiImporter.isiAuthorsConvert(value.replace(\"EOLEOL\", \" and \"));\r\n                    ...\r\n                } else if (\"TI\".equals(beg)) {\r\n                    hm.put(FieldName.TITLE, value.replace(\"EOLEOL\", \" \"));\r\n                } else if (\"SO\".equals(beg) || \"JA\".equals(beg)) {\r\n                    hm.put(FieldName.JOURNAL, value.replace(\"EOLEOL\", \" \"));\r\n                } else if (\"ID\".equals(beg) || \"KW\".equals(beg)) {\r\n                    value = value.replace(\"EOLEOL\", \" \");\r\n                    ...\r\n                } else if (\"AB\".equals(beg)) {\r\n                    hm.put(FieldName.ABSTRACT, value.replace(\"EOLEOL\", \" \"));\r\n                }\r\n...\r\n```\r\n&nbsp;&nbsp;&nbsp;&nbsp;There are multiple calls to `replace` about \"EOLEOL\". If it was achieved like the following code, it will promote its performance and be able to reuse the pattern.\r\n```Java\r\nPattern pattern = Pattern.compile(regex);\r\npattern.matcher(str).replaceAll(repl);\r\n```"},"comment":{"url":"https://api.github.com/repos/JabRef/jabref/issues/comments/372012166","html_url":"https://github.com/JabRef/jabref/issues/3830#issuecomment-372012166","issue_url":"https://api.github.com/repos/JabRef/jabref/issues/3830","id":372012166,"user":{"login":"Siedlerchr","id":320228,"avatar_url":"https://avatars1.githubusercontent.com/u/320228?v=4","gravatar_id":"","url":"https://api.github.com/users/Siedlerchr","html_url":"https://github.com/Siedlerchr","followers_url":"https://api.github.com/users/Siedlerchr/followers","following_url":"https://api.github.com/users/Siedlerchr/following{/other_user}","gists_url":"https://api.github.com/users/Siedlerchr/gists{/gist_id}","starred_url":"https://api.github.com/users/Siedlerchr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siedlerchr/subscriptions","organizations_url":"https://api.github.com/users/Siedlerchr/orgs","repos_url":"https://api.github.com/users/Siedlerchr/repos","events_url":"https://api.github.com/users/Siedlerchr/events{/privacy}","received_events_url":"https://api.github.com/users/Siedlerchr/received_events","type":"User","site_admin":false},"created_at":"2018-03-10T08:11:08Z","updated_at":"2018-03-10T08:11:08Z","author_association":"CONTRIBUTOR","body":"Sounds pike a good idea, just open a pull request with your changes "}}
{"actor":{"display_login":"Siedlerchr"}}