Skip to content

Commit 67eac50

Browse files
committed
An unused exception is deleted
1 parent 8508f61 commit 67eac50

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/main/java/com/osrm/client/OSRMClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public class OSRMClient implements CostService {
2323
private static final String ENDPOINT_V2_TABLE = "/v2/table/";
2424

2525
public OSRMClient(String uri) throws EmptyUrlException {
26-
if (uri != null || !uri.isEmpty()) {
27-
this.uri = uri;
28-
} else {
26+
if (!stringHasValue(uri)) {
2927
throw new EmptyUrlException("OSRMClient Constructor requires a OSRM http url");
3028
}
29+
30+
this.uri = uri;
3131
}
3232

3333
@Override
@@ -79,6 +79,10 @@ public CostMatrices getCostMatrices(CostMatricesRequest request) {
7979
}
8080

8181
private String addParamString(String paramString, String key, String value) {
82-
return (value != null) && (!value.equals("")) ? paramString.concat("&" + key + "=" + value) : paramString;
82+
return stringHasValue(value) ? paramString.concat("&" + key + "=" + value) : paramString;
83+
}
84+
85+
private boolean stringHasValue(String string) {
86+
return (string != null) && (!string.equals(""));
8387
}
8488
}

src/main/java/com/osrm/client/exception/CostMatrixResponseException.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)