From bc4a46a01e8d7c3e6238ba07f96eb67adc75c116 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Nov 2019 12:16:46 -0800 Subject: Refactor constructor --- .../java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java b/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java index 88353391d..cb3094e16 100644 --- a/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java +++ b/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java @@ -27,8 +27,10 @@ public class OpenCellIdGeolocationProvider implements GeolocationProvider { private String url; public OpenCellIdGeolocationProvider(String url, String key) { - this.url = (url == null ? "http://opencellid.org/cell/get" : url) - + "?format=json&mcc=%d&mnc=%d&lac=%d&cellid=%d&key=" + key; + if (url == null) { + url = "http://opencellid.org/cell/get"; + } + this.url = url + "?format=json&mcc=%d&mnc=%d&lac=%d&cellid=%d&key=" + key; } @Override -- cgit v1.2.3