Projects >> cgeo >>ccadb9ecb2310f25f1c667e4a5b6c01ca1a827b6

Chunk
Conflicting content
		final String latText = latView.getText().toString();
		final String lonText = lonView.getText().toString();

<<<<<<< HEAD
		if (StringUtils.isEmpty(latText) || StringUtils.isEmpty(lonText)) {
			latView.setText(cgBase.formatLatitude(geo.coordsNow.getLatitude(), true));
			lonView.setText(cgBase.formatLongitude(geo.coordsNow.getLongitude(), true));
=======
		if (StringUtils.isEmpty(latText) || StringUtils.isEmpty(lonText)) { //TODO: now coordinates
			latView.setText(cgBase.formatLatitude(geo.latitudeNow, true));
			lonView.setText(cgBase.formatLongitude(geo.longitudeNow, true));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
		} else {
			Map latParsed = cgBase.parseCoordinate(latText, "lat");
			Map lonParsed = cgBase.parseCoordinate(lonText, "lat");
Solution content
		final String latText = latView.getText().toString();
		final String lonText = lonView.getText().toString();

		if (StringUtils.isEmpty(latText) || StringUtils.isEmpty(lonText)) { // TODO: now coordinates
			latView.setText(cgBase.formatLatitude(geo.coordsNow.getLatitude(), true));
			lonView.setText(cgBase.formatLongitude(geo.coordsNow.getLongitude(), true));
		} else {
			Map latParsed = cgBase.parseCoordinate(latText, "lat");
			Map lonParsed = cgBase.parseCoordinate(lonText, "lat");
File
cgeoadvsearch.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
<<<<<<< HEAD
package cgeo.geocaching;

import java.util.Map;
=======
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

import org.apache.commons.lang3.StringUtils;
Solution content
package cgeo.geocaching;

import org.apache.commons.lang3.StringUtils;
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import cgeo.geocaching.cgSettings.coordInputFormatEnum;
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.geopoint.Geopoint;
<<<<<<< HEAD
=======
import cgeo.geocaching.geopoint.Geopoint.MalformedCoordinateException;
import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.geopoint.GeopointParser.ParseException;
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

public class cgeocoords extends Dialog {
Solution content
import cgeo.geocaching.cgSettings.coordInputFormatEnum;
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.Geopoint.MalformedCoordinateException;
import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.geopoint.GeopointParser.ParseException;

public class cgeocoords extends Dialog {
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
	private AbstractActivity context = null;
	private cgSettings settings = null;
	private cgGeo geo = null;
<<<<<<< HEAD
	private Geopoint coords = new Geopoint(0, 0);
=======
	private Geopoint gp = null;
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

	private EditText eLat, eLon;
	private Button bLat, bLon;
Solution content
	private AbstractActivity context = null;
	private cgSettings settings = null;
	private cgGeo geo = null;
	private Geopoint gp = null;

	private EditText eLat, eLon;
	private Button bLat, bLon;
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
		settings = settingsIn;
		geo = geoIn;

<<<<<<< HEAD
		if (waypoint != null) {
			coords = waypoint.coords;
		} else if (geo != null && geo.coordsNow != null) {
			coords = geo.coordsNow;
=======
		if (gpIn != null) {
			gp = gpIn;
		} else if (geo != null && geo.latitudeNow != null && geo.longitudeNow != null) {
			gp = new Geopoint(geo.latitudeNow, geo.longitudeNow);
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
		}
	}
Solution content
		settings = settingsIn;
		geo = geoIn;

		if (gpIn != null) {
			gp = gpIn;
		} else if (geo != null && geo.coordsNow != null) {
			gp = geo.coordsNow;
		}
	}
File
cgeocoords.java
Developer's decision
Manual
Kind of conflict
Attribute
If statement
Method invocation
Variable
Chunk
Conflicting content
	}

	private void updateGUI() {
<<<<<<< HEAD
		double latitude = 0.0;
		double longitude = 0.0;
		double lat = 0.0;
		double lon = 0.0;
		if (coords != null) {
			latitude = coords.getLatitude();
			if (latitude < 0) {
				bLat.setText("S");
			} else {
				bLat.setText("N");
			}

			lat = Math.abs(latitude);

			longitude = coords.getLongitude();
			if (longitude < 0) {
				bLon.setText("W");
			} else {
				bLon.setText("E");
			}
=======
		if (gp == null)
			return;
		Double lat = 0.0;
		if (gp.getLatitude() < 0) {
			bLat.setText("S");
		} else {
			bLat.setText("N");
		}
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

		lat = Math.abs(gp.getLatitude());
Solution content
	}

	private void updateGUI() {
		if (gp == null)
			return;
		Double lat = 0.0;
		if (gp.getLatitude() < 0) {
			bLat.setText("S");
		} else {
			bLat.setText("N");
		}

		lat = Math.abs(gp.getLatitude());
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
			bLon.setText("E");
		}

<<<<<<< HEAD
=======
		lon = Math.abs(gp.getLongitude());

>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
		int latDeg = (int) Math.floor(lat);
		int latDegFrac = (int) Math.round((lat - latDeg) * 100000);
Solution content
			bLon.setText("E");
		}

		lon = Math.abs(gp.getLongitude());

		int latDeg = (int) Math.floor(lat);
		int latDegFrac = (int) Math.round((lat - latDeg) * 100000);
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
				findViewById(R.id.coordTable).setVisibility(View.GONE);
				eLat.setVisibility(View.VISIBLE);
				eLon.setVisibility(View.VISIBLE);
<<<<<<< HEAD
				if (coords != null) {
					eLat.setText(cgBase.formatLatitude(latitude, true));
					eLon.setText(cgBase.formatLongitude(longitude, true));
				}
=======
				eLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
				eLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
				break;
			case Deg: // DDD.DDDDD°
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
Solution content
				findViewById(R.id.coordTable).setVisibility(View.GONE);
				eLat.setVisibility(View.VISIBLE);
				eLon.setVisibility(View.VISIBLE);
				eLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
				eLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
				break;
			case Deg: // DDD.DDDDD°
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
				tLatSep2.setText("°");
				tLonSep2.setText("°");

<<<<<<< HEAD
				if (coords != null) {
					eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
					eLatMin.setText(addZeros(latDegFrac, 5) + Integer.toString(latDegFrac));
					eLonDeg.setText(addZeros(latDeg, 3) + Integer.toString(lonDeg));
					eLonMin.setText(addZeros(lonDegFrac, 5) + Integer.toString(lonDegFrac));
				}
=======
				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latDegFrac, 5) + Integer.toString(latDegFrac));
				eLonDeg.setText(addZeros(latDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonDegFrac, 5) + Integer.toString(lonDegFrac));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
				break;
			case Min: // DDD° MM.MMM
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
Solution content
				break;
				tLatSep2.setText("°");
				tLonSep2.setText("°");

				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latDegFrac, 5) + Integer.toString(latDegFrac));
				eLonDeg.setText(addZeros(latDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonDegFrac, 5) + Integer.toString(lonDegFrac));
			case Min: // DDD° MM.MMM
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
				tLatSep3.setText("'");
				tLonSep3.setText("'");

