How to write a virtual conditional breakpoint in java
        Posted  
        
            by Phuong Nguyen de ManCity fan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Phuong Nguyen de ManCity fan
        
        
        
        Published on 2010-04-22T14:10:29Z
        Indexed on 
            2010/04/22
            14:13 UTC
        
        
        Read the original article
        Hit count: 417
        
I'm sorry if the question title may mis-inform you, but I cannot find a proper word to explain that.
If you ever working with .NET, you would know that there is Assert class that will automatically wake up and attach debugger if necessary and then have debugger (Visual Studio) pausing at the Assert command, given the Assert command failed.
Given I'm running a java program and having debugger connected, then how can I have debugger to break on certain condition without manually setup a break point?
I'm expecting something like that:
void doSomeThing(String x){
   if (x==null) breakDebuggerNow();
}
© Stack Overflow or respective owner