Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

0.5.0 (2016-XX-XX)
------------------

* This API now throws an `IllegalArgumentException` when `null` values are
passed to constructors or methods that require non-null values.

0.4.0 (2016-05-23)
------------------

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/maxmind/minfraud/WebServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ public WebServiceClient.Builder port(int val) {
* @return Builder object
*/
public WebServiceClient.Builder locales(List<String> val) {
if (locales == null) {
throw new IllegalArgumentException("locales must not be null");
}
locales = new ArrayList<>(val);
return this;
}
Expand Down Expand Up @@ -245,6 +248,9 @@ public ScoreResponse score(Transaction transaction) throws IOException,

private <T> T responseFor(String service, Transaction transaction, Class<T> cls)
throws IOException, MinFraudException {
if (transaction == null) {
throw new IllegalArgumentException("transaction must not be null");
}
URL url = createUrl(WebServiceClient.pathBase + service);
HttpPost request = requestFor(transaction, url);

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/maxmind/minfraud/request/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public static final class Builder {
* by the customer in the transaction.
*/
public Builder(InetAddress ipAddress) {
if (ipAddress == null) {
throw new IllegalArgumentException("ipAddress must not be null");
}

this.ipAddress = ipAddress;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/maxmind/minfraud/request/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static class Builder {
* @param device The {@code Device} model for the request
*/
public Builder(Device device) {
if (device == null) {
throw new IllegalArgumentException("device must not be null");
}
this.device = device;
}

Expand Down