{"action":"created","issue":{"url":"https://api.github.com/repos/orika-mapper/orika/issues/175","repository_url":"https://api.github.com/repos/orika-mapper/orika","labels_url":"https://api.github.com/repos/orika-mapper/orika/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/orika-mapper/orika/issues/175/comments","events_url":"https://api.github.com/repos/orika-mapper/orika/issues/175/events","html_url":"https://github.com/orika-mapper/orika/issues/175","id":196663150,"number":175,"title":"NullPointerException when map an element to a list","user":{"login":"andreabertagnolli","id":8570990,"avatar_url":"https://avatars.githubusercontent.com/u/8570990?v=3","gravatar_id":"","url":"https://api.github.com/users/andreabertagnolli","html_url":"https://github.com/andreabertagnolli","followers_url":"https://api.github.com/users/andreabertagnolli/followers","following_url":"https://api.github.com/users/andreabertagnolli/following{/other_user}","gists_url":"https://api.github.com/users/andreabertagnolli/gists{/gist_id}","starred_url":"https://api.github.com/users/andreabertagnolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreabertagnolli/subscriptions","organizations_url":"https://api.github.com/users/andreabertagnolli/orgs","repos_url":"https://api.github.com/users/andreabertagnolli/repos","events_url":"https://api.github.com/users/andreabertagnolli/events{/privacy}","received_events_url":"https://api.github.com/users/andreabertagnolli/received_events","type":"User","site_admin":false},"labels":[{"id":22565181,"url":"https://api.github.com/repos/orika-mapper/orika/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-20T12:40:36Z","updated_at":"2017-01-02T11:40:21Z","closed_at":null,"body":"Maybe I missing the correct use, but I want to map a single value in every object inside a list.\r\n\r\nHere's the failing test case:\r\n`\r\n     public void maps_one_value_to_all_elements_in_collection() {\r\n        DefaultMapperFactory mapper = new DefaultMapperFactory.Builder().build();\r\n\r\n        mapper.classMap(Source.class, Destination.class)\r\n                .field(\"nested\", \"nested\")\r\n                .field(\"value\", \"nested{value}\")\r\n                .byDefault()\r\n                .register();\r\n\r\n        Source source = new Source();\r\n        source.setValue(\"some data\");\r\n        source.setNested(Arrays.asList(aNestedSource(\"one\"), aNestedSource(\"two\")));\r\n\r\n        Destination destination = mapper.getMapperFacade().map(source, Destination.class);\r\n\r\n        assertEquals(\"some data\", destination.getNested().get(0).getValue());\r\n        assertEquals(\"some data\", destination.getNested().get(1).getValue());\r\n    }\r\n\r\n    private NestedSource aNestedSource(String id) {\r\n        NestedSource nested = new NestedSource();\r\n        nested.setId(id);\r\n        return nested;\r\n    }\r\n\r\n    public static class Source {\r\n\r\n        private String value;\r\n        private List<NestedSource> nested = new ArrayList();\r\n\r\n        public void setValue(String value) {\r\n            this.value = value;\r\n        }\r\n\r\n        public String getValue() {\r\n            return value;\r\n        }\r\n\r\n        public void setNested(List<NestedSource> nested) {\r\n            this.nested = nested;\r\n        }\r\n\r\n        public List<NestedSource> getNested() {\r\n            return nested;\r\n        }\r\n    }\r\n\r\n    public static class Destination {\r\n\r\n        private List<NestedDestination> nested;\r\n\r\n        public List<NestedDestination> getNested() {\r\n            return nested;\r\n        }\r\n\r\n        public void setNested(List<NestedDestination> nested) {\r\n            this.nested = nested;\r\n        }\r\n    }\r\n\r\n    public static class NestedSource {\r\n\r\n        private String id;\r\n\r\n        public void setId(String id) {\r\n            this.id = id;\r\n        }\r\n\r\n        public String getId() {\r\n            return id;\r\n        }\r\n    }\r\n\r\n    public static class NestedDestination {\r\n        private String id;\r\n        private String value;\r\n\r\n        public String getId() {\r\n            return id;\r\n        }\r\n\r\n        public void setId(String id) {\r\n            this.id = id;\r\n        }\r\n\r\n        public String getValue() {\r\n            return value;\r\n        }\r\n\r\n        public void setValue(String value) {\r\n            this.value = value;\r\n        }\r\n    }\r\n`\r\n\r\nI'll look at the code by myself, but any help appreciated :)"},"comment":{"url":"https://api.github.com/repos/orika-mapper/orika/issues/comments/269961900","html_url":"https://github.com/orika-mapper/orika/issues/175#issuecomment-269961900","issue_url":"https://api.github.com/repos/orika-mapper/orika/issues/175","id":269961900,"user":{"login":"brabenetz","id":1237858,"avatar_url":"https://avatars.githubusercontent.com/u/1237858?v=3","gravatar_id":"","url":"https://api.github.com/users/brabenetz","html_url":"https://github.com/brabenetz","followers_url":"https://api.github.com/users/brabenetz/followers","following_url":"https://api.github.com/users/brabenetz/following{/other_user}","gists_url":"https://api.github.com/users/brabenetz/gists{/gist_id}","starred_url":"https://api.github.com/users/brabenetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brabenetz/subscriptions","organizations_url":"https://api.github.com/users/brabenetz/orgs","repos_url":"https://api.github.com/users/brabenetz/repos","events_url":"https://api.github.com/users/brabenetz/events{/privacy}","received_events_url":"https://api.github.com/users/brabenetz/received_events","type":"User","site_admin":false},"created_at":"2017-01-02T11:40:21Z","updated_at":"2017-01-02T11:40:21Z","body":"Great Work!\r\nCan you please review my comment on #104?\r\nI think #104 can be closed after that."}}
{"actor":{"display_login":"brabenetz"}}