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 =
JsonSerializations.toUnblockableDomainsReport(
changes
.filter(UnblockableDomainChange::AddOrChange)
.filter(UnblockableDomainChange::isAddOrChange)
.map(UnblockableDomainChange::newValue));
if (report.isPresent()) {
gcsClient.logRemovedUnblockableDomainsReport(

View file

@ -52,12 +52,12 @@ public abstract class UnblockableDomainChange {
return UnblockableDomain.of(unblockable().domainName(), newReason().get());
}
public boolean AddOrChange() {
public boolean isAddOrChange() {
return newReason().isPresent();
}
public boolean isDelete() {
return !this.AddOrChange();
return !this.isAddOrChange();
}
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
* {@code tld} at the specified time.
*
* @throws DomainLabelBlockedByBsaException
*/
public static void verifyNotBlockedByBsa(String domainLabel, Tld tld, DateTime now)
throws DomainLabelBlockedByBsaException {

View file

@ -68,7 +68,7 @@ public final class UrlConnectionUtils {
/** Checks whether {@code bytes} are GZIP encoded. */
public static boolean isGZipped(byte[] bytes) {
// 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));
}

View file

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