Skip to content

Commit 0f4c4da

Browse files
committed
Remove deprecated code
Most notable, `WebServiceClient` no longer implements `Closeable`.
1 parent b4a2bb4 commit 0f4c4da

5 files changed

Lines changed: 104 additions & 181 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ CHANGELOG
55
------------------
66

77
* This library is now a Java module.
8+
* Removed deprecated `last4Digits` method on `CreditCard.Builder` and
9+
`getLast4Digits` method on `CreditCard`. Use `lastDigits` and
10+
`getLastDigits` instead.
11+
* Removed deprecated `connectTimeout(int)`, `readTimeout(int)`, and
12+
`proxy(Proxy)` on `WebServiceClient.Builder`. Use
13+
`connectTimeout(Duration)`, `requestTimeout(Duration)`, and
14+
`proxy(ProxySelector)` instead.
15+
* `WebServiceClient` no longer implements `Closeable` and the `Close`
16+
method has been removed. This method was deprecated when the library
17+
switched to using `java.net.http.HttpClient`.
818

919
2.2.0 (2022-10-31)
1020
------------------

src/main/java/com/maxmind/minfraud/WebServiceClient.java

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
import com.maxmind.minfraud.response.FactorsResponse;
1515
import com.maxmind.minfraud.response.InsightsResponse;
1616
import com.maxmind.minfraud.response.ScoreResponse;
17-
import java.io.Closeable;
1817
import java.io.IOException;
1918
import java.io.InputStream;
20-
import java.net.InetSocketAddress;
21-
import java.net.Proxy;
2219
import java.net.ProxySelector;
2320
import java.net.URI;
2421
import java.net.URISyntaxException;
@@ -37,7 +34,7 @@
3734
/**
3835
* Client for MaxMind minFraud Score, Insights, and Factors
3936
*/
40-
public final class WebServiceClient implements Closeable {
37+
public final class WebServiceClient {
4138
private static final String pathBase = "/minfraud/v2.0/";
4239
private static final String userAgent = "minFraud-API/"
4340
+ WebServiceClient.class.getPackage().getImplementationVersion()
@@ -118,17 +115,6 @@ public Builder(int accountId, String licenseKey) {
118115
this.licenseKey = licenseKey;
119116
}
120117

121-
/**
122-
* @param val Timeout in milliseconds to establish a connection to the
123-
* web service. There is no timeout by default.
124-
* @return Builder object
125-
* @deprecated Use connectTimeout(Duration) instead
126-
*/
127-
@Deprecated
128-
public WebServiceClient.Builder connectTimeout(int val) {
129-
return connectTimeout(Duration.ofMillis(val));
130-
}
131-
132118
/**
133119
* @param val Timeout duration to establish a connection to the web
134120
* service. There is no timeout by default.
@@ -181,17 +167,6 @@ public WebServiceClient.Builder locales(List<String> val) {
181167
return this;
182168
}
183169

184-
/**
185-
* @param val readTimeout in milliseconds to read data from an
186-
* established connection to the web service. There is no
187-
* timeout by default.
188-
* @return Builder object
189-
* @deprecated Use requestTimeout(Duration) instead
190-
*/
191-
@Deprecated
192-
public WebServiceClient.Builder readTimeout(int val) {
193-
return requestTimeout(Duration.ofMillis(val));
194-
}
195170

196171
/**
197172
* @param val Request timeout duration. here is no timeout by default.
@@ -202,18 +177,6 @@ public Builder requestTimeout(Duration val) {
202177
return this;
203178
}
204179

205-
/**
206-
* @param val the proxy to use when making this request.
207-
* @return Builder object
208-
* @deprecated Use proxy(ProxySelector)
209-
*/
210-
@Deprecated
211-
public Builder proxy(Proxy val) {
212-
if (val != null && val != Proxy.NO_PROXY) {
213-
proxy = ProxySelector.of((InetSocketAddress) val.address());
214-
}
215-
return this;
216-
}
217180

218181
/**
219182
* @param val the proxy to use when making this request.
@@ -507,14 +470,6 @@ private void exhaustBody(HttpResponse<InputStream> response) throws HttpExceptio
507470
}
508471
}
509472

510-
/**
511-
* @deprecated Closing is no longer necessary with java.net.http.HttpClient.
512-
*/
513-
@Override
514-
@Deprecated
515-
public void close() throws IOException {
516-
}
517-
518473
@Override
519474
public String toString() {
520475
return "WebServiceClient{"

src/main/java/com/maxmind/minfraud/request/CreditCard.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.maxmind.minfraud.request;
22

3-
import com.fasterxml.jackson.annotation.JsonIgnore;
43
import com.fasterxml.jackson.annotation.JsonProperty;
54
import com.maxmind.minfraud.AbstractModel;
65
import java.util.regex.Pattern;
@@ -73,18 +72,6 @@ public CreditCard.Builder issuerIdNumber(String number) {
7372
return this;
7473
}
7574

76-
/**
77-
* @param digits The last two or four digits of the credit card number.
78-
* @return The builder object.
79-
* @throws IllegalArgumentException when number is not a two or four digit
80-
* string.
81-
* @deprecated Use lastDigits instead.
82-
*/
83-
@Deprecated
84-
public CreditCard.Builder last4Digits(String digits) {
85-
return this.lastDigits(digits);
86-
}
87-
8875
/**
8976
* @param digits The last two or four digits of the credit card number.
9077
* @return The builder object.
@@ -226,16 +213,6 @@ public String getIssuerIdNumber() {
226213
return issuerIdNumber;
227214
}
228215

229-
/**
230-
* @return The last two or four digits of the credit card number.
231-
* @deprecated use {@code getLastDigits}
232-
*/
233-
@Deprecated
234-
@JsonIgnore
235-
public String getLast4Digits() {
236-
return this.getLastDigits();
237-
}
238-
239216
/**
240217
* @return The last two or four digits of the credit card number.
241218
*/

0 commit comments

Comments
 (0)