From 67da55536fca31e503b1b074036dfeb1577c7149 Mon Sep 17 00:00:00 2001 From: ctingue Date: Fri, 14 Oct 2016 07:56:22 -0700 Subject: [PATCH] Clean up misc Javadoc and deprecation warnings ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136156922 --- .../registry/monitoring/metrics/MetricMetrics.java | 1 + java/google/registry/rde/RdeImportUtils.java | 3 +-- .../registry/testing/AbstractEppResourceSubject.java | 10 +++++----- .../registry/testing/DomainApplicationSubject.java | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/google/registry/monitoring/metrics/MetricMetrics.java b/java/google/registry/monitoring/metrics/MetricMetrics.java index c70cddda2..6b635f176 100644 --- a/java/google/registry/monitoring/metrics/MetricMetrics.java +++ b/java/google/registry/monitoring/metrics/MetricMetrics.java @@ -49,6 +49,7 @@ final class MetricMetrics { LABELS); /** A gauge representing a snapshot of the number of active timeseries being reported. */ + @SuppressWarnings("unused") private static final Metric timeseriesCount = MetricRegistryImpl.getDefault() .newGauge( diff --git a/java/google/registry/rde/RdeImportUtils.java b/java/google/registry/rde/RdeImportUtils.java index 5334f1240..0e4a17e65 100644 --- a/java/google/registry/rde/RdeImportUtils.java +++ b/java/google/registry/rde/RdeImportUtils.java @@ -135,8 +135,7 @@ public class RdeImportUtils { // TODO (wolfgang): Add validation method for IDN tables try (InputStream input = gcsUtils.openInputStream(new GcsFilename(escrowBucketName, escrowFilePath))) { - try { - RdeParser parser = new RdeParser(input); + try (RdeParser parser = new RdeParser(input)) { // validate that tld exists and is in PREDELEGATION state String tld = parser.getHeader().getTld(); try { diff --git a/javatests/google/registry/testing/AbstractEppResourceSubject.java b/javatests/google/registry/testing/AbstractEppResourceSubject.java index d22dde79d..42b77fe91 100644 --- a/javatests/google/registry/testing/AbstractEppResourceSubject.java +++ b/javatests/google/registry/testing/AbstractEppResourceSubject.java @@ -106,7 +106,7 @@ abstract class AbstractEppResourceSubject public HistoryEntrySubject hasOnlyOneHistoryEntryWhich() { hasOnlyOneHistoryEntry(); return assertAboutHistoryEntries().that(getHistoryEntries().get(0)).withCustomDisplaySubject( - "the only history entry for " + getDisplaySubject()); + "the only history entry for " + actualAsString()); } public Which hasHistoryEntryAtIndex(int index) { @@ -117,12 +117,12 @@ abstract class AbstractEppResourceSubject } return new Which<>(assertAboutHistoryEntries() .that(getHistoryEntries().get(index)).withCustomDisplaySubject(String.format( - "the history entry for %s at index %s", getDisplaySubject(), index))); + "the history entry for %s at index %s", actualAsString(), index))); } public And hasStatusValue(StatusValue statusValue) { if (!actual().getStatusValues().contains(statusValue)) { - failWithRawMessage("%s should have had status value %s", getDisplaySubject(), statusValue); + failWithRawMessage("%s should have had status value %s", actualAsString(), statusValue); } return andChainer(); } @@ -130,7 +130,7 @@ abstract class AbstractEppResourceSubject public And doesNotHaveStatusValue(StatusValue statusValue) { if (actual().getStatusValues().contains(statusValue)) { failWithRawMessage( - "%s should not have had status value %s", getDisplaySubject(), statusValue); + "%s should not have had status value %s", actualAsString(), statusValue); } return andChainer(); } @@ -138,7 +138,7 @@ abstract class AbstractEppResourceSubject public And hasExactlyStatusValues(StatusValue... statusValues) { if (!ImmutableSet.copyOf(actual().getStatusValues()) .equals(ImmutableSet.copyOf(statusValues))) { - assertThat(actual().getStatusValues()).named("status values for " + getDisplaySubject()) + assertThat(actual().getStatusValues()).named("status values for " + actualAsString()) .containsExactly((Object[]) statusValues); } return andChainer(); diff --git a/javatests/google/registry/testing/DomainApplicationSubject.java b/javatests/google/registry/testing/DomainApplicationSubject.java index 8151a3702..2664595f0 100644 --- a/javatests/google/registry/testing/DomainApplicationSubject.java +++ b/javatests/google/registry/testing/DomainApplicationSubject.java @@ -54,7 +54,7 @@ public final class DomainApplicationSubject ImmutableSet.copyOf(actual().getEncodedSignedMarks()), ImmutableSet.of(encodedSignedMarks))) { assertThat(actual().getEncodedSignedMarks()) - .named("the encoded signed marks of " + getDisplaySubject()) + .named("the encoded signed marks of " + actualAsString()) .containsExactly((Object[]) encodedSignedMarks); } return andChainer();