Structural replace: surround logger.debug(...) block with if (logger.isDebugEnabled())
Hi,
I was wondering if I could use structural replace to do the following:
Replace blocks like:
logger.debug("This is value" + value);
logger.debug("blah blah");
logger.debug("Thread: " + Thread.currentThread().toString());
with :
if (logger.isDebugEnabled()) {
logger.debug("This is value" + value);
logger.debug("blah blah");
logger.debug("Thread: " + Thread.currentThread().toString());
}
I'd like to skip over blocks that are already surrounded by the if
condition..
Is this possible?
Omair
请先登录再写评论。
Hi,
Right now it is not possible but this feature is planned
Omair-Inam Abdul-Matin wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
There is an inspection/quick fix for single log statements of the described scenario if the SimpleIntentions plugin is installed.
See also
http://www.intellij.net/forums/thread.jspa?messageID=5116689
etienne