1437 Commits

Author SHA1 Message Date
Sjaak Derksen
1187e357c1
#2239 matching generics (#2320) 2021-03-28 17:34:59 +02:00
Filip Hrisafov
e7f6813d9a #2356 Implicitly ignore reverse inherited mappings that do not have read and write methods 2021-03-27 16:12:44 +01:00
Filip Hrisafov
1964c809d8 Fix typo in missing code formatting in documentation
Closes #2385
2021-03-16 20:24:51 +01:00
Filip Hrisafov
197dd4327a #2339 Polish PR #2362
Use MappingEntry for defaultTarget and nullTarget in ValueMappingMethod to simplify certain things
2021-03-15 00:32:02 +01:00
jude.niroshan11@gmail.com
c4135e68ed #2339 Support throwing an exception as an Enum Mapping option 2021-03-15 00:32:01 +01:00
Jude Niroshan
228660c74f
#2366 Update documentation in regards to Java Module System 2021-03-07 14:11:45 +01:00
Jeroen van Wilgenburg
d9fdd86b94 #2368 fix order of target parameter in tests (and removed some spaces) 2021-03-01 20:58:13 +01:00
Jeroen van Wilgenburg
d5703d3ee8 #2368 fix order of target parameter in documentation 2021-03-01 20:58:13 +01:00
Filip Hrisafov
85af901ea7 #2350 Generate core string to enum mapping when AnyRemaining or AnyUnmapped is not used 2021-02-07 11:21:59 +01:00
Filip Hrisafov
07f5189a72 #2347 Do not generate mapper implementation for private mappers
Provide a compiler error message instead of generating code that will not compile
2021-02-07 11:03:04 +01:00
Filip Hrisafov
f4b62ded89 #2352 Add source element type for Iterable mappings
When the Iterable type we are mapping is not generic
(i.e. it is a custom type extending an Iterable) then the source element type
which is included in the loop was not imported.
2021-02-07 10:37:49 +01:00
Filip Hrisafov
630a8da904 Fix a typo in the Mapper#componentModel 2021-02-06 16:44:07 +01:00
Filip Hrisafov
b643061b57 #2277 Add tests with fixtures with testing the generated source code 2021-02-06 16:31:18 +01:00
dmngb
c59ca79e7f
#2277 default component model: mapper reference use singleton INSTANCE if it exists (#2280)
This allows to easily avoid the runtime dependency on mapstruct.jar:
we can avoid Mappers.getMapper(...) for instantiating used mappers if
the code follows the conventional pattern for creating mapper singletons.

