1525 Commits

Author SHA1 Message Date
Filip Hrisafov
12070186a4 #2567 Add support for Jakarta Injection
Support for Jakarta is done in 2 ways:

* current jsr330 component model - In this case Jakarta Inject will be used if javax.inject is not available
* new jakarta component model - In this case Jakarta Inject will always be used
2022-01-30 13:31:50 +01:00
Filip Hrisafov
aed3ff5295 #1997 Use builders to construct empty objects in update wrapper 2022-01-30 12:38:42 +01:00
Filip Hrisafov
464adc9143 #2682 Change RetentionPolicy of @DecoratedWith to CLASS
In some circumstances (used with other types of aggregating processors, e.g. Spring)
the Gradle incremental compilation works correctly only for classes annotated with the `CLASS` or `RUNTIME`
retention policy.

The `@DecoratedWith` is the only annotation from MapStruct that was `SOURCE` retention.
With this commit we are changing its retention policy in order for better compatibility with the Gradle Incremental compilation
2022-01-29 17:03:03 +01:00
Filip Hrisafov
5f4d355838
#1661 Add support for globally disabling builders 2022-01-29 11:46:34 +01:00
Filip Hrisafov
aade31f095 #2468 Update needed dependencies for running CDI tests on Java 16+ 2022-01-29 11:25:40 +01:00
Filip Hrisafov
20ff51ebb8
#2728 Add new WithTestDependency annotation for our processor testing
Adding this dependency allows us to dynamically pick the dependencies that we want to have on the test compilation classpath.
It would allow us to more granularly test things with different dependencies, such as javax inject and jakarta inject
2022-01-29 11:13:16 +01:00
Filip Hrisafov
ec30f5d279
#2725 Update tools-gem to 1.0.0.Alpha3 and run GitHub Action with Java 19-ea
Also update Spring to 5.3.15 to be able to run on Java 19
2022-01-29 11:03:44 +01:00
Zegveld
9105041522
#2668: Added support for collections and maps with a no-args constructor (#2671)
#2668: Added support for collections and maps with a no-args constructor. Added a compiler error in case of a collection or map without either a no-arg constructor or a copy constructor.
2022-01-29 00:37:24 +01:00
Justyna
b22efd9ad7
#2674: Add check if method without implementation doesn’t have @AfterMapping / @BeforeMapping annotation 2022-01-24 14:17:24 +01:00
Goni-Dev
0a8e9b738c
#2709 Corrected description for example demonstrating default expression 2022-01-23 17:26:21 +01:00
dependabot[bot]
0f297ae60f Bump protobuf-java from 3.6.0 to 3.16.1 in /parent
Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.6.0 to 3.16.1.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.6.0...v3.16.1)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 13:24:54 +01:00
Ben Zegveld
277b6f5d2b #2719: added a note at the builder documentation to point towards the Before-/AfterMapping documentation. 2022-01-22 13:12:06 +01:00
Filip Hrisafov
59c5f40ac3
#2686 Add documentation about when mappers are injected 2022-01-18 18:22:47 +01:00
Filip Hrisafov
f7f65ac1de #2687 Add documentation for NullValueMappingStrategy for collections and maps 2022-01-15 10:34:37 +01:00
Valentin Kulesh
42cfa05c40
#2704 Fix broken reference to constants within nested enums 2021-12-26 11:22:05 +01:00
Ben Zegveld
0a7b8134d4 #2689: documentation: fix example title. 2021-12-25 11:50:48 +01:00
Filip Hrisafov
930b07aab8 [maven-release-plugin] prepare for next development iteration 2021-12-12 12:48:56 +01:00
Filip Hrisafov
0de10ca83c [maven-release-plugin] prepare release 1.5.0.Beta2 1.5.0.Beta2 2021-12-12 12:48:55 +01:00
Zegveld
ea45666d66
#2673: Fix optional wrapping pattern throwing exception when primitive types are present
MethodMatcher incorrectly reported that a primitive type matches a candidate for a type var
2021-12-11 14:16:19 +01:00
Filip Hrisafov
5de813c16f #2666 Presence Check should be applied to source parameters when used in @Mapping 2021-12-04 12:37:15 +01:00
Filip Hrisafov
00df0bc3d0
#2680 Refactor accessors
Split the `PresenceCheck`s accessor from the current `Accessor`.
Introduce a `ReadAccessor` that would allow us to more easily implement certain things.
Remove `MAP_GET` and `MAP_CONTAINS` from the AccessorType and use the new refactored mechanism
2021-12-03 19:13:41 +01:00
dersvenhesse
754aaf2ef4 [DOCS] Fixed reference variable 2021-12-03 19:10:25 +01:00
Filip Hrisafov
13bc0c023c
#2553 Support source property paths for maps 2021-11-20 08:48:08 +01:00
Filip Hrisafov
29008e12bf #2005 Parameter type should only be checked if we are mapping from a single argument source 2021-11-20 08:00:32 +01:00
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