1501 Commits

Author SHA1 Message Date
Zegveld
72e6b1feb5
#2636: defaultValue combined with qualified should not convert if not needed (#2637) 2021-11-14 20:11:05 +01:00
Filip Hrisafov
735a5bef6a
#2225 Add support for suppressing the generation of the timestamp through Mapper and MapperConfig 2021-11-06 09:21:16 +01:00
Filip Hrisafov
166eb699c7 #1752 Always return mapping target when using update methods with return 2021-10-31 17:41:49 +01:00
Filip Hrisafov
907d605160 #2624 Nested target methods should be inherited for forged Map to Bean methods 2021-10-31 17:11:54 +01:00
Zegveld
ca2529f862
#598: Errors/Warnings now end up in the @Mapper annotated class. (#2634)
#598: Errors/Warnings now end up in the @Mapper annotated class.

Co-authored-by: Ben Zegveld <Ben.Zegveld@gmail.com>
2021-10-31 16:46:35 +01:00
Henning Pöttker
e32fc8c283 #2351 NullValueMappingStrategy for Maps and Iterables
With two new parameters for Mapper and MapperConfig, it is now possible to override the nullValueMappingStrategy specifically for MapMapping and IterableMapping.
2021-10-30 13:36:26 +02:00
Filip Hrisafov
80d26a1a9c
#148, #1386, #2593 Only import top level classes
Instead of importing all classes, inner classes will be used through their top level classes only.
This also fixes the problem in #2593 since inner classes are no longer imported but used through their top classes
2021-10-25 08:22:26 +02:00
Filip Hrisafov
564455ee45 #2596 Record components should have the highest priority for read accessors 2021-10-25 08:21:18 +02:00
Filip Hrisafov
935c03e822 #2614 Do not use FQN when mapping Stream to Array 2021-10-25 08:20:59 +02:00
Filip Hrisafov
e86c0faf04 #2611 Scope org.eclipse.tycho:tycho-compiler-jdt under test
Since the removal of the Eclipse Specific compiler workarounds in c2e803403027f3fae92bd15b0ba50ab7df5063e6
the org.eclipse.tycho:tycho-compiler-jdt dependency is no longer needed in the compile code, we only need it for tests
2021-10-24 12:50:49 +02:00
Zegveld
5df6b7a75b
#131, #2438, #366 Add support for Type-Refinement (Downcast) Mapping (#2512)
Add new `@SubclassMapping` for creating Downcast mapping.
When a parent mapping method is annotated with `@SubclassMapping` 
it will now generate an instanceof check inside the parent mapping 
and generate the subclass mappings if they are not manually defined. 

