mirror of
https://github.com/google/nomulus.git
synced 2025-05-30 01:10:14 +02:00
Upgrade the version of google/errorprone plug-in
This CL upgraded google/errorprone plug-in to 2.3.3 and resolved some warnings detected from the plug-in. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=238047862
This commit is contained in:
parent
50e0a9b532
commit
bc3bdc7347
22 changed files with 119 additions and 105 deletions
|
@ -16,7 +16,6 @@ package google.registry.beam;
|
|||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.common.io.Resources;
|
||||
import google.registry.util.ResourceUtils;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
|
@ -25,8 +24,6 @@ import org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord;
|
|||
/** Static utilities for {@code Beam} pipelines. */
|
||||
public class BeamUtils {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
/** Extracts a string representation of a field in a {@link GenericRecord}. */
|
||||
public static String extractField(GenericRecord record, String fieldName) {
|
||||
return String.valueOf(record.get(fieldName));
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.google.auto.value.AutoValue;
|
|||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.reporting.billing.BillingModule;
|
||||
import java.io.IOException;
|
||||
|
@ -51,8 +50,6 @@ import org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord;
|
|||
@AutoValue
|
||||
public abstract class BillingEvent implements Serializable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER =
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss zzz");
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import static google.registry.beam.BeamUtils.extractField;
|
|||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import java.io.Serializable;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord;
|
||||
|
@ -36,8 +35,6 @@ import org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord;
|
|||
@AutoValue
|
||||
public abstract class Subdomain implements Serializable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private static final ImmutableList<String> FIELD_NAMES =
|
||||
ImmutableList.of("fullyQualifiedDomainName", "registrarName", "registrarEmailAddress");
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ public final class BigqueryJobFailureException extends RuntimeException {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public String getMessage() {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append(String.format("%s: %s", getClass().getSimpleName(), getMessage()));
|
||||
result.append(String.format("%s: %s", getClass().getSimpleName(), super.getMessage()));
|
||||
try {
|
||||
if (jobStatus != null) {
|
||||
for (ErrorProto error : jobStatus.getErrors()) {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
package google.registry.flows;
|
||||
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.Action.Method;
|
||||
import google.registry.request.Payload;
|
||||
|
@ -33,8 +32,6 @@ import javax.servlet.http.HttpSession;
|
|||
auth = Auth.AUTH_PUBLIC_OR_INTERNAL)
|
||||
public class EppTlsAction implements Runnable {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Inject @Payload byte[] inputXmlBytes;
|
||||
@Inject TlsCredentials tlsCredentials;
|
||||
@Inject HttpSession session;
|
||||
|
|
|
@ -36,6 +36,7 @@ import google.registry.model.BackupGroupRoot;
|
|||
@Entity
|
||||
public class EntityGroupRoot extends BackupGroupRoot {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import google.registry.model.annotations.VirtualEntity;
|
|||
@VirtualEntity
|
||||
public class EppResourceIndexBucket extends ImmutableObject {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Id
|
||||
private long bucketId;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package google.registry.rdap;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.rdap.RdapSearchResults.IncompletenessWarningType;
|
||||
import java.util.List;
|
||||
|
@ -31,11 +32,11 @@ abstract class RdapResultSet<T extends EppResource> {
|
|||
IncompletenessWarningType incompletenessWarningType,
|
||||
int numResourcesRetrieved) {
|
||||
return new AutoValue_RdapResultSet<>(
|
||||
resources, incompletenessWarningType, numResourcesRetrieved);
|
||||
ImmutableList.copyOf(resources), incompletenessWarningType, numResourcesRetrieved);
|
||||
}
|
||||
|
||||
/** List of EPP resources. */
|
||||
abstract List<T> resources();
|
||||
abstract ImmutableList<T> resources();
|
||||
|
||||
/** Type of warning to display regarding possible incomplete data. */
|
||||
abstract IncompletenessWarningType incompletenessWarningType();
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package google.registry.reporting.spec11;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.beam.spec11.ThreatMatch;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -24,10 +25,11 @@ public abstract class RegistrarThreatMatches {
|
|||
|
||||
public abstract String registrarEmailAddress();
|
||||
|
||||
public abstract List<ThreatMatch> threatMatches();
|
||||
public abstract ImmutableList<ThreatMatch> threatMatches();
|
||||
|
||||
static RegistrarThreatMatches create(
|
||||
String registrarEmailAddress, List<ThreatMatch> threatMatches) {
|
||||
return new AutoValue_RegistrarThreatMatches(registrarEmailAddress, threatMatches);
|
||||
return new AutoValue_RegistrarThreatMatches(
|
||||
registrarEmailAddress, ImmutableList.copyOf(threatMatches));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,14 +38,17 @@ public class UrlFetchException extends RuntimeException {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder res = new StringBuilder(2048 + rsp.getContent().length).append(String.format(
|
||||
"%s: %s (HTTP Status %d)\nX-Fetch-URL: %s\nX-Final-URL: %s\n",
|
||||
getClass().getSimpleName(),
|
||||
getMessage(),
|
||||
rsp.getResponseCode(),
|
||||
req.getURL().toString(),
|
||||
rsp.getFinalUrl()));
|
||||
public String getMessage() {
|
||||
StringBuilder res =
|
||||
new StringBuilder(2048 + rsp.getContent().length)
|
||||
.append(
|
||||
String.format(
|
||||
"%s: %s (HTTP Status %d)\nX-Fetch-URL: %s\nX-Final-URL: %s\n",
|
||||
getClass().getSimpleName(),
|
||||
super.getMessage(),
|
||||
rsp.getResponseCode(),
|
||||
req.getURL().toString(),
|
||||
rsp.getFinalUrl()));
|
||||
for (HTTPHeader header : rsp.getHeadersUncombined()) {
|
||||
res.append(header.getName());
|
||||
res.append(": ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue