Fix build warnings (#2274)

All of these were causing warnings to appear during a build of the codebase.
This commit is contained in:
Ben McIlwain 2024-01-09 13:15:54 -05:00 committed by GitHub
parent cfdf12aa7d
commit e56e751652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 8 deletions

View file

@ -153,7 +153,7 @@ public class BsaRefreshAction implements Runnable {
Optional<String> report = Optional<String> report =
JsonSerializations.toUnblockableDomainsReport( JsonSerializations.toUnblockableDomainsReport(
changes changes
.filter(UnblockableDomainChange::AddOrChange) .filter(UnblockableDomainChange::isAddOrChange)
.map(UnblockableDomainChange::newValue)); .map(UnblockableDomainChange::newValue));
if (report.isPresent()) { if (report.isPresent()) {
gcsClient.logRemovedUnblockableDomainsReport( gcsClient.logRemovedUnblockableDomainsReport(

View file

@ -52,12 +52,12 @@ public abstract class UnblockableDomainChange {
return UnblockableDomain.of(unblockable().domainName(), newReason().get()); return UnblockableDomain.of(unblockable().domainName(), newReason().get());
} }
public boolean AddOrChange() { public boolean isAddOrChange() {
return newReason().isPresent(); return newReason().isPresent();
} }
public boolean isDelete() { public boolean isDelete() {
return !this.AddOrChange(); return !this.isAddOrChange();
} }
public boolean isNew() { public boolean isNew() {

View file

@ -264,8 +264,6 @@ public class DomainFlowUtils {
/** /**
* Verifies that the {@code domainLabel} is not blocked by any BSA block label for the given * Verifies that the {@code domainLabel} is not blocked by any BSA block label for the given
* {@code tld} at the specified time. * {@code tld} at the specified time.
*
* @throws DomainLabelBlockedByBsaException
*/ */
public static void verifyNotBlockedByBsa(String domainLabel, Tld tld, DateTime now) public static void verifyNotBlockedByBsa(String domainLabel, Tld tld, DateTime now)
throws DomainLabelBlockedByBsaException { throws DomainLabelBlockedByBsaException {

View file

@ -68,7 +68,7 @@ public final class UrlConnectionUtils {
/** Checks whether {@code bytes} are GZIP encoded. */ /** Checks whether {@code bytes} are GZIP encoded. */
public static boolean isGZipped(byte[] bytes) { public static boolean isGZipped(byte[] bytes) {
// See GzipOutputStream.writeHeader() // See GzipOutputStream.writeHeader()
return (bytes.length > 2 && bytes[0] == (byte) (GZIPInputStream.GZIP_MAGIC)) return (bytes.length > 2 && bytes[0] == (byte) GZIPInputStream.GZIP_MAGIC)
&& (bytes[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8)); && (bytes[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8));
} }

View file

@ -120,7 +120,7 @@ class TldsTest {
Tld.get("foo") Tld.get("foo")
.asBuilder() .asBuilder()
.setTldType(TldType.TEST) .setTldType(TldType.TEST)
.setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc().minus(1))) .setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc().minusMillis(1)))
.build()); .build());
assertThat(hasActiveBsaEnrollment(fakeClock.nowUtc())).isFalse(); assertThat(hasActiveBsaEnrollment(fakeClock.nowUtc())).isFalse();
} }
@ -131,7 +131,7 @@ class TldsTest {
persistResource( persistResource(
Tld.get("foo") Tld.get("foo")
.asBuilder() .asBuilder()
.setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc().minus(1))) .setBsaEnrollStartTime(Optional.of(fakeClock.nowUtc().minusMillis(1)))
.build()); .build());
assertThat(hasActiveBsaEnrollment(fakeClock.nowUtc())).isTrue(); assertThat(hasActiveBsaEnrollment(fakeClock.nowUtc())).isTrue();
} }