Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context: check required constructor parameters aren't null #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions src/com/oanda/v20/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
import java.util.Objects;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
Expand Down Expand Up @@ -84,9 +85,12 @@ public Context(
AcceptDatetimeFormat datetimeFormat,
HttpClient httpClient
) {
this.uri = uri;
this.token = token;
this.httpClient = httpClient;
this.uri = Objects.requireNonNull(uri, "uri can not be null");
this.token = Objects.requireNonNull(token, "token can not be null");
this.httpClient = Objects.requireNonNull(httpClient, "httpClient can not be null");

Objects.requireNonNull(application, "application can not be null");
Objects.requireNonNull(datetimeFormat, "datetimeFormat can not be null");

String extensions = null;

Expand Down