Fixed the intial validation so any lower case name will be chnaged to uppercase

main
Liam Beckett 9 years ago
parent 5f8e2f2481
commit df5721973f

@ -1946,12 +1946,12 @@ public class Dataset {
*/ */
public void editFlight(FlightPoint flightPoint, String name, String type, String altitude, String latitude, String longitude) throws DataException { public void editFlight(FlightPoint flightPoint, String name, String type, String altitude, String latitude, String longitude) throws DataException {
EntryParser entryParser = new EntryParser(); EntryParser entryParser = new EntryParser();
FlightPoint flightPoint1 = entryParser.parsePoint(name, type, altitude, latitude, longitude); FlightPoint parsedFlightPoint = entryParser.parsePoint(name, type, altitude, latitude, longitude);
flightPoint.setName(flightPoint1.getName()); flightPoint.setName(parsedFlightPoint.getName());
flightPoint.setType(flightPoint1.getType()); flightPoint.setType(parsedFlightPoint.getType());
flightPoint.setAltitude(flightPoint1.getAltitude()); flightPoint.setAltitude(parsedFlightPoint.getAltitude());
flightPoint.setLatitude(flightPoint1.getLatitude()); flightPoint.setLatitude(parsedFlightPoint.getLatitude());
flightPoint.setLongitude(flightPoint1.getLongitude()); flightPoint.setLongitude(parsedFlightPoint.getLongitude());
Connection c = null; Connection c = null;

@ -133,6 +133,7 @@ public class EntryParser {
public FlightPoint parsePoint(String name, String type, String altitude, String latitude, String longitude) throws DataException{ public FlightPoint parsePoint(String name, String type, String altitude, String latitude, String longitude) throws DataException{
//name //name
name = name.toUpperCase();
if (!isLetter(name)) { if (!isLetter(name)) {
throw new DataException("ICAO code must contain only letters"); throw new DataException("ICAO code must contain only letters");
} }

Loading…
Cancel
Save