0

Under what conditions can one save a class file (with debug print statement), compile from command line, run, and actually run the old version of the program without the new statement?

Is there a common mistake that causes this or, if not that, gives the illusion of this happening?

clwhisk
  • 1,805
  • 1
  • 18
  • 17
  • Such things happen to me when I mix up the paths of my files, and update the wrong ones, while compiling something else. – mavrosxristoforos Sep 25 '13 at 05:53
  • Are you sure you're editing the right file in the right directory? I've often edited a different version of the file while compiling some other version. – gsgx Sep 25 '13 at 05:54
  • The problem must be `@SuppressWarnings({"unchecked"}) blah(){...`. It notices changes outside that method. Question stands in general. – clwhisk Sep 25 '13 at 06:10
  • I don't think the SuppressWarnings annotation has anything to do with this, as it just tells the compiler not to emit a warning in the conditions you tell it like unchecked warnings in your case. But it doesn't affect compilation per-se. Can you elaborate on what you are trying to do exactly? What is your directory layout? What commands do you issue etc. If you edit the JAVA file that you compile to a CLASS file and run that compiled CLASS file, there is no condition I could imagine right now that allows to run the old version except if you do not compile the right file or run the right file. – Vampire Sep 25 '13 at 12:41
  • Ok. I had copied/renamed and it was running on an object of the old class. In hindsight because the problem was isolated to `main()`, I should have noticed this. – clwhisk Sep 25 '13 at 18:10
  • Maybe you should answer your own question and accept that answer then, or if you prefer I write an answer that you can accept. :-) – Vampire Sep 27 '13 at 11:15

0 Answers0