It doesn't execute for some reason when normally running, but when I step though the program using the debugger everything executes fine and I get a meaningful output (not very well formatted, but something I can work with), why is this happening?

at this point it should return out and then check hasAPath for the next flight which would be Boston and Toronto, which would then check all Bostons outgoign flights to see if their airports have a connection with toronto... and so on

it happened with me, while using eclipse, when i adding new sop("Ankushy"); in one of my private methods it not print on console. First i looked into .class file that does not contain newly added line, then i clean and rebuild project and it work for me, i suggested you to check your work space output location for java .classes.
– ankush yadavNov 23 '15 at 6:22

I completely deleted the class folders used in this project then went to clean the project... didn't make a difference. :(
– JamesNov 23 '15 at 14:14

1

Did you override equals or the hash function for the class Airport?
– JF MeierNov 23 '15 at 14:33

Nope, the only thing I overwritten was toString
– JamesNov 23 '15 at 15:02

Try adding console output to get info on the state of the program as it's runnning, either through java.util.Logger, Log4J or System.out.println.
– PascalNov 23 '15 at 15:10

1 Answer
1

Problem solved. The answer was that when you run in debug it runs though all of the possibilities even if you return the answer, this is why it evaluated to true and worked, I changed the has a path method from this :

If anyone else is looking this problem then I suggest placing outputs to the console at each block of your code and following through what is happening, the execution model in debug mode must be different from that in normal running.