{"action":"created","comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments/54165736","id":54165736,"diff_hunk":"@@ -0,0 +1,49 @@\n+/**\n+ *  Copyright 2012-2016 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.test.accessingmappers;\n+\n+import org.mapstruct.Mapper;\n+import org.mapstruct.factory.Mappers;\n+\n+\n+/**\n+ *\n+ * @author Sjaak Derksen\n+ */\n+@Mapper(uses = { RadioMapper.class, TvMapper.class } )\n+public abstract class InventoryMapper {\n+\n+    public static final InventoryMapper INSTANCE = Mappers.getMapper( InventoryMapper.class );\n+\n+    private final InventorySequence inventorySequence = new InventorySequence();\n+\n+    public  InventoryEntity mapInventory(InventoryDto source) {\n+        getRadioMapper().init( inventorySequence );","path":"processor/src/test/java/org/mapstruct/ap/test/accessingmappers/InventoryMapper.java","position":37,"original_position":37,"commit_id":"70cf9640b1dfd057fb8737ffbd1026ec4c28c719","original_commit_id":"70cf9640b1dfd057fb8737ffbd1026ec4c28c719","user":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars.githubusercontent.com/u/6173283?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaakd","html_url":"https://github.com/sjaakd","followers_url":"https://api.github.com/users/sjaakd/followers","following_url":"https://api.github.com/users/sjaakd/following{/other_user}","gists_url":"https://api.github.com/users/sjaakd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaakd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaakd/subscriptions","organizations_url":"https://api.github.com/users/sjaakd/orgs","repos_url":"https://api.github.com/users/sjaakd/repos","events_url":"https://api.github.com/users/sjaakd/events{/privacy}","received_events_url":"https://api.github.com/users/sjaakd/received_events","type":"User","site_admin":false},"body":"> I take it you don't use Spring or CDI?\r\n\r\nNope..  The standard component model.\r\n\r\n\r\n> The issue I see with the current proposal is that the other classes using the sequence can't assign the sequence passed via init() to a final field, thus these references may not be published safely to other threads.\r\n\r\nI reckon thread safety is up to the programmer. If he/she want's to use this in a static context, or in a context that pools objects, he/she should be aware of this. Personally, I recreate mappers via the `Mapper.getMapper` whenever I need one..\r\n","created_at":"2016-02-25T21:15:13Z","updated_at":"2016-02-25T21:15:13Z","html_url":"https://github.com/mapstruct/mapstruct/pull/763#discussion_r54165736","pull_request_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763","_links":{"self":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments/54165736"},"html":{"href":"https://github.com/mapstruct/mapstruct/pull/763#discussion_r54165736"},"pull_request":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763"}}},"pull_request":{"url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763","id":60087450,"html_url":"https://github.com/mapstruct/mapstruct/pull/763","diff_url":"https://github.com/mapstruct/mapstruct/pull/763.diff","patch_url":"https://github.com/mapstruct/mapstruct/pull/763.patch","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/763","number":763,"state":"open","locked":false,"title":"#751, making used mappers available","user":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars.githubusercontent.com/u/6173283?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaakd","html_url":"https://github.com/sjaakd","followers_url":"https://api.github.com/users/sjaakd/followers","following_url":"https://api.github.com/users/sjaakd/following{/other_user}","gists_url":"https://api.github.com/users/sjaakd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaakd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaakd/subscriptions","organizations_url":"https://api.github.com/users/sjaakd/orgs","repos_url":"https://api.github.com/users/sjaakd/repos","events_url":"https://api.github.com/users/sjaakd/events{/privacy}","received_events_url":"https://api.github.com/users/sjaakd/received_events","type":"User","site_admin":false},"body":"This PR makes the used mappers available for initialization or other state changes. The factory part of #751 is not addressed in this PR.","created_at":"2016-02-21T13:18:00Z","updated_at":"2016-02-25T21:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f7dffa949f366d15f7d9703c599792619657cb2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763/commits","review_comments_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763/comments","review_comment_url":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/763/comments","statuses_url":"https://api.github.com/repos/mapstruct/mapstruct/statuses/70cf9640b1dfd057fb8737ffbd1026ec4c28c719","head":{"label":"sjaakd:751","ref":"751","sha":"70cf9640b1dfd057fb8737ffbd1026ec4c28c719","user":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars.githubusercontent.com/u/6173283?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaakd","html_url":"https://github.com/sjaakd","followers_url":"https://api.github.com/users/sjaakd/followers","following_url":"https://api.github.com/users/sjaakd/following{/other_user}","gists_url":"https://api.github.com/users/sjaakd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaakd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaakd/subscriptions","organizations_url":"https://api.github.com/users/sjaakd/orgs","repos_url":"https://api.github.com/users/sjaakd/repos","events_url":"https://api.github.com/users/sjaakd/events{/privacy}","received_events_url":"https://api.github.com/users/sjaakd/received_events","type":"User","site_admin":false},"repo":{"id":15548682,"name":"mapstruct","full_name":"sjaakd/mapstruct","owner":{"login":"sjaakd","id":6173283,"avatar_url":"https://avatars.githubusercontent.com/u/6173283?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaakd","html_url":"https://github.com/sjaakd","followers_url":"https://api.github.com/users/sjaakd/followers","following_url":"https://api.github.com/users/sjaakd/following{/other_user}","gists_url":"https://api.github.com/users/sjaakd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaakd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaakd/subscriptions","organizations_url":"https://api.github.com/users/sjaakd/orgs","repos_url":"https://api.github.com/users/sjaakd/repos","events_url":"https://api.github.com/users/sjaakd/events{/privacy}","received_events_url":"https://api.github.com/users/sjaakd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sjaakd/mapstruct","description":"An annotation processor for generating type-safe bean mappers","fork":true,"url":"https://api.github.com/repos/sjaakd/mapstruct","forks_url":"https://api.github.com/repos/sjaakd/mapstruct/forks","keys_url":"https://api.github.com/repos/sjaakd/mapstruct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjaakd/mapstruct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjaakd/mapstruct/teams","hooks_url":"https://api.github.com/repos/sjaakd/mapstruct/hooks","issue_events_url":"https://api.github.com/repos/sjaakd/mapstruct/issues/events{/number}","events_url":"https://api.github.com/repos/sjaakd/mapstruct/events","assignees_url":"https://api.github.com/repos/sjaakd/mapstruct/assignees{/user}","branches_url":"https://api.github.com/repos/sjaakd/mapstruct/branches{/branch}","tags_url":"https://api.github.com/repos/sjaakd/mapstruct/tags","blobs_url":"https://api.github.com/repos/sjaakd/mapstruct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjaakd/mapstruct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjaakd/mapstruct/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjaakd/mapstruct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjaakd/mapstruct/statuses/{sha}","languages_url":"https://api.github.com/repos/sjaakd/mapstruct/languages","stargazers_url":"https://api.github.com/repos/sjaakd/mapstruct/stargazers","contributors_url":"https://api.github.com/repos/sjaakd/mapstruct/contributors","subscribers_url":"https://api.github.com/repos/sjaakd/mapstruct/subscribers","subscription_url":"https://api.github.com/repos/sjaakd/mapstruct/subscription","commits_url":"https://api.github.com/repos/sjaakd/mapstruct/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjaakd/mapstruct/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjaakd/mapstruct/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjaakd/mapstruct/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjaakd/mapstruct/contents/{+path}","compare_url":"https://api.github.com/repos/sjaakd/mapstruct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjaakd/mapstruct/merges","archive_url":"https://api.github.com/repos/sjaakd/mapstruct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjaakd/mapstruct/downloads","issues_url":"https://api.github.com/repos/sjaakd/mapstruct/issues{/number}","pulls_url":"https://api.github.com/repos/sjaakd/mapstruct/pulls{/number}","milestones_url":"https://api.github.com/repos/sjaakd/mapstruct/milestones{/number}","notifications_url":"https://api.github.com/repos/sjaakd/mapstruct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjaakd/mapstruct/labels{/name}","releases_url":"https://api.github.com/repos/sjaakd/mapstruct/releases{/id}","deployments_url":"https://api.github.com/repos/sjaakd/mapstruct/deployments","created_at":"2013-12-31T11:17:00Z","updated_at":"2015-05-08T20:21:16Z","pushed_at":"2016-02-25T20:08:13Z","git_url":"git://github.com/sjaakd/mapstruct.git","ssh_url":"git@github.com:sjaakd/mapstruct.git","clone_url":"https://github.com/sjaakd/mapstruct.git","svn_url":"https://github.com/sjaakd/mapstruct","homepage":"http://mapstruct.org/","size":4171,"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":"18912727cad64c27158d3b83c279effe4b861eae","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}","deployments_url":"https://api.github.com/repos/mapstruct/mapstruct/deployments","created_at":"2012-05-28T12:42:42Z","updated_at":"2016-02-24T02:08:21Z","pushed_at":"2016-02-25T20:08:13Z","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":5388,"stargazers_count":286,"watchers_count":286,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":132,"forks":76,"open_issues":132,"watchers":286,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763"},"html":{"href":"https://github.com/mapstruct/mapstruct/pull/763"},"issue":{"href":"https://api.github.com/repos/mapstruct/mapstruct/issues/763"},"comments":{"href":"https://api.github.com/repos/mapstruct/mapstruct/issues/763/comments"},"review_comments":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763/comments"},"review_comment":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapstruct/mapstruct/pulls/763/commits"},"statuses":{"href":"https://api.github.com/repos/mapstruct/mapstruct/statuses/70cf9640b1dfd057fb8737ffbd1026ec4c28c719"}}}}