1369 Commits

Author SHA1 Message Date
Filip Hrisafov
1d223284c2 [maven-release-plugin] prepare release 1.4.0.Beta3 1.4.0.Beta3 2020-07-19 18:10:12 +02:00
Filip Hrisafov
0495cb7fa7 #2149 Do not allow using BeanMapping(ignoreByDefault = true) in combination with Mapping(target = ".")
This fixes an ArrayIndexOutOfBoundsException when they were used together
2020-07-19 16:19:52 +02:00
Filip Hrisafov
28017e2b0c Add test case for demonstrating how the ignoreByDefault can be overridden from the base configuration 2020-07-19 16:19:52 +02:00
Sjaak Derksen
36349c49e9
#2156 ambiguous mapping message: location and limit # candidates (#2162) 2020-07-19 15:40:30 +02:00
Filip Hrisafov
cb432fa61b
#2150 Change the rules for how a constructor for mapping is picked
New rules:

1. Constructor annotated with @Default (from any package) has highest precedence
2. If there is a single public constructor then it would be used to construct the object
3. If a parameterless constructor exists then it would be used to construct the object, and the other constructors will be ignored
2020-07-18 18:53:32 +02:00
Filip Hrisafov
6aa39ff428 #2142: Strip leading underscore when sanitizing identifier name 2020-07-18 11:35:25 +02:00
Sjaak Derksen
2a849dca12 #2145 fixing 2 step mapping methods (refactoring) (#2146) 2020-07-18 01:12:21 +02:00
Sjaak Derksen
74f281fa3e #2135 improved messages for not able to select qualified method (#2141)
* #2135 improved messages for not able to select qualified method
2020-07-18 01:12:15 +02:00
Sjaak Derksen
c0d88f86bf #2139 reproducer (#2140)
* #2139 reproducer

* #2139 solution

* #2139 license
2020-07-18 01:12:11 +02:00
Filip Hrisafov
2fede3583d [maven-release-plugin] prepare for next development iteration 2020-07-18 01:12:05 +02:00
Filip Hrisafov
fc4f65ddb6 [maven-release-plugin] prepare release 1.4.0.Beta2 1.4.0.Beta2 2020-07-05 23:11:41 +02:00
Sjaak Derksen
12ac348609
#2136 performance improvement 2 step mappings (#2138) 2020-07-04 22:06:30 +02:00
Sjaak Derksen
1ce282362c
#2101 inherited properties need to be analysed against redefined properties when inheriting mappings (#2103) 2020-07-04 21:50:20 +02:00
Sjaak Derksen
971abc48c7
#2122 fix for 2 step mapping and generics (#2129) 2020-07-04 18:49:33 +02:00
Sjaak Derksen
81a88bdb6c
#2133 @BeanMapping#resultType should not be applied to forged methods (#2134)
* #2133 reproducer

