1479 Commits

Author SHA1 Message Date
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
João Paulo Bassinello
fdf3dcc8ef #2445 Support for case changing enum transformation strategy
Available case transformations: upper, lower, capital
2021-05-15 13:04:15 +02:00
dependabot[bot]
5c22eee6c3 Bump commons-io from 2.6 to 2.7 in /parent
Bumps commons-io from 2.6 to 2.7.

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 13:41:46 +02:00
jason.bodnar@blackbaud.com
0cb053df8d #2391 Add implicit conversion between UUID <-> String 2021-05-01 13:28:03 +02:00
Filip Hrisafov
627be53088 Migrate mapstruct core tests to JUnit Jupiter 2021-04-25 13:05:26 +02:00
Filip Hrisafov
2d66f08ee5 Migrate process tests to use new JUnit Jupiter Infrastructure
Update test annotations to be JUnit Jupiter compatible

Replace all Test annotations from tests that are run with the AnnotationProcessorTestRunner with ProcessorTest.
Replace JUnit 4 Test#expected with assertThatThrownBy from AssertJ.
Replace Rule for GeneratedSource with RegisterExtension.
Fix some tests that were not reverting the changes to the default Locale and TimeZone.
Replace usage of org.junit.Assert with equivalent from org.junit.jupiter.api.Assertions or AssertJ.
2021-04-25 13:05:26 +02:00
Filip Hrisafov
5bbd1a78ea Migrate the processor test infrastructure from JUnit 4 to JUnit Jupiter
With JUnit Jupiter it is still not possible to set the ClassLoader for loading the test class.
However, since 5.8 M1 there is a way to hook into the launcher discovery process and change the Current Thread ContextClassLoader which would load the classes with our customer ClassLoader.
Once JUnit Jupiter 201 is resolved we can simplify this.

The CompilationCache is stored in the GlobalCache with the CompilationRequest as key.
This means that even when methods are not executed in some particular order if they have same WithClasses then they would reuse the cache.
2021-04-25 13:05:26 +02:00
Filip Hrisafov
51cdbd67e3 #2051, #2084 Add new @Condition annotation for custom presence check methods 2021-04-25 12:09:23 +02:00
Filip Hrisafov
a2e1404b93 Refactor presence checks to object in order to simplify the conditional mapping 2021-04-25 12:09:23 +02:00
Filip Hrisafov
1c8fff1475 #2423 Use SetterWrapperForCollectionsAndMapsWithNullCheck if the source has a presence check method 2021-04-24 22:01:09 +02:00
Filip Hrisafov
903e6f3f44 #597 Add String <-> StringBuilder conversion in the documentation 2021-04-24 16:47:27 +02:00
Filip Hrisafov
2be536bb65 #2303 Generated code should use iteration order preserving LinkedHash(Map|Set) instead of Hash(Map|Set) 2021-04-24 14:19:01 +02:00
Filip Hrisafov
5f1b3d7862 #2402 Always add source parameter name when constructing the source references for target this 2021-04-23 07:58:24 +02:00
Filip Hrisafov
c9199b7068 #2393 Use includeModel when generating GeneratedType
With this we make sure that the implementation type will have a correct import in case of a clash with another mapper named the same
2021-04-16 08:41:53 +02:00
Silvère Marie
85d3b310f7 Fix method naming 2021-03-30 08:45:17 +02:00
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