Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

String to Number(e.g. Int) type conversions should marked as lossy type conversions #3848

Copy link
Copy link

Description

@SamilCan
Issue body actions

Use case

We have some mappings between different microservice models. In one example, some incremental ID fields are returned as a String from the source model, but the target model has an Integer field to map them. It has worked for a long time, but now String values are overflowing the Int max range, and we are getting NumberFormatException in mapStruct generated code like: Integer.parseInt(s).

I think we can utilize the existing NARROWING_LUT hierarchy to report this kind of lossy conversion.

WDYT?

Note: I used the same hierarchy number with BigDecimal because most of the time, both ways of these BigDecimal<->String conversions are not lossy.

Generated Code

No response

Possible workarounds

No response

MapStruct Version

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.