Skip to content

[pull] main from mapstruct:main#2

Open
pull[bot] wants to merge 103 commits into
fml2:mainfrom
mapstruct:main
Open

[pull] main from mapstruct:main#2
pull[bot] wants to merge 103 commits into
fml2:mainfrom
mapstruct:main

Conversation

@pull

@pull pull Bot commented May 11, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

dependabot Bot and others added 2 commits May 11, 2025 15:57
Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.21.7 to 3.25.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](protocolbuffers/protobuf@v3.21.7...v3.25.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
@pull pull Bot added the ⤵️ pull label May 11, 2025
zyberzebra and others added 27 commits May 11, 2025 19:59
…egy for `@SubclassMapping`

---------

Signed-off-by: TangYang <tangyang9464@163.com>
…nested update mappings

Signed-off-by: TangYang <tangyang9464@163.com>
…ith inheritance

Add compiler option `mapstruct.disableLifecycleOverloadDeduplicateSelector` to disable the deduplication if needed.

Signed-off-by: TangYang <tangyang9464@163.com>
Signed-off-by: TangYang <tangyang9464@163.com>
…ollections / maps without setters

Signed-off-by: TangYang <tangyang9464@163.com>
Signed-off-by: TangYang <tangyang9464@163.com>
Signed-off-by: TangYang <tangyang9464@163.com>
Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 6.2.2 to 6.2.7.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.2.2...v6.2.7)

---
updated-dependencies:
- dependency-name: org.springframework:spring-context
  dependency-version: 6.2.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…lizes empty collection/map when target is null

Signed-off-by: TangYang <tangyang9464@163.com>
…entries (#3906)

Adds compiler warning / error when properties listed in `ignoreUnmappedSourceProperties` are actually mapped.
Respects `unmappedSourcePolicy` and includes tests for redundant and valid ignore cases.
hduelme and others added 30 commits March 16, 2026 00:44
* Revert "Block plexus.snapshots repository in GitHub actions #3972"

This reverts commit 9d75a48 and updates the maven compiler plugin to 3.15.0
Improves readability and avoids unnecessary overhead:
* Stores `typeArguments` in a local variable (since calling `getTypeArguments()` is not cached in eclipse compiler)
* Replace if/else with a ternary expression
* Avoids repeated `getType(...)` calls
Add CustomImportOrder module to checkstyle configuration enforcing:
1. java/javax imports (STANDARD_JAVA_PACKAGE)
2. Third-party imports (THIRD_PARTY_PACKAGE)
3. org.hibernate imports (SPECIAL_IMPORTS)
4. Static imports (STATIC)

With alphabetical sorting within groups and blank line separators
between groups, matching the existing IntelliJ formatter configuration.
- SECURITY.md: documents the vulnerability reporting process, supported
  versions, scope, reporter expectations (including 48-hour acknowledgement
  and explicit response for out-of-scope reports), and a link to the IRP
- .github/INCIDENT_RESPONSE.md: internal playbook covering security CVEs,
  critical regressions, supply-chain incidents, and CI incidents, with
  severity levels, a yanked-release procedure, secrets rotation index,
  and a communication channels map
Detect `@NonNull`, `@Nullable`, `@NullMarked` and `@NullUnmarked` from
org.jspecify.annotations to control null check generation in
mapping code.

Property-level null checks:
- Source `@NonNull`: skip null check (value guaranteed non-null)
- Target `@NonNull`: always add null check (must protect non-null target)
- All other cases: defer to existing `NullValueCheckStrategy`
- Safety guards (default values, unboxing, NVPMS) are preserved

Method-level source parameter:
- `@NonNull` parameter: skip the method-level null guard

`@NullMarked` / `@NullUnmarked` scope:
- In a `@NullMarked` class or package, unannotated types are effectively
  `@NonNull`
- `@NullUnmarked` reverts to unknown nullability within its scope
- `@Nullable` on a specific type overrides the scope
- Scope is resolved by walking the enclosing element chain
  (method -> class -> outer class -> package)

Constructor parameters:
- Report a compile error when mapping a potentially nullable source to
  a `@NonNull` constructor parameter without a `defaultValue`, since a null
  check would leave the variable at null violating the contract

Add option to opt out of JSpecify inference using a compiler option `mapstruct.disableJSpecify`
Fails with default of JDK 8 due to a maven plugin dependency having a post-Java 8 JAR version
Upgrade Lombok to 1.18.38 since older versions fail with
ExceptionInInitializerError on com.sun.tools.javac.code.TypeTag
when compiling under JDK 25/26.
…4045)

Adds a `NewInstanceCreation` ModelElement that renders `new T<>` and
contributes only the raw class to imports, so type parameters used solely
in the new-expression are no longer orphaned (Issue #955). Also fixes
#3994's follow-up wildcard cases where explicit type arguments produced
uncompilable Java.
Improve class loading for tests by replacing `LauncherDiscoveryListener` with `CompilerLauncherInterceptor` (introduced in junit-team/junit-framework#3091). This change reduces overhead during test discovery and execution and also enables proper lifecycle handling, including correct closing of `ClassLoader` instances.
Declared generics must match exactly (e.g. `Comparable<Number>` cannot match `Comparable<Long>`). Recursive resolution of mismatched generics can cause infinite loops.
…on for the diff (#4063)

The `FileInfo` from Open Test Alliance for the JVM allows the IDE
to display a diff between 2 files nicely in the UI.
This makes it easier to compare failing fixtures and immediately copy what you want to the fixture.
Also improve the loading of the expected fixture from the resource folder instead of the
compilation folder
…rn types (#4057)

Follow-up to #1243 closing the gaps reported in #4056:

* `@NonNull` source on collection-typed property mappings now skips the
  wrapping null guard around the collection construction (mirrors the
  existing non-collection rule in PropertyMapping).
* Container mapping methods (Iterable, Map, Stream, arrays) now honor
  JSpecify on their source parameter: ContainerMappingMethod and
  MapMappingMethod route the source-parameter presence check through the
  JSpecify-aware PresenceCheckMethodResolver (same helper BeanMappingMethod
  already uses), and the corresponding FTL templates wrap the early-return
  block in <#if sourceParameterPresenceCheck??>.
* `@NonNull` mapping-method return type now implies
  NullValueMappingStrategy.RETURN_DEFAULT semantics across bean, iterable,
  map and stream mapping methods, so generated code never violates a
  @nonnull return contract by emitting `return null`.

All new behaviour is gated on JSpecify annotations being present and is
fully suppressed by the existing `mapstruct.disableJSpecify` option.
…no-args constructor (#4061)

* #4060 Report compilation error for SET_TO_DEFAULT without accessible no-args constructor

When NullValuePropertyMappingStrategy.SET_TO_DEFAULT resets a null source
property, MapStruct generates new Target() to create the default instance.
For target types without an accessible parameterless constructor (e.g.
LocalDate, BigDecimal, Comparable) this produced uncompilable code such as
target.setLocalDate( new LocalDate() ). Detect this during annotation
processing and raise GENERAL_NO_SUITABLE_CONSTRUCTOR instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.