Add Optional types to fix Java 7 WHOIS build breakage

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145452302
This commit is contained in:
mcilwain 2017-01-24 12:27:34 -08:00 committed by Ben McIlwain
parent bb3a0c78c5
commit 124011a8ce
2 changed files with 2 additions and 2 deletions

View file

@ -37,7 +37,7 @@ public class DomainLookupCommand extends DomainOrHostLookupCommand {
protected Optional<WhoisResponse> getResponse(InternetDomainName domainName, DateTime now) { protected Optional<WhoisResponse> getResponse(InternetDomainName domainName, DateTime now) {
final DomainResource domainResource = final DomainResource domainResource =
loadByForeignKey(DomainResource.class, domainName.toString(), now); loadByForeignKey(DomainResource.class, domainName.toString(), now);
return Optional.fromNullable( return Optional.<WhoisResponse>fromNullable(
domainResource == null ? null : new DomainWhoisResponse(domainResource, now)); domainResource == null ? null : new DomainWhoisResponse(domainResource, now));
} }
} }

View file

@ -37,7 +37,7 @@ public class NameserverLookupByHostCommand extends DomainOrHostLookupCommand {
protected Optional<WhoisResponse> getResponse(InternetDomainName hostName, DateTime now) { protected Optional<WhoisResponse> getResponse(InternetDomainName hostName, DateTime now) {
final HostResource hostResource = final HostResource hostResource =
loadByForeignKey(HostResource.class, hostName.toString(), now); loadByForeignKey(HostResource.class, hostName.toString(), now);
return Optional.fromNullable( return Optional.<WhoisResponse>fromNullable(
hostResource == null ? null : new NameserverWhoisResponse(hostResource, now)); hostResource == null ? null : new NameserverWhoisResponse(hostResource, now));
} }
} }