Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 42006dd

Browse filesBrowse files
committed
sdk-java issue : "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment #163" Changed 'nullEnvironmentErrorMessage' as a constant to avoid confusion.
1 parent bd40452 commit 42006dd
Copy full SHA for 42006dd

File tree

2 files changed

+3
-3
lines changed
Filter options

2 files changed

+3
-3
lines changed

‎src/main/java/net/authorize/api/controller/base/ApiOperationBase.java

Copy file name to clipboardExpand all lines: src/main/java/net/authorize/api/controller/base/ApiOperationBase.java
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,11 @@ public S executeWithApiResponse(Environment environment) {
121121
return this.getApiResponse();
122122
}
123123

124-
final String nullEnvironmentErrorMessage = "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment";
125124

126125
public void execute() {
127126
if ( null == ApiOperationBase.getEnvironment())
128127
{
129-
throw new InvalidParameterException(nullEnvironmentErrorMessage);
128+
throw new InvalidParameterException(Constants.NULL_ENVIRONMENT_ERROR_MESSAGE);
130129
}
131130
else
132131
{
@@ -139,7 +138,7 @@ public void execute(Environment environment) {
139138

140139
logger.debug(String.format("Executing Request:'%s'", this.getApiRequest()));
141140

142-
if ( null == environment) throw new InvalidParameterException(nullEnvironmentErrorMessage);
141+
if ( null == environment) throw new InvalidParameterException(Constants.NULL_ENVIRONMENT_ERROR_MESSAGE);
143142

144143
ANetApiResponse httpApiResponse = HttpUtility.postData(environment, this.getApiRequest(), this.responseClass);
145144
if ( null != httpApiResponse)

‎src/main/java/net/authorize/util/Constants.java

Copy file name to clipboardExpand all lines: src/main/java/net/authorize/util/Constants.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ public final class Constants {
3636
public static final int HTTP_READ_TIME_OUT_DEFAULT_VALUE = 30000;
3737

3838
public static final String CLIENT_ID = "sdk-java-2.0.3";
39+
public static final String NULL_ENVIRONMENT_ERROR_MESSAGE = "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment";
3940
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.