Java Snippet Search is an Eclipse plug-in that allows you to search Java code for patterns by specifying example snippets.
With the Snippet Syntax you can specify small pieces of Java code that can contain placeholders and negations. The snippet will be translated into an XPath query that will be executed on the AST of your Java program.