Skip to content

Commit 370fd00

Browse files
committed
Deprecate metro code
1 parent fa53639 commit 370fd00

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.3.0
5+
------------------
6+
7+
* `getMetroCode` in the `Location` model has been deprecated. The code
8+
values are no longer being maintained.
9+
410
4.2.1 (2024-09-20)
511
------------------
612

src/main/java/com/maxmind/geoip2/record/Location.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ public Integer getAccuracyRadius() {
119119
}
120120

121121
/**
122-
* @return The metro code of the location if the location is in the US.
123-
* MaxMind returns the same metro codes as the <a href=
124-
* "https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions"
125-
* >Google AdWords API</a>.
122+
* @return The metro code is a no-longer-maintained code for targeting
123+
* advertisements in Google.
124+
* @deprecated Code values are no longer maintaned.
126125
*/
127126
@JsonProperty("metro_code")
127+
@Deprecated
128128
public Integer getMetroCode() {
129129
return this.metroCode;
130130
}

src/test/java/com/maxmind/geoip2/WebServiceClientTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public void test200WithInvalidJson() throws Exception {
6767
assertEquals("Received a 200 response but could not decode it as JSON", ex.getMessage());
6868
}
6969

70+
@SuppressWarnings("deprecation")
7071
@Test
7172
public void test200WithDefaultValues() throws Exception {
7273
WebServiceClient client = createSuccessClient("insights", "1.2.3.13",

src/test/java/com/maxmind/geoip2/model/InsightsResponseTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public void leastSpecificSubdivision() {
105105
);
106106
}
107107

108+
@SuppressWarnings("deprecation")
108109
@Test
109110
public void testTraits() {
110111
Traits traits = this.insights.getTraits();
@@ -172,6 +173,7 @@ public void testTraits() {
172173
);
173174
}
174175

176+
@SuppressWarnings("deprecation")
175177
@Test
176178
public void testLocation() {
177179

0 commit comments

Comments
 (0)