Use Java Annotation not to run a method

Posted by Michael Mao on Stack Overflow See other posts from Stack Overflow or by Michael Mao
Published on 2010-03-28T02:25:58Z Indexed on 2010/03/28 2:33 UTC
Read the original article Hit count: 304

Filed under:
|

Hi all:

I've got a method in my class only for testing purpose :

private void printOut(String msg, Object value)
{
    System.out.println(msg + value);
}

It is a wrapper method for System.out.println();

So I hope, with the use of Annotation, I can choose not to run this method during productive environment while still keep those diagnostic output ready if I am to switch back to debugging environment.

Which Annotation shall I put on top of the method name?

© Stack Overflow or respective owner

Related posts about java

Related posts about annotations