Create breakpoint when a specific method is called

noidsirius :

I'm working on a Java legacy code (in Eclipse). It works fine (its output is correct); however, it prints an extra blank line. I want to find this statement and remove it, but there are lots of System.out.print lines in the code and I cannot check them one by one. Is there any way to ask the Eclipse debugger to pause when System.out.print is called? It's similar to putting breakpoints on every System.out.print in the code (and the debugger will stop when it reaches these lines).

NeB Nep :

I think just set breakpoint on System.out#print method should work fine.
jdk source code:

public void println(String x) {
    synchronized (this) {
        print(x);  // break point here
        newLine();
    }
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=80324&siteId=1
Recommended