There is also `SubclassExhaustiveStrategy` for controlling what MapStruct should do in case the target type is abstract and there is no suitable way to create it.
2021-10-19 20:44:25 +02:00
valery1707
f167e7a20c Fix typo in JavaDoc 2021-10-16 21:01:20 +02:00
Filip Hrisafov
8b84f5b7d7 #2591 Update dependencies so tests run on Java 18
Update GitHub Actions for tests to run on Java 11, 13, 16, 17 and 18-ea
2021-09-21 22:17:24 +02:00
Filip Hrisafov
b59a23965a #2554 Records should not treat collections as alternative target accessors 2021-09-19 11:42:33 +02:00
Filip Hrisafov
2c23b935db #2541 fix incorrect name for TypeVar with ElementType.TYPE_USE for javac-with-errorprone 2021-09-19 11:41:57 +02:00
Yusuf Kemal Özcan
f0a13bb306 #2555 Add unmappedSourcePolicy annotation processor argument 2021-09-07 22:12:01 +02:00
Tobias Meggendorfer
9057d68cd2
Use DefaultLocale for more stable Issue2544MapperTest (#2569) 2021-08-31 21:45:25 +02:00
Tobias Meggendorfer
9ed4e389f8 #2560 Ignore source properties if ignoreByDefault = true 2021-08-30 21:36:55 +02:00
Daniel Franco
7064e0bc97
Update maven wrapper version to 3.8.2 (#2557) 2021-08-23 16:19:02 +02:00
Adam Szatyin
c52ff812aa
#2552 Add built in conversion between URL and String 2021-08-17 19:21:07 +02:00
Bas Claessen
eb12c485ee
#2515 add ambiguous constructors to ambiguous constructor error message 2021-08-14 09:07:22 +02:00
Bas Claessen
06c416043c
#2515 add ambiguous constructors to ambiguous constructor error message 2021-08-14 09:06:54 +02:00
Henning Pöttker
0d8729767b
Remove remaining references to Hickory (#2511) 2021-08-14 08:38:36 +02:00
Zegveld
c1fa9bd0bd
#2537 Fix incorrect unmapped source property when only defined in Mapping#target 2021-08-14 08:37:20 +02:00
Zegveld
8ad55b164f
#2544: fix missing helper methods for ReverseConversion 2021-08-11 11:35:45 +02:00
Zegveld
196528e578
#2530: fix missing supporting fields for ReverseConversion 2021-08-11 06:49:05 +02:00
Amogh
e6e9b6ce92
#2525 add available transformations to CaseEnumTransformationStrategy exception 2021-07-22 10:08:54 +02:00
Filip Hrisafov
8c554b9556 Change reference from Google Group to GitHub Discussions in reference guide 2021-07-18 15:55:17 +02:00
Filip Hrisafov
43dfd92e05 [maven-release-plugin] prepare for next development iteration 2021-07-18 15:15:44 +02:00
Filip Hrisafov
a91b93f357 [maven-release-plugin] prepare release 1.5.0.Beta1 1.5.0.Beta1 2021-07-18 15:15:44 +02:00
Sjaak Derksen
a95d1c59c3
#2505 deepclone generates enum mapping method (#2507) 2021-07-03 15:28:10 +02:00
Filip Hrisafov
38744d9f73 Add users that have contributed to 1.5 to the copyright.txt 2021-06-27 18:43:13 +02:00
Christian Kosmowski
985ca2fe64 #1075 Support for Mapping from Map<String, ???> to Bean
Co-authored-by: Filip Hrisafov <filip.hrisafov@gmail.com>
2021-06-27 07:34:37 +02:00
Filip Hrisafov
fb9c7a3ded #2491 Do not use types not part of java.base in MapStruct processor
MapStruct should not use types that are outside of java.base.
This makes sure that no additional dependencies (such as jaxb-api) are needed on the annotation processor path
2021-06-27 07:34:14 +02:00
Filip Hrisafov
c5c292f602 #2501 Add test case 2021-06-27 07:33:45 +02:00
Andrew
1bf698785c
Fix typo in Named.java (#2500) 2021-06-24 19:19:02 +02:00
chaos
4c338fa1db fix(pom): fix gradle repo url 404
original url is 404 replace with new url
2021-06-23 13:02:14 +02:00
Tobias Meggendorfer
5d8fcfa033 #2481 Report ignored source properties which are missing 2021-06-21 19:50:58 +02:00
Filip Hrisafov
845d83e9d5 #2439 Do not throw NPE getting accessors for null typeElement
Provide better error message if the source type has no read properties
2021-06-20 08:55:57 +02:00
Filip Hrisafov
934a47323a #2478 Make sure that forged methods do not generate duplicate method parameters 2021-06-19 15:55:41 +02:00
Sjaak Derksen
7f38efad4d
#2463 Selection stops when method type-args are flipped (#2487) 2021-06-19 13:56:26 +02:00
Filip Hrisafov
55c62ab43f #2108 Make sure Javadoc can be generated with Java 11
Remove the org.jboss.apiviz.APIviz doclet since it is no longer compatible with Java 11.
Add new group in the Javadoc for the MapStruct Processor SPI
Fix Javadoc warnings
2021-06-19 11:50:48 +02:00
Filip Hrisafov
046077f701 #2483: Update Asciidoctor to latest versions 2021-06-19 11:49:38 +02:00
Filip Hrisafov
08016d9ef2
#2446 Use DefaultLocale and DefaultTimeZone from JUnit Pioneer
Configure the JUnit Platform to run the processor tests in parallel by running different test classes in concurrent threads
2021-06-12 10:16:40 +02:00
Filip Hrisafov
9ce9d4fb3a #2375 Add records cross module integration test 2021-06-12 09:23:36 +02:00
Filip Hrisafov
857f87276f #2466 Update dependencies so tests run on Java 16+
Update GitHub Actions for tests to run on Java 11, 13, 16 and 17-ea.
Update Lombok so tests can run on 16+
Add jaxb-runtime dependency to the maven-jaxb2-plugin see https://github.com/highsource/maven-jaxb2-plugin/issues/148
Disable cdi integration test on Java 16+ until we find a solution for them
2021-06-12 09:20:33 +02:00
Filip Hrisafov
70ea65f7aa #2437 Do not visit the same type element twice when retrieving methods
When using the diamond inheritance a TypeElement might be visited twice.
This is however, incorrect. We need to visit a TypeElement exactly once.
2021-05-16 19:08:45 +02:00
Ewald volkert
a6ac4f3fd6 #2329 use fields for custom date formats with DateTimeFormatter in order to optimise its usage
* GetDateTimeFormatterField
** a FieldReference that creates DateTimeFormatters
   for given dateFormat as mapper fields
** variableName is created using given dateFormat

* AbstractJavaTimeToStringConversion
  provides GetDateTimeFormatterField as required helper field
  using DateTimeFormatter instances provided as mapper fields
  by GetDateTimeFormatterField

* ConversionProvider
  might provide supporting fields directly

* Refactoring
  moved/renamed BuiltInFieldReference, BuiltInConstuctorFragment to
package model/common

* MappingBuilderContext provides access to mapper support fields
  (that are independent of mapper methods)

* MappingResolverImpl / MapperCreationProcessor
  process supporting fields provided by ConversionProvider

* HelperMethod
** extended to supply additional template parameters to
   be more flexible in freemarker templates
** extended to support mapper field reference / constructor fragment

* SupportingMappingMethod
** provide templateParameters to freemarker
** hashCode/equals base on name property instead of template name,
   as we use one specific template multiple times with different
   parameters generating multiple methods
** #getSafeField extracted to SupportingField

* SupportingField
** removed hashCode/equals based on template name,
   as we use one specific template multiple times with different
   parameters generating multiple methods
   (superclass equals/hashcode is fine for that)
** added support for template parameters to be more flexible when
  compiling templates

* Tests to verify DateTimeFormatter instance field creation
2021-05-16 13:22:56 +02:00
Lukas Lazar
cc1562c5ad #2132 Add unmappedTargetPolicy to @BeanMapping 2021-05-15 18:01:22 +02:00
Filip Hrisafov
4576103752 #2445 Improve error reporting when EnumTransformationStrategy throws an error during transformation 2021-05-15 13:04:15 +02:00