{"action":"created","comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments/33801436","id":33801436,"diff_hunk":"@@ -0,0 +1,36 @@\n+/**\n+ *  Copyright 2012-2015 Gunnar Morling (http://www.gunnarmorling.de/)\n+ *  and/or other contributors as indicated by the @authors tag. See the\n+ *  copyright.txt file in the distribution for a full listing of all\n+ *  contributors.\n+ *\n+ *  Licensed under the Apache License, Version 2.0 (the \"License\");\n+ *  you may not use this file except in compliance with the License.\n+ *  You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ *  Unless required by applicable law or agreed to in writing, software\n+ *  distributed under the License is distributed on an \"AS IS\" BASIS,\n+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ *  See the License for the specific language governing permissions and\n+ *  limitations under the License.\n+ */\n+package org.mapstruct.ap.internal.model.common;\n+\n+final class TypeFactoryUtil {\n+\n+    private TypeFactoryUtil() {\n+    }\n+\n+    static String trimSimpleClassName(String className) {","path":"processor/src/main/java/org/mapstruct/ap/internal/model/common/TypeFactoryUtil.java","position":26,"original_position":26,"commit_id":"6a1a8d16349ab85c4ca46cb21f7e5820c906477b","original_commit_id":"6a1a8d16349ab85c4ca46cb21f7e5820c906477b","user":{"login":"vgt-tomek","id":5052611,"avatar_url":"https://avatars.githubusercontent.com/u/5052611?v=3","gravatar_id":"","url":"https://api.github.com/users/vgt-tomek","html_url":"https://github.com/vgt-tomek","followers_url":"https://api.github.com/users/vgt-tomek/followers","following_url":"https://api.github.com/users/vgt-tomek/following{/other_user}","gists_url":"https://api.github.com/users/vgt-tomek/gists{/gist_id}","starred_url":"https://api.github.com/users/vgt-tomek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgt-tomek/subscriptions","organizations_url":"https://api.github.com/users/vgt-tomek/orgs","repos_url":"https://api.github.com/users/vgt-tomek/repos","events_url":"https://api.github.com/users/vgt-tomek/events{/privacy}","received_events_url":"https://api.github.com/users/vgt-tomek/received_events","type":"User","site_admin":false},"body":"Here's the thought flow:\r\n\r\n1. Of course at first this method can be private method inside TypeFactory class.\r\n2. However I want it unit tested, therefore I need to have access to it from tests, therefore I increase access from private to package protected.\r\n3. At this point it feels better to have it as separate package protected utility class.\r\n\r\nOf course we can stop at point 2 and still have testable code, going to point 3 is more preference, than necessity.","created_at":"2015-07-02T17:25:22Z","updated_at":"2015-07-02T17:25:22Z","html_url":"https://github.com/mapstruct/mapstruct/pull/586#discussion_r33801436","pull_request_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586","_links":{"self":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments/33801436"},"html":{"href":"https://github.com/mapstruct/mapstruct/pull/586#discussion_r33801436"},"pull_request":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586"}}},"pull_request":{"url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586","id":39007699,"html_url":"https://github.com/mapstruct/mapstruct/pull/586","diff_url":"https://github.com/mapstruct/mapstruct/pull/586.diff","patch_url":"https://github.com/mapstruct/mapstruct/pull/586.patch","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/586","number":586,"state":"open","locked":false,"title":"#581 Prevent multiple imports of similar simple class name from different packages","user":{"login":"vgt-tomek","id":5052611,"avatar_url":"https://avatars.githubusercontent.com/u/5052611?v=3","gravatar_id":"","url":"https://api.github.com/users/vgt-tomek","html_url":"https://github.com/vgt-tomek","followers_url":"https://api.github.com/users/vgt-tomek/followers","following_url":"https://api.github.com/users/vgt-tomek/following{/other_user}","gists_url":"https://api.github.com/users/vgt-tomek/gists{/gist_id}","starred_url":"https://api.github.com/users/vgt-tomek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgt-tomek/subscriptions","organizations_url":"https://api.github.com/users/vgt-tomek/orgs","repos_url":"https://api.github.com/users/vgt-tomek/repos","events_url":"https://api.github.com/users/vgt-tomek/events{/privacy}","received_events_url":"https://api.github.com/users/vgt-tomek/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nAs discussed in bug ticket, I've finalized fix for #581 issue.\r\nFew topics you might want to review, since I don't know yet, if you accept few code conventions I usually follow.\r\n\r\n1. I consider good practice to not modify method parameters, to consider it final. Therefore when I need to modify it, I usually introduce new local variable and use it from there. That's the reason for adding *String trimmedName* in *isImported()* and use it instead of method parameter.\r\n\r\n2. I moved code responsible for handling array brackets in simple class names to separate utility class, so I could add unit tests for it.","created_at":"2015-07-01T17:49:49Z","updated_at":"2015-07-02T17:25:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e00ac2b4bca327f925f6fbacf1a92bb26451fdc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586/commits","review_comments_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586/comments","review_comment_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/586/comments","statuses_url":"https://api.github.com/repos/mapstruct/mapstruct/statuses/6a1a8d16349ab85c4ca46cb21f7e5820c906477b","head":{"label":"vgt-tomek:bug/import-conflict","ref":"bug/import-conflict","sha":"6a1a8d16349ab85c4ca46cb21f7e5820c906477b","user":{"login":"vgt-tomek","id":5052611,"avatar_url":"https://avatars.githubusercontent.com/u/5052611?v=3","gravatar_id":"","url":"https://api.github.com/users/vgt-tomek","html_url":"https://github.com/vgt-tomek","followers_url":"https://api.github.com/users/vgt-tomek/followers","following_url":"https://api.github.com/users/vgt-tomek/following{/other_user}","gists_url":"https://api.github.com/users/vgt-tomek/gists{/gist_id}","starred_url":"https://api.github.com/users/vgt-tomek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgt-tomek/subscriptions","organizations_url":"https://api.github.com/users/vgt-tomek/orgs","repos_url":"https://api.github.com/users/vgt-tomek/repos","events_url":"https://api.github.com/users/vgt-tomek/events{/privacy}","received_events_url":"https://api.github.com/users/vgt-tomek/received_events","type":"User","site_admin":false},"repo":{"id":38130552,"name":"mapstruct","full_name":"vgt-tomek/mapstruct","owner":{"login":"vgt-tomek","id":5052611,"avatar_url":"https://avatars.githubusercontent.com/u/5052611?v=3","gravatar_id":"","url":"https://api.github.com/users/vgt-tomek","html_url":"https://github.com/vgt-tomek","followers_url":"https://api.github.com/users/vgt-tomek/followers","following_url":"https://api.github.com/users/vgt-tomek/following{/other_user}","gists_url":"https://api.github.com/users/vgt-tomek/gists{/gist_id}","starred_url":"https://api.github.com/users/vgt-tomek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgt-tomek/subscriptions","organizations_url":"https://api.github.com/users/vgt-tomek/orgs","repos_url":"https://api.github.com/users/vgt-tomek/repos","events_url":"https://api.github.com/users/vgt-tomek/events{/privacy}","received_events_url":"https://api.github.com/users/vgt-tomek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vgt-tomek/mapstruct","description":"An annotation processor for generating type-safe bean mappers","fork":true,"url":"https://api.github.com/repos/vgt-tomek/mapstruct","forks_url":"https://api.github.com/repos/vgt-tomek/mapstruct/forks","keys_url":"https://api.github.com/repos/vgt-tomek/mapstruct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vgt-tomek/mapstruct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vgt-tomek/mapstruct/teams","hooks_url":"https://api.github.com/repos/vgt-tomek/mapstruct/hooks","issue_events_url":"https://api.github.com/repos/vgt-tomek/mapstruct/issues/events{/number}","events_url":"https://api.github.com/repos/vgt-tomek/mapstruct/events","assignees_url":"https://api.github.com/repos/vgt-tomek/mapstruct/assignees{/user}","branches_url":"https://api.github.com/repos/vgt-tomek/mapstruct/branches{/branch}","tags_url":"https://api.github.com/repos/vgt-tomek/mapstruct/tags","blobs_url":"https://api.github.com/repos/vgt-tomek/mapstruct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vgt-tomek/mapstruct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vgt-tomek/mapstruct/git/refs{/sha}","trees_url":"https://api.github.com/repos/vgt-tomek/mapstruct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vgt-tomek/mapstruct/statuses/{sha}","languages_url":"https://api.github.com/repos/vgt-tomek/mapstruct/languages","stargazers_url":"https://api.github.com/repos/vgt-tomek/mapstruct/stargazers","contributors_url":"https://api.github.com/repos/vgt-tomek/mapstruct/contributors","subscribers_url":"https://api.github.com/repos/vgt-tomek/mapstruct/subscribers","subscription_url":"https://api.github.com/repos/vgt-tomek/mapstruct/subscription","commits_url":"https://api.github.com/repos/vgt-tomek/mapstruct/commits{/sha}","git_commits_url":"https://api.github.com/repos/vgt-tomek/mapstruct/git/commits{/sha}","comments_url":"https://api.github.com/repos/vgt-tomek/mapstruct/comments{/number}","issue_comment_url":"https://api.github.com/repos/vgt-tomek/mapstruct/issues/comments{/number}","contents_url":"https://api.github.com/repos/vgt-tomek/mapstruct/contents/{+path}","compare_url":"https://api.github.com/repos/vgt-tomek/mapstruct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vgt-tomek/mapstruct/merges","archive_url":"https://api.github.com/repos/vgt-tomek/mapstruct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vgt-tomek/mapstruct/downloads","issues_url":"https://api.github.com/repos/vgt-tomek/mapstruct/issues{/number}","pulls_url":"https://api.github.com/repos/vgt-tomek/mapstruct/pulls{/number}","milestones_url":"https://api.github.com/repos/vgt-tomek/mapstruct/milestones{/number}","notifications_url":"https://api.github.com/repos/vgt-tomek/mapstruct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vgt-tomek/mapstruct/labels{/name}","releases_url":"https://api.github.com/repos/vgt-tomek/mapstruct/releases{/id}","created_at":"2015-06-26T19:49:52Z","updated_at":"2015-06-26T19:49:54Z","pushed_at":"2015-07-01T17:40:36Z","git_url":"git://github.com/vgt-tomek/mapstruct.git","ssh_url":"git@github.com:vgt-tomek/mapstruct.git","clone_url":"https://github.com/vgt-tomek/mapstruct.git","svn_url":"https://github.com/vgt-tomek/mapstruct","homepage":"http://mapstruct.org/","size":7203,"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":"mapstruct:master","ref":"master","sha":"2d686003c8dded60fbc8fa06814624e0370c6d72","user":{"login":"mapstruct","id":4086779,"avatar_url":"https://avatars.githubusercontent.com/u/4086779?v=3","gravatar_id":"","url":"https://api.github.com/users/mapstruct","html_url":"https://github.com/mapstruct","followers_url":"https://api.github.com/users/mapstruct/followers","following_url":"https://api.github.com/users/mapstruct/following{/other_user}","gists_url":"https://api.github.com/users/mapstruct/gists{/gist_id}","starred_url":"https://api.github.com/users/mapstruct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapstruct/subscriptions","organizations_url":"https://api.github.com/users/mapstruct/orgs","repos_url":"https://api.github.com/users/mapstruct/repos","events_url":"https://api.github.com/users/mapstruct/events{/privacy}","received_events_url":"https://api.github.com/users/mapstruct/received_events","type":"Organization","site_admin":false},"repo":{"id":4470435,"name":"mapstruct","full_name":"mapstruct/mapstruct","owner":{"login":"mapstruct","id":4086779,"avatar_url":"https://avatars.githubusercontent.com/u/4086779?v=3","gravatar_id":"","url":"https://api.github.com/users/mapstruct","html_url":"https://github.com/mapstruct","followers_url":"https://api.github.com/users/mapstruct/followers","following_url":"https://api.github.com/users/mapstruct/following{/other_user}","gists_url":"https://api.github.com/users/mapstruct/gists{/gist_id}","starred_url":"https://api.github.com/users/mapstruct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapstruct/subscriptions","organizations_url":"https://api.github.com/users/mapstruct/orgs","repos_url":"https://api.github.com/users/mapstruct/repos","events_url":"https://api.github.com/users/mapstruct/events{/privacy}","received_events_url":"https://api.github.com/users/mapstruct/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapstruct/mapstruct","description":"An annotation processor for generating type-safe bean mappers","fork":false,"url":"https://api.github.com/repos/mapstruct/mapstruct","forks_url":"https://api.github.com/repos/mapstruct/mapstruct/forks","keys_url":"https://api.github.com/repos/mapstruct/mapstruct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapstruct/mapstruct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapstruct/mapstruct/teams","hooks_url":"https://api.github.com/repos/mapstruct/mapstruct/hooks","issue_events_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/events{/number}","events_url":"https://api.github.com/repos/mapstruct/mapstruct/events","assignees_url":"https://api.github.com/repos/mapstruct/mapstruct/assignees{/user}","branches_url":"https://api.github.com/repos/mapstruct/mapstruct/branches{/branch}","tags_url":"https://api.github.com/repos/mapstruct/mapstruct/tags","blobs_url":"https://api.github.com/repos/mapstruct/mapstruct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapstruct/mapstruct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapstruct/mapstruct/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapstruct/mapstruct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapstruct/mapstruct/statuses/{sha}","languages_url":"https://api.github.com/repos/mapstruct/mapstruct/languages","stargazers_url":"https://api.github.com/repos/mapstruct/mapstruct/stargazers","contributors_url":"https://api.github.com/repos/mapstruct/mapstruct/contributors","subscribers_url":"https://api.github.com/repos/mapstruct/mapstruct/subscribers","subscription_url":"https://api.github.com/repos/mapstruct/mapstruct/subscription","commits_url":"https://api.github.com/repos/mapstruct/mapstruct/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapstruct/mapstruct/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapstruct/mapstruct/contents/{+path}","compare_url":"https://api.github.com/repos/mapstruct/mapstruct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapstruct/mapstruct/merges","archive_url":"https://api.github.com/repos/mapstruct/mapstruct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapstruct/mapstruct/downloads","issues_url":"https://api.github.com/repos/mapstruct/mapstruct/issues{/number}","pulls_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls{/number}","milestones_url":"https://api.github.com/repos/mapstruct/mapstruct/milestones{/number}","notifications_url":"https://api.github.com/repos/mapstruct/mapstruct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/labels{/name}","releases_url":"https://api.github.com/repos/mapstruct/mapstruct/releases{/id}","created_at":"2012-05-28T12:42:42Z","updated_at":"2015-07-02T01:49:08Z","pushed_at":"2015-07-01T17:49:49Z","git_url":"git://github.com/mapstruct/mapstruct.git","ssh_url":"git@github.com:mapstruct/mapstruct.git","clone_url":"https://github.com/mapstruct/mapstruct.git","svn_url":"https://github.com/mapstruct/mapstruct","homepage":"http://mapstruct.org/","size":7203,"stargazers_count":145,"watchers_count":145,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":82,"forks":37,"open_issues":82,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586"},"html":{"href":"https://github.com/mapstruct/mapstruct/pull/586"},"issue":{"href":"https://api.github.com/repos/mapstruct/mapstruct/issues/586"},"comments":{"href":"https://api.github.com/repos/mapstruct/mapstruct/issues/586/comments"},"review_comments":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586/comments"},"review_comment":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/586/commits"},"statuses":{"href":"https://api.github.com/repos/mapstruct/mapstruct/statuses/6a1a8d16349ab85c4ca46cb21f7e5820c906477b"}}}}