the reason why i tried to use SSR is i have 200+ usages of System.exit.
We consider "legal" to call System.exit from the main method, but not from anywhere else in the code and of those 200+ usages, a large portion is from main methods.
So I was trying to refine the search so as not to have so many false positives
i've made a step in the direction using the following template
class $Class$ {
$returnType$ $methodName$($ParameterType$ $ParameterName$) {
$Statement1$;
System.exit($param$);
$Statement2$;
}
}
But this does not find cases where the System.exit statement is in a catch block for example (or I guess any kind of a block)
- Navigate to System class
- Put the cursor on the exit() method
- ALT+F7
Or for some reason you really need to use structural search?
Thibaut wrote:
Yes, this is current limiation of SS.
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
the reason why i tried to use SSR is i have 200+ usages of System.exit.
We consider "legal" to call System.exit from the main method, but not from anywhere else in the code and of those 200+ usages, a large portion is from main methods.
So I was trying to refine the search so as not to have so many false positives
ok, thanks for the reply