developers

    Forum Stats

  • 3,873,642 Users
  • 2,266,620 Discussions
  • 7,911,595 Comments

Discussions

System.out.println() Ignored

I have a open source JDBC driver which has to be enhanced.

It is compiled with ant. I tried to code in my new methods for enhancing it and wanted to print the intermediate variables through System.out.println(). This particular line for printing onto the console is ignored and remaining code is working fine.

Can someone tell me where I went wrong?

Answers

  • 796440
    796440 Member Posts: 19,179 Gold Trophy
    Junnu wrote:
    Can someone tell me where I went wrong?
    You went wrong in assuming that line is "ignored." It's not. So one of the following must be true:

    1. That line is never reached because the code branch it's in is not executed.

    2. That line is never reached because an exception occurs.

    3. That line is being executed, but System.out has been redirected away from the console by System.setOut().

    4. That line is being executed, but System.out has been redirected away from the console by the command line, such as using > in linux.

    5. That line is being executed, but there's an error. Try System.out.checkError().

    6. That line is being executed, but System.out's buffer has not filled up so it's not appearing on the terminal. System.out.flush() would fix this, but this is not a likely scenario. I think that System.out is created with autoflushing enabled, but I may be mistaken.
  • jschellSomeoneStoleMyAlias
    jschellSomeoneStoleMyAlias Member Posts: 24,877 Gold Badge
    One more to the list...

    It didn't actually build or wasn't deployed. So the old code is still running.
This discussion has been closed.
developers