* #2133 solution
2020-07-04 18:20:09 +02:00
Filip Hrisafov
082704cc55 #2131 Add extra test case 2020-07-04 17:27:55 +02:00
SahinSarkar
13df6a21bc Fixed typo in documentation 2020-07-04 16:55:24 +02:00
Filip Hrisafov
92b4316abd #2117 Add extra test case 2020-06-21 23:47:02 +02:00
Filip Hrisafov
bdc58b9602 #2124 Add extra test case 2020-06-21 23:24:56 +02:00
Filip Hrisafov
ef3cbc1b36 #2121 Add extra test case 2020-06-21 23:19:23 +02:00
Sjaak Derksen
29b82e772c
#2111 extra tests (#2119) 2020-06-14 21:04:31 +02:00
Filip Hrisafov
da37d40152
#2109 Generate correct array assignment for constructor parameter mapping 2020-06-07 16:45:32 +02:00
Filip Hrisafov
d87d75a7a8 [maven-release-plugin] prepare for next development iteration 2020-06-01 13:42:32 +02:00
Filip Hrisafov
72ce5f3bd2 [maven-release-plugin] prepare release 1.4.0.Beta1 1.4.0.Beta1 2020-06-01 13:42:32 +02:00
Filip Hrisafov
fc5e1ffe6b Upgrade to latest 1.6.2 asciidoc and fix incorrect closing documentation tag 2020-05-30 15:34:54 +02:00
Filip Hrisafov
850a55cd5d #695 Check for direct assignment for iterable, stream or map types should be done on their type parameters instead of the types themselves 2020-05-30 14:27:15 +02:00
Filip Hrisafov
c23592a7fe
Add EnumNamingStrategy SPI (#2100)
Add a new EnumNamingStrategy SPI which can be used for customising the way enums are matched by name.
It is similar to the AccessorNamingStrategy such that it allows implementors to provide a custom way of defining a property.

Related to #796, #1220, #1789 and #1667
2020-05-25 21:31:29 +02:00
Filip Hrisafov
7b5a54971f
Add EnumTransformationStrategy SPI (#2089)
Add a new custom EnumTransformationStrategy SPI which can be used for providing custom way of name based mapping for enums.

Add 4 out of the box transformation strategies:

* prefix - add a prefix to the name based enum mapping
* stripPrefix - remove a prefix from the name based enum mapping
* suffix - add a suffix to the name based enum mapping
* stripSuffix - remove a suffix from the name based enum mapping

This can be achieved by using the new `EnumMapping`

e.g.

Add suffix `_TYPE` to all enums:

`@EnumMapping(nameTransformationStrategy = "suffix", configuration = "_TYPE")`

With this it would be possible to achieve what is needed in #796, #1220, #1789.
2020-05-18 07:17:30 +02:00
Filip Hrisafov
b5fe96c9da Add myself as developer 2020-05-17 18:46:33 +02:00
Filip Hrisafov
73a79cf009 #1857 Use flatten-maven-plugin to remove test dependencies from released pom
For some reason when using annotationProcessorPaths IntelliJ includes the provided and test scoped dependencies on the annotation processor paths.
With this change there would be no test dependencies that IntelliJ can add.
2020-05-17 18:45:05 +02:00
Gunnar Morling
f7c1182ae6
Updating my developer URL 2020-05-17 13:27:32 +02:00
Filip Hrisafov
42e0ec395b Add dedicated action for Java EA builds and update main CI to use only 11, 13 and 14 2020-05-17 12:17:36 +02:00
Filip Hrisafov
2b2299a730 #73 Add support for using constructor arguments when instantiating mapping targets
By default the constructor argument names are used to extract the target properties.
If a constructor is annotated with an annotation named `@ConstructorProperties` (from any package) then it would be used to extract the target properties.

If a mapping target has a parameterless empty constructor it would be used to instantiate the target.
When there are multiple constructors then an annotation named `@Default` (from any package) can be used to mark a constructor that should be used by default when instantiating the target.

Supports mapping into Java 14 Records and Kotlin data classes out of the box
2020-04-26 12:44:41 +02:00
Filip Hrisafov
d6ff5204d7 Accessor#getSimpleName should return a String 2020-04-26 12:44:41 +02:00
Sjaak Derksen
7c62aec281
#2077 nullpointer due to no-getter source (#2078) 2020-04-25 17:01:22 +02:00
Filip Hrisafov
3bffe96983 #1159: Do not fail loading AnnotationProcessorContext if loading AstModifyingAnnotationProcessor fails 2020-04-13 17:40:47 +02:00
Filip Hrisafov
c58f80cc5f #2069 Refactor target reference to report errors during bean mapping instead of creation of the target reference
With this we can more easily go in the direction of using constructor to map into target beans.
2020-04-13 13:20:09 +02:00
Filip Hrisafov
1bbc4e1ca8 Use expected.getMessageRegex when no message for the Diagnostic descriptor has been defined 2020-04-12 12:26:07 +02:00
Filip Hrisafov
6797afb647 Use exact message for Diagnostic test messages assertions 2020-04-12 09:55:44 +02:00
Filip Hrisafov
a845197b0b #2056: Handle null TypeMirror in uses and import gracefully
Due to a bug in javac (JDK-8229535) for an annotation with Class values, instead of returning a TypeMirror with TypeKind#ERROR the compiler returns the string "<error>". Eclipse doesn't have this problem currently.
2020-04-10 11:20:20 +02:00
Filip Hrisafov
c410379f83 #1553: Update tycho-compiler-jdt to latest 1.6.0 version
Disable one test in GenericsHierarchyTest for Eclipse on Java 8 due to a bug in the Tycho compiler.
Disable freeBuilder integration test for Eclipse since there are some problems in the second round of annotation processing (no ModelElementProcessor(s) are found)
2020-04-10 09:33:09 +02:00
Filip Hrisafov
853ff7f74f #2060: MapStruct should work properly on the module path 2020-04-05 16:37:51 +02:00
Filip Hrisafov
4f76208c62 #2021 Generate compilable code when Decorator is nested within the Mapper
We need to treat the import of the decoratorType specially when it is nested.
Calling addIfImportRequired is not the most correct approach since it would
lead to checking if the type is to be imported and that would be false
since the Decorator is a nested class within the Mapper.
However, when generating the Decorator this is not needed, because the Decorator is a top level class itself

In a nutshell creating the Decorator should have its own ProcessorContext, but it doesn't
2020-04-05 14:09:23 +02:00
Filip Hrisafov
b7d5e557c1 Checkstyle max line length should be 120 2020-04-05 09:29:00 +02:00
Pawel Radzinski
bbd68baf64
Update chapter-10-advanced-mapping-options.asciidoc (#2050)
Correct some typos and punctuation here and there.
2020-03-30 21:11:07 +02:00
Filip Hrisafov
f8a3924005 Use fix version for maven-processor-plugin
Using the latest (4.0-beta1) does not work on Java 8 since it is compiled with Java 9
2020-03-07 16:44:19 +01:00
Filip Hrisafov
63c2edd333 Reset locale and time zone in every test 2020-03-07 16:44:19 +01:00
Filip Hrisafov
551c104295 #2019 Setup GitHub Actions
Add Maven Wrapper for using in GitHub Actions
Remove Travis
2020-03-07 16:44:19 +01:00
Filip Hrisafov
fe91c6d523 Disable Checkstyle for Target for #2018 test 2020-02-23 19:06:46 +01:00
Filip Hrisafov
b9f86fe6ac #2018 Add test case with properties with underscore verifying that it is working as expected 2020-02-23 17:33:32 +01:00