View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="MatchXpath">
5         <property name="query"
6              value="//METHOD_DEF[./IDENT[@text='test' or @text='foo']]"/>
7         <message key="matchxpath.match"
8              value="Method name should not be 'test' or 'foo'"/>
9       </module>
10    </module>
11  </module>
12  */
13  package com.puppycrawl.tools.checkstyle.checks.coding.matchxpath;
14  
15  // xdoc section -- start
16  public class Example3 {
17    // violation below 'Method name should not be test or foo'
18    public void test() {}
19    public void getName() {}
20    // violation below 'Method name should not be test or foo'
21    public void foo() {}
22    public void sayHello() {}
23  }
24  // xdoc section -- end