<<<<<<< HEAD
				if (coords != null) {
					eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
					eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
					eLatSec.setText(addZeros(latMinFrac, 3) + Integer.toString(latMinFrac));
					eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
					eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
					eLonSec.setText(addZeros(lonMinFrac, 3) + Integer.toString(lonMinFrac));
				}
=======
				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
				eLatSec.setText(addZeros(latMinFrac, 3) + Integer.toString(latMinFrac));
				eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
				eLonSec.setText(addZeros(lonMinFrac, 3) + Integer.toString(lonMinFrac));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
				break;
			case Sec: // DDD° MM SS.SSS
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
Solution content
				tLatSep3.setText("'");
				tLonSep3.setText("'");

				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
				eLatSec.setText(addZeros(latMinFrac, 3) + Integer.toString(latMinFrac));
				eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
				eLonSec.setText(addZeros(lonMinFrac, 3) + Integer.toString(lonMinFrac));
				break;
			case Sec: // DDD° MM SS.SSS
				findViewById(R.id.coordTable).setVisibility(View.VISIBLE);
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
				tLatSep3.setText(".");
				tLonSep3.setText(".");

<<<<<<< HEAD
				if (coords != null) {
					eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
					eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
					eLatSec.setText(addZeros(latSec, 2) + Integer.toString(latSec));
					eLatSub.setText(addZeros(latSecFrac, 3) + Integer.toString(latSecFrac));
					eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
					eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
					eLonSec.setText(addZeros(lonSec, 2) + Integer.toString(lonSec));
					eLonSub.setText(addZeros(lonSecFrac, 3) + Integer.toString(lonSecFrac));
				}
=======
				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
				eLatSec.setText(addZeros(latSec, 2) + Integer.toString(latSec));
				eLatSub.setText(addZeros(latSecFrac, 3) + Integer.toString(latSecFrac));
				eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
				eLonSec.setText(addZeros(lonSec, 2) + Integer.toString(lonSec));
				eLonSub.setText(addZeros(lonSecFrac, 3) + Integer.toString(lonSecFrac));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
				break;
		}
	}
