Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ else if ( !method.isUpdateMethod() ) {
}

// get bean mapping (when specified as annotation )
this.missingIgnoredSourceProperties = new HashSet<>();
this.redundantIgnoredSourceProperties = new HashSet<>();
this.missingIgnoredSourceProperties = new LinkedHashSet<>();
this.redundantIgnoredSourceProperties = new LinkedHashSet<>();
if ( beanMapping != null && !beanMapping.getIgnoreUnmappedSourceProperties().isEmpty() ) {
// Get source properties explicitly mapped using @Mapping annotations
Set<String> mappedSourceProperties = method.getOptions().getMappings().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void addAllFieldsIn(Set<SupportingMappingMethod> supportingMapping
for ( SupportingMappingMethod supportingMappingMethod : supportingMappingMethods ) {
Field field = supportingMappingMethod.getSupportingField();
if ( field != null ) {
targets.add( supportingMappingMethod.getSupportingField() );
targets.add( field );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -97,12 +98,12 @@ public class MappingResolverImpl implements MappingResolver {
* Private methods which are not present in the original mapper interface and are added to map certain property
* types.
*/
private final Set<SupportingMappingMethod> usedSupportedMappings = new HashSet<>();
private final Set<SupportingMappingMethod> usedSupportedMappings = new LinkedHashSet<>();

/**
* Private fields which are added to map certain property types.
*/
private final Set<Field> usedSupportedFields = new HashSet<>();
private final Set<Field> usedSupportedFields = new LinkedHashSet<>();

public MappingResolverImpl(FormattingMessager messager, ElementUtils elementUtils, TypeUtils typeUtils,
TypeFactory typeFactory, List<Method> sourceModel,
Expand Down Expand Up @@ -199,7 +200,7 @@ private ResolvingAttempt(List<Method> sourceModel, Method mappingMethod, ForgedM
this.formattingParameters =
formattingParameters == null ? FormattingParameters.EMPTY : formattingParameters;
this.sourceRHS = sourceRHS;
this.supportingMethodCandidates = new HashSet<>();
this.supportingMethodCandidates = new LinkedHashSet<>();
this.selectionCriteria = criteria;
this.positionHint = positionHint;
this.forger = forger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,16 +509,16 @@ public Map<BigDecimal, BigDecimal> targetToSourceWithCustomLocale(Map<String, St
return map;
}

private DecimalFormat createDecimalFormatWithLocale( String numberFormat, Locale locale ) {
private DecimalFormat createDecimalFormat( String numberFormat ) {

DecimalFormat df = new DecimalFormat( numberFormat, DecimalFormatSymbols.getInstance( locale ) );
DecimalFormat df = new DecimalFormat( numberFormat );
df.setParseBigDecimal( true );
return df;
}

private DecimalFormat createDecimalFormat( String numberFormat ) {
private DecimalFormat createDecimalFormatWithLocale( String numberFormat, Locale locale ) {

DecimalFormat df = new DecimalFormat( numberFormat );
DecimalFormat df = new DecimalFormat( numberFormat, DecimalFormatSymbols.getInstance( locale ) );
df.setParseBigDecimal( true );
return df;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
)
public class OptionalSourceTargetMapperImpl implements OptionalSourceTargetMapper {

private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_z_01894582668 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm z" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_12071769242 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm" );
private final DateTimeFormatter dateTimeFormatter_HH_mm_168697690 = DateTimeFormatter.ofPattern( "HH:mm" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_11900521056 = DateTimeFormatter.ofPattern( "dd.MM.yyyy" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_z_01894582668 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm z" );
private final DateTimeFormatter dateTimeFormatter_HH_mm_168697690 = DateTimeFormatter.ofPattern( "HH:mm" );

@Override
public Target sourceToTarget(OptionalSource source) {
Expand Down Expand Up @@ -681,14 +681,6 @@ public OptionalSource targetToSourceDefaultMapping(Target target) {
return optionalSource;
}

private ZonedDateTime calendarToZonedDateTime(Calendar cal) {
if ( cal == null ) {
return null;
}

return ZonedDateTime.ofInstant( cal.toInstant(), cal.getTimeZone().toZoneId() );
}

private Calendar zonedDateTimeToCalendar(ZonedDateTime dateTime) {
if ( dateTime == null ) {
return null;
Expand All @@ -698,4 +690,12 @@ private Calendar zonedDateTimeToCalendar(ZonedDateTime dateTime) {
instance.setTimeInMillis( dateTime.toInstant().toEpochMilli() );
return instance;
}

private ZonedDateTime calendarToZonedDateTime(Calendar cal) {
if ( cal == null ) {
return null;
}

return ZonedDateTime.ofInstant( cal.toInstant(), cal.getTimeZone().toZoneId() );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
)
public class SourceTargetMapperImpl implements SourceTargetMapper {

private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_z_01894582668 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm z" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_12071769242 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm" );
private final DateTimeFormatter dateTimeFormatter_HH_mm_168697690 = DateTimeFormatter.ofPattern( "HH:mm" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_11900521056 = DateTimeFormatter.ofPattern( "dd.MM.yyyy" );
private final DateTimeFormatter dateTimeFormatter_dd_MM_yyyy_HH_mm_z_01894582668 = DateTimeFormatter.ofPattern( "dd.MM.yyyy HH:mm z" );
private final DateTimeFormatter dateTimeFormatter_HH_mm_168697690 = DateTimeFormatter.ofPattern( "HH:mm" );

@Override
public Target sourceToTarget(Source source) {
Expand Down Expand Up @@ -656,14 +656,6 @@ public Source targetToSourceDefaultMapping(Target target) {
return source;
}

private ZonedDateTime calendarToZonedDateTime(Calendar cal) {
if ( cal == null ) {
return null;
}

return ZonedDateTime.ofInstant( cal.toInstant(), cal.getTimeZone().toZoneId() );
}

private Calendar zonedDateTimeToCalendar(ZonedDateTime dateTime) {
if ( dateTime == null ) {
return null;
Expand All @@ -673,4 +665,12 @@ private Calendar zonedDateTimeToCalendar(ZonedDateTime dateTime) {
instance.setTimeInMillis( dateTime.toInstant().toEpochMilli() );
return instance;
}

private ZonedDateTime calendarToZonedDateTime(Calendar cal) {
if ( cal == null ) {
return null;
}

return ZonedDateTime.ofInstant( cal.toInstant(), cal.getTimeZone().toZoneId() );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -509,16 +509,16 @@ public Map<BigDecimal, BigDecimal> targetToSourceWithCustomLocale(Map<String, St
return map;
}

private DecimalFormat createDecimalFormatWithLocale( String numberFormat, Locale locale ) {
private DecimalFormat createDecimalFormat( String numberFormat ) {

DecimalFormat df = new DecimalFormat( numberFormat, DecimalFormatSymbols.getInstance( locale ) );
DecimalFormat df = new DecimalFormat( numberFormat );
df.setParseBigDecimal( true );
return df;
}

private DecimalFormat createDecimalFormat( String numberFormat ) {
private DecimalFormat createDecimalFormatWithLocale( String numberFormat, Locale locale ) {

DecimalFormat df = new DecimalFormat( numberFormat );
DecimalFormat df = new DecimalFormat( numberFormat, DecimalFormatSymbols.getInstance( locale ) );
df.setParseBigDecimal( true );
return df;
}
Expand Down