Co-authored-by: GIBOU Damien <damien.gibou@biomerieux.com>
2021-02-06 16:10:32 +01:00
Filip Hrisafov
aeadf8cb77
Update readme with latest released 1.4.2.Final release 2021-01-31 14:52:11 +01:00
Filip Hrisafov
08af258533 #2346 Update documentation and readme about MapStruct and Gradle
Remove obsolete net.ltgt.apt
Use com.diffplug.eclipse.apt for Eclipse
IntelliJ works transparently
2021-01-31 09:26:58 +01:00
Filip Hrisafov
0d8bbacc53 #2250, #2324 Do not throw error when qualifier is missing on iterable mapping
With this change we are relaxing the error handling when qualifiers are used in `@Mapping`
and we allow defining qualifiers for collections / array mapping to mean the same as if it was defined on `@IterableMapping`
i.e. apply the qualifier on the element mapping
2021-01-30 09:43:16 +01:00
Sjaak Derksen
8478a5455b
#2278 inherited property ignored due to ignore on nested level (#2332)
Co-authored-by: sjaakd <sjaakderksen@zonnet.nl>
2021-01-23 09:15:46 +01:00
Filip Hrisafov
dfc7528096 Small fixes for Java 16
* Upgrade japicmp-maven-plugin to 0.15.2
* Do not use deprecated for removal Long constructor
* Update Spring to 5.3.3
* Upgrade Lombok to 1.18.16 + add lombok-mapstruct-binding
2021-01-22 08:33:03 +01:00
Tomas Poledny
4223e3ab81 #2255 Add constants for componentModel 2021-01-17 15:13:42 +01:00
Filip Hrisafov
700293f089 #2301 Implicitly ignore forward inherited mappings from different method types 2021-01-01 21:30:25 +01:00
Filip Hrisafov
f84f756a4c #2293 Use MapperConfig instead of MappingConfig in the documentation 2021-01-01 21:29:48 +01:00
Michael Düsterhus
e73dd1b485 Update chapter-2-set-up.asciidoc
See official maven doc on this: https://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
Otherwise for example intellij doesn't recognize the compiler options on maven import
2020-12-15 19:32:19 +01:00
Filip Hrisafov
84c3bda5a2
#2274, #2023 Fix problems with property mapping using source parameters
Fixes problems when property mapping is using source parameter and has default value / expression or is doing an update
2020-11-22 13:04:26 +01:00
Nikolas Charalambidis
6daea86a1b
Add Lombok subsection in the documentation (#2266) 2020-11-11 22:28:53 +01:00
Filip Hrisafov
6df9243d92 #2253 remove unmapped source properties when source parameter is directly mapped 2020-11-08 09:57:10 +01:00
Filip Hrisafov
75f963adf6 #2263 Fix IndexOutOfBoundsException when resolving TypeVar to a Type 2020-11-08 09:56:15 +01:00
Nikolas Charalambidis
8f9df5b69b
#2258 Fixes vague description of @Default and @ConstructorProperties annotations 2020-11-04 21:39:06 +01:00
Filip Hrisafov
749ded96c1 #2251 Fix incorrect code generated for constructor mapping from implicit source parameter matching 2020-11-01 14:59:44 +01:00
Filip Hrisafov
3256abb79c #2244 Mark mapstruct-processor jar as Spring-Boot-Jar-Type: annotation-processor
Doing this would make sure that starting from Spring Boot 2.4 the mapstruct-processor will not be included in the fat jar produced by the Spring Boot maven plugin if people have it as a maven provided dependency.

This is an alternative if people are not using the maven-compiler-plugin annotationProcessorPaths
2020-10-28 08:54:01 +01:00
Filip Hrisafov
85890dd442 #2245 Local variable should be created when using default value 2020-10-25 14:42:48 +01:00
Kemal Ozcan
e67daa3710 mapstruct#597 Built-In conversion between String and StringBuilder 2020-10-24 17:33:53 +02:00
Saheb Preet Singh
26f62b7ef0 #607 Mapping Iterable<?> object to an object instead of collection 2020-10-21 21:20:46 +02:00
Sjaak Derksen
c2e8034030
861 remove compiler specific workarounds (#2227) 2020-10-21 20:02:28 +02:00
Filip Hrisafov
74d06fea5d #2233 Allow generic of generics in types when matching
e.g. method signature such as
<T> T fromOptional(Optional<T> optional)

when T resolves to another generic class such as Collection<String>
2020-10-21 17:00:05 +02:00
Filip Hrisafov
6102d0cc8e #2236 Different nested target mappings should generate different intermediate methods
Make sure that MappingReferences are taken into consideration when comparing whether 2 mapping methods are equal.
This makes sure that when using nested target mappings that have the same property mappings, but different mappings 2 distinct methods will be created
2020-10-18 22:31:08 +02:00
Filip Hrisafov
50aa9cdbdc Use junit version defined in parent in integration tests 2020-10-17 12:30:43 +02:00
dependabot[bot]
4ddfd2ff51 Bump junit from 4.12 to 4.13.1 in /parent
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-14 15:46:19 +02:00
Filip Hrisafov
0e902d6412 Update versions in readme to 1.4.1.Final 1.4.1.Final 2020-10-11 10:00:24 +02:00
Filip Hrisafov
58dbaee472 [maven-release-plugin] prepare for next development iteration 2020-10-11 09:35:30 +02:00
Filip Hrisafov
d8f22f8311 [maven-release-plugin] prepare release 1.4.1.Final 2020-10-11 09:35:30 +02:00
Filip Hrisafov
2b95e07d8e Turn of Maven connection pooling to avoid connection issues on CI
The problem and solution are explained in https://github.com/actions/virtual-environments/issues/1499#issuecomment-689467080
2020-10-10 10:22:43 +02:00
Filip Hrisafov
53a5c34ed6 #2206, #2214, #2220: Source property should be correctly determined when only target is defined
When having multiple source properties and only target is defined then the same rules should be applied as if there was no mapping:

* First we check for a matching property in any of the source type
* Second we check if the parameter name matches
2020-10-10 09:44:01 +02:00
Filip Hrisafov
a5f49e591e #2221: Fix configuration inheritance when there are multiple matching source parameters of the same type 2020-10-10 09:43:30 +02:00
Filip Hrisafov
823b5edd9f #2213: primitive arrays should be directly mapped (we are cloning them anyways)
Additionally fix problem when annotations `ElementType.TYPE_USE` not handled correctly for javac
2020-10-03 16:54:01 +02:00
Filip Hrisafov
233fc6de98 #2215: Avoid NPE in IntelliJ EAP 2020.3
Starting from IntelliJ 2020.3 (Build 203.4203.26) the ProcessingEnvironment is wrapped in a Proxy class by IntelliJ.
MapStruct should gracefully handle that and not throw an NPE.
Additionally, we should do best effort to put the used compiler in the generated annotation info
2020-10-03 16:47:31 +02:00
Jasper Vandemalle
4480e0f367 Fix minor typos 2020-10-03 00:35:28 +02:00
Filip Hrisafov
2d750193d1 Update versions in readme to 1.4.0.Final 2020-09-26 11:45:27 +02:00
Filip Hrisafov
eb5b8bb71e [maven-release-plugin] prepare for next development iteration 2020-09-26 10:20:47 +02:00
Filip Hrisafov
9973b92ccb [maven-release-plugin] prepare release 1.4.0.Final 1.4.0.Final 2020-09-26 10:20:45 +02:00