Solution content
				tLatSep3.setText(".");
				tLonSep3.setText(".");

				eLatDeg.setText(addZeros(latDeg, 2) + Integer.toString(latDeg));
				eLatMin.setText(addZeros(latMin, 2) + Integer.toString(latMin));
				eLatSec.setText(addZeros(latSec, 2) + Integer.toString(latSec));
				eLatSub.setText(addZeros(latSecFrac, 3) + Integer.toString(latSecFrac));
				eLonDeg.setText(addZeros(lonDeg, 3) + Integer.toString(lonDeg));
				eLonMin.setText(addZeros(lonMin, 2) + Integer.toString(lonMin));
				eLonSec.setText(addZeros(lonSec, 2) + Integer.toString(lonSec));
				eLonSub.setText(addZeros(lonSecFrac, 3) + Integer.toString(lonSecFrac));
				break;
		}
	}
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
		} catch (NumberFormatException e) {}

<<<<<<< HEAD
		double latitude = 0.0;
		double longitude = 0.0;
=======
		Double latitude = 0.0;
		Double longitude = 0.0;
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
		switch (currentFormat) {
			case Deg:
				latitude = latDeg + latDegFrac;
Solution content
		} catch (NumberFormatException e) {}

		double latitude = 0.0;
		double longitude = 0.0;

		switch (currentFormat) {
			case Deg:
				latitude = latDeg + latDegFrac;
File
cgeocoords.java
Developer's decision
Version 1
Kind of conflict
Variable
Chunk
Conflicting content
		}
		latitude  *= (bLat.getText().toString().equalsIgnoreCase("S") ? -1 : 1);
		longitude *= (bLon.getText().toString().equalsIgnoreCase("W") ? -1 : 1);
<<<<<<< HEAD

		coords = new Geopoint(latitude, longitude);
=======
		try {
			gp = new Geopoint(latitude, longitude);
		} catch (MalformedCoordinateException e) {
			context.showToast(context.getResources().getString(R.string.err_invalid_lat_lon));
			return false;
		}
		return true;
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
	}

	private class CoordinateFormatListener implements OnItemSelectedListener {
Solution content
		return true;
	}

		}
		latitude  *= (bLat.getText().toString().equalsIgnoreCase("S") ? -1 : 1);
		longitude *= (bLon.getText().toString().equalsIgnoreCase("W") ? -1 : 1);

		try {
			gp = new Geopoint(latitude, longitude);
		} catch (MalformedCoordinateException e) {
			context.showToast(context.getResources().getString(R.string.err_invalid_lat_lon));
			return false;
		}
	private class CoordinateFormatListener implements OnItemSelectedListener {
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Return statement
Try statement
Chunk
Conflicting content
				context.showToast(context.getResources().getString(R.string.err_point_unknown_position));
				return;
			}
<<<<<<< HEAD

			coords = geo.coordsNow;
=======
			gp = new Geopoint(geo.latitudeNow, geo.longitudeNow);
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
			updateGUI();
		}
	}
Solution content
				context.showToast(context.getResources().getString(R.string.err_point_unknown_position));
				return;
			}

			gp = geo.coordsNow;
			updateGUI();
		}
	}
File
cgeocoords.java
Developer's decision
Manual
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
		@Override
		public void onClick(View v) {
<<<<<<< HEAD
			if (currentFormat == coordInputFormatEnum.Plain) {
				if (eLat.length() > 0 && eLon.length() > 0) {
					// latitude & longitude
					Map latParsed = cgBase.parseCoordinate(eLat.getText().toString(), "lat");
					Map lonParsed = cgBase.parseCoordinate(eLon.getText().toString(), "lon");

					if (latParsed == null || latParsed.get("coordinate") == null || latParsed.get("string") == null) {
						context.showToast(context.getResources().getString(R.string.err_parse_lat));
						return;
					}

					if (lonParsed == null || lonParsed.get("coordinate") == null || lonParsed.get("string") == null) {
						context.showToast(context.getResources().getString(R.string.err_parse_lon));
						return;
					}

					coords = new Geopoint((Double) latParsed.get("coordinate"), (Double) lonParsed.get("coordinate"));
				} else {
					if (geo == null || geo.coordsNow == null) {
						context.showToast(context.getResources().getString(R.string.err_point_curr_position_unavailable));
						return;
					}

					coords = geo.coordsNow;
				}
			}
			cuListener.update(coords);
=======
			if (calc() == false)
				return;
			if (gp != null)
				cuListener.update(gp);
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
			dismiss();
		}
	}
