-
-
Notifications
You must be signed in to change notification settings - Fork 1k
#3113 Add java LinkedHashSet, LinkedHashSet new factory methods for java >= 19 #3593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
filiphr
merged 15 commits into
mapstruct:main
from
Obolrom:3113_hashmap_hashset_factory_method
Sep 2, 2024
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
87f61e6
#3113 Add java HashSet, HashMap, LinkedHashSet, LinkedHashSet new fac…
Obolrom 9e71988
#3113 Add version information injection
Obolrom 4d26b1c
#3113 Fixed version information injection
Obolrom f1e9a11
#3113 Refactored hardcoded factory method usage
Obolrom b748e0a
#3113 Fixed code style
Obolrom b047d49
#3113 Extract method name to constant
Obolrom bd307f4
#3113 Revert java LTS version CI test config
Obolrom 1b8cd09
Polish
filiphr 58591f1
WIP version based fixtures
filiphr 1e929b7
#3113 Fix tests for java version 21
Obolrom dc06485
#3113 Fix eclipse fixtures test
Obolrom 064a3e9
#3113 Fix generated code license
Obolrom 832f287
Restart CI
Obolrom bf29109
Fix fixture for java 21
Obolrom e34abec
Polish
filiphr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
.../src/test/resources/fixtures/21/org/mapstruct/ap/test/bugs/_1453/Issue1453MapperImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| /* | ||
| * Copyright MapStruct Authors. | ||
| * | ||
| * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
| */ | ||
| package org.mapstruct.ap.test.bugs._1453; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.LinkedHashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import javax.annotation.processing.Generated; | ||
|
|
||
| @Generated( | ||
| value = "org.mapstruct.ap.MappingProcessor", | ||
| date = "2024-06-18T14:48:39+0200", | ||
| comments = "version: , compiler: javac, environment: Java 21.0.2 (Eclipse Adoptium)" | ||
| ) | ||
| public class Issue1453MapperImpl implements Issue1453Mapper { | ||
|
|
||
| @Override | ||
| public AuctionDto map(Auction auction) { | ||
| if ( auction == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| AuctionDto auctionDto = new AuctionDto(); | ||
|
|
||
| auctionDto.setPayments( paymentListToPaymentDtoList( auction.getPayments() ) ); | ||
| auctionDto.setOtherPayments( paymentListToPaymentDtoList( auction.getOtherPayments() ) ); | ||
| auctionDto.setMapPayments( paymentPaymentMapToPaymentDtoPaymentDtoMap( auction.getMapPayments() ) ); | ||
| auctionDto.setMapSuperPayments( paymentPaymentMapToPaymentDtoPaymentDtoMap( auction.getMapSuperPayments() ) ); | ||
|
|
||
| return auctionDto; | ||
| } | ||
|
|
||
| @Override | ||
| public List<AuctionDto> mapExtend(List<? extends Auction> auctions) { | ||
| if ( auctions == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| List<AuctionDto> list = new ArrayList<AuctionDto>( auctions.size() ); | ||
| for ( Auction auction : auctions ) { | ||
| list.add( map( auction ) ); | ||
| } | ||
|
|
||
| return list; | ||
| } | ||
|
|
||
| @Override | ||
| public List<? super AuctionDto> mapSuper(List<Auction> auctions) { | ||
| if ( auctions == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| List<? super AuctionDto> list = new ArrayList<AuctionDto>( auctions.size() ); | ||
| for ( Auction auction : auctions ) { | ||
| list.add( map( auction ) ); | ||
| } | ||
|
|
||
| return list; | ||
| } | ||
|
|
||
| @Override | ||
| public Map<AuctionDto, AuctionDto> mapExtend(Map<? extends Auction, ? extends Auction> auctions) { | ||
| if ( auctions == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| Map<AuctionDto, AuctionDto> map = LinkedHashMap.newLinkedHashMap( auctions.size() ); | ||
|
|
||
| for ( java.util.Map.Entry<? extends Auction, ? extends Auction> entry : auctions.entrySet() ) { | ||
| AuctionDto key = map( entry.getKey() ); | ||
| AuctionDto value = map( entry.getValue() ); | ||
| map.put( key, value ); | ||
| } | ||
|
|
||
| return map; | ||
| } | ||
|
|
||
| @Override | ||
| public Map<? super AuctionDto, ? super AuctionDto> mapSuper(Map<Auction, Auction> auctions) { | ||
| if ( auctions == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| Map<? super AuctionDto, ? super AuctionDto> map = LinkedHashMap.newLinkedHashMap( auctions.size() ); | ||
|
|
||
| for ( java.util.Map.Entry<Auction, Auction> entry : auctions.entrySet() ) { | ||
| AuctionDto key = map( entry.getKey() ); | ||
| AuctionDto value = map( entry.getValue() ); | ||
| map.put( key, value ); | ||
| } | ||
|
|
||
| return map; | ||
| } | ||
|
|
||
| protected PaymentDto paymentToPaymentDto(Payment payment) { | ||
| if ( payment == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| PaymentDto paymentDto = new PaymentDto(); | ||
|
|
||
| paymentDto.setPrice( payment.getPrice() ); | ||
|
|
||
| return paymentDto; | ||
| } | ||
|
|
||
| protected List<PaymentDto> paymentListToPaymentDtoList(List<Payment> list) { | ||
| if ( list == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| List<PaymentDto> list1 = new ArrayList<PaymentDto>( list.size() ); | ||
| for ( Payment payment : list ) { | ||
| list1.add( paymentToPaymentDto( payment ) ); | ||
| } | ||
|
|
||
| return list1; | ||
| } | ||
|
|
||
| protected Map<PaymentDto, PaymentDto> paymentPaymentMapToPaymentDtoPaymentDtoMap(Map<Payment, Payment> map) { | ||
| if ( map == null ) { | ||
| return null; | ||
| } | ||
|
|
||
| Map<PaymentDto, PaymentDto> map1 = LinkedHashMap.newLinkedHashMap( map.size() ); | ||
|
|
||
| for ( java.util.Map.Entry<Payment, Payment> entry : map.entrySet() ) { | ||
| PaymentDto key = paymentToPaymentDto( entry.getKey() ); | ||
| PaymentDto value = paymentToPaymentDto( entry.getValue() ); | ||
| map1.put( key, value ); | ||
| } | ||
|
|
||
| return map1; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.