Generation in 1.4.0

42 views
Skip to first unread message

Alexey Zverev

unread,
Aug 4, 2020, 4:11:12 PM8/4/20
to mapstruct-users
Hello everyone!
I tried to generate a method.
Description in an interface:

PrefillRq toRq(String param, String value)

After generation:

public PrefillRq toRq(String param, String value) {
if ( param == null && value == null ) {
return null;
}

String
param1 = null;
if ( param != null ) {
param1 = param;
}
String value1 = null;
if ( value != null ) {
value1 = value;
}

String param1 = null;
String value1 = null;

PrefillRq prefillRq = new PrefillRq( param1, value1 );

return prefillRq;
}

I am seeing a double declaration of variables. Why?

Filip Hrisafov

unread,
Aug 30, 2020, 5:49:01 PM8/30/20
to mapstruct-users
Hey Alex,

Which version is this? Can you please try with 1.4.0.CR1? We did some fixes around this area there. If it is still not working correctly can you please create an issue in our issue tracker.

Cheers,
Filip

Reply all
Reply to author
Forward
0 new messages