Refactoring bugs fixed again

This commit is contained in:
Sunguin Peng
2016-09-17 20:33:20 +12:00
parent 50cc5c6dfb
commit 37e712f734
8 changed files with 56 additions and 47 deletions
@@ -365,7 +365,8 @@ public class Airport {
return distance;
}
public void hasDuplicate(Airport airport) throws DataException{
if (!airport.getName().equals("") && airport.getName().equals(this.name)){
if (airport.getName().equals("") || airport.getName().equals(this.name)){
//System.out.println(airport.getName() + " "+ this.name);
throw new DataException("Airport Name already Exists, Please Choose Another.");
}
if (!airport.getIATA_FFA().equals("") && airport.getIATA_FFA().equals(this.name)){