Fix 'unnecessary use of fully qualified name'

This commit is contained in:
ghubstan 2022-03-07 21:02:13 -03:00
parent 1ba2b6ca18
commit 4c2649b118
No known key found for this signature in database
GPG Key ID: E35592D6800A861E

View File

@ -125,8 +125,10 @@ class GrpcOffersService extends OffersImplBase {
try { try {
String offerId = req.getId(); String offerId = req.getId();
Optional<OpenOffer> myOpenOffer = coreApi.findMyOpenOffer(offerId); Optional<OpenOffer> myOpenOffer = coreApi.findMyOpenOffer(offerId);
Offer offer = myOpenOffer.map(OpenOffer::getOffer).orElseGet(() -> coreApi.getOffer(offerId)); Offer offer = myOpenOffer.map(OpenOffer::getOffer)
OfferInfo offerInfo = myOpenOffer.map(OfferInfo::toMyOfferInfo).orElseGet(() -> OfferInfo.toOfferInfo(offer)); .orElseGet(() -> coreApi.getOffer(offerId));
OfferInfo offerInfo = myOpenOffer.map(OfferInfo::toMyOfferInfo)
.orElseGet(() -> toOfferInfo(offer));
var reply = GetOfferReply.newBuilder() var reply = GetOfferReply.newBuilder()
.setOffer(offerInfo.toProtoMessage()) .setOffer(offerInfo.toProtoMessage())
.build(); .build();