More codacy fixes

This commit is contained in:
maskara 2017-04-02 22:49:38 +05:30
parent c14e2566f5
commit 94e9d2ff0e
5 changed files with 17 additions and 18 deletions

View file

@ -5,10 +5,9 @@ public class LatLng {
public final double latitude; public final double latitude;
public final double longitude; public final double longitude;
/** /** Accepts latitude and longitude.
* Accepts latitude and longitude * @param latitude double value
* @param latitude * @param longitude double value
* @param longitude
*/ */
public LatLng(double latitude, double longitude) { public LatLng(double latitude, double longitude) {
if(-180.0D <= longitude && longitude < 180.0D) { if(-180.0D <= longitude && longitude < 180.0D) {

View file

@ -23,7 +23,7 @@ public class LocationServiceManager implements LocationListener {
return latestLocation; return latestLocation;
} }
/** Registers a LocationManager to listen for current location /** Registers a LocationManager to listen for current location.
*/ */
public void registerLocationManager() { public void registerLocationManager() {
try { try {
@ -42,7 +42,7 @@ public class LocationServiceManager implements LocationListener {
} }
} }
/** Unregisters location manager /** Unregisters location manager.
*/ */
public void unregisterLocationManager() { public void unregisterLocationManager() {
try { try {

View file

@ -7,10 +7,10 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import java.util.List;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
import java.util.List;
public class NearbyAdapter extends ArrayAdapter<Place> { public class NearbyAdapter extends ArrayAdapter<Place> {
private List<Place> placesList; private List<Place> placesList;
private Context context; private Context context;
@ -19,9 +19,9 @@ public class NearbyAdapter extends ArrayAdapter<Place> {
return placesList; return placesList;
} }
/** Accepts activity context and list of places /** Accepts activity context and list of places.
* @param context * @param context activity context
* @param places * @param places list of places
*/ */
public NearbyAdapter(Context context, List<Place> places) { public NearbyAdapter(Context context, List<Place> places) {
super(context, R.layout.item_place, places); super(context, R.layout.item_place, places);

View file

@ -19,13 +19,13 @@ import fr.free.nrw.commons.R;
import fr.free.nrw.commons.location.LatLng; import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.location.LocationServiceManager; import fr.free.nrw.commons.location.LocationServiceManager;
import static fr.free.nrw.commons.utils.LengthUtils.computeDistanceBetween;
import static fr.free.nrw.commons.utils.LengthUtils.formatDistanceBetween;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import static fr.free.nrw.commons.utils.LengthUtils.computeDistanceBetween;
import static fr.free.nrw.commons.utils.LengthUtils.formatDistanceBetween;
public class NearbyListFragment extends ListFragment implements TaskListener { public class NearbyListFragment extends ListFragment implements TaskListener {
private NearbyAsyncTask nearbyAsyncTask; private NearbyAsyncTask nearbyAsyncTask;

View file

@ -5,10 +5,10 @@ import fr.free.nrw.commons.location.LatLng;
import java.text.NumberFormat; import java.text.NumberFormat;
public class LengthUtils { public class LengthUtils {
/** Returns a formatted distance string between two points /** Returns a formatted distance string between two points.
* @param point1 * @param point1 LatLng type point1
* @param point2 * @param point2 LatLng type point2
* @return * @return string distance
*/ */
public static String formatDistanceBetween(LatLng point1, LatLng point2) { public static String formatDistanceBetween(LatLng point1, LatLng point2) {
if (point1 == null || point2 == null) { if (point1 == null || point2 == null) {