Solution content
		@Override
		public void onClick(View v) {
			if (calc() == false)
				return;
			if (gp != null)
				cuListener.update(gp);
			dismiss();
		}
	}
File
cgeocoords.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
	}

	public interface CoordinateUpdate {
<<<<<<< HEAD
		public void update(final Geopoint coords);
=======
		public void update(Geopoint gp);
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
	}

}
Solution content
	}

	public interface CoordinateUpdate {
		public void update(final Geopoint gp);
	}

}
File
cgeocoords.java
Developer's decision
Manual
Kind of conflict
Method interface
Chunk
Conflicting content
			}

			try {
<<<<<<< HEAD
				if (latEdit == null) {
					latEdit = (EditText) findViewById(R.id.latitude);
				}
				if (lonEdit == null) {
					lonEdit = (EditText) findViewById(R.id.longitude);
				}

				latEdit.setHint(cgBase.formatLatitude(geo.coordsNow.getLatitude(), false));
				lonEdit.setHint(cgBase.formatLongitude(geo.coordsNow.getLongitude(), false));
=======
				latButton.setHint(cgBase.formatLatitude(geo.latitudeNow, false));
				lonButton.setHint(cgBase.formatLongitude(geo.longitudeNow, false));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
			} catch (Exception e) {
				Log.w(cgSettings.tag, "Failed to update location.");
			}
Solution content
			}

			try {
				latButton.setHint(cgBase.formatLatitude(geo.coordsNow.getLatitude(), false));
				lonButton.setHint(cgBase.formatLongitude(geo.coordsNow.getLongitude(), false));
			} catch (Exception e) {
				Log.w(cgSettings.tag, "Failed to update location.");
			}
File
cgeopoint.java
Developer's decision
Manual
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
				return;
			}

<<<<<<< HEAD
			((EditText) findViewById(R.id.latitude)).setText(cgBase.formatLatitude(geo.coordsNow.getLatitude(), true));
			((EditText) findViewById(R.id.longitude)).setText(cgBase.formatLongitude(geo.coordsNow.getLongitude(), true));
=======
			latButton.setText(cgBase.formatLatitude(geo.latitudeNow, true));
			lonButton.setText(cgBase.formatLongitude(geo.longitudeNow, true));
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

			changed = false;
		}
Solution content
				return;
			}

			latButton.setText(cgBase.formatLatitude(geo.coordsNow.getLatitude(), true));
			lonButton.setText(cgBase.formatLongitude(geo.coordsNow.getLongitude(), true));

			changed = false;
		}
File
cgeopoint.java
Developer's decision
Manual
Kind of conflict
Method invocation
Chunk
Conflicting content
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.geopoint.Geopoint;
<<<<<<< HEAD
=======
import cgeo.geocaching.geopoint.GeopointFormatter;
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0

public class cgeowaypointadd extends AbstractActivity {
Solution content
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.GeopointFormatter;

public class cgeowaypointadd extends AbstractActivity {
File
cgeowaypointadd.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
			coordsDialog.setCancelable(true);
			coordsDialog.setOnCoordinateUpdate(new cgeocoords.CoordinateUpdate() {
				@Override
<<<<<<< HEAD
				public void update(final Geopoint coords) {
					((Button) findViewById(R.id.buttonLatitude)).setText(cgBase.formatLatitude(coords.getLatitude(), true));
					((Button) findViewById(R.id.buttonLongitude)).setText(cgBase.formatLongitude(coords.getLongitude(), true));
					if (waypoint != null) {
						waypoint.coords = coords;
=======
				public void update(Geopoint gp) {
					((Button) findViewById(R.id.buttonLatitude)).setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
					((Button) findViewById(R.id.buttonLongitude)).setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
					if (waypoint != null) {
						waypoint.latitude = gp.getLatitude();
						waypoint.longitude = gp.getLongitude();
>>>>>>> f005cead0b4965b98afb4b5e71235059a50895a0
					}
				}
			});
Solution content
			coordsDialog.setCancelable(true);
			coordsDialog.setOnCoordinateUpdate(new cgeocoords.CoordinateUpdate() {
				@Override
				public void update(final Geopoint gp) {
					((Button) findViewById(R.id.buttonLatitude)).setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
					((Button) findViewById(R.id.buttonLongitude)).setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
					if (waypoint != null) {
						waypoint.coords = gp;
					}
				}
			});
File
cgeowaypointadd.java
Developer's decision
Manual
Kind of conflict
Attribute
If statement
Method invocation
Method signature
Variable