I'm working on java checkstyle configuration in Eclipse. I need to add warning for all public methods that don't consist specific code in the first line. Example:
public void doA(){
blabla();
//some code
}
public String doB(int i){
blabla();
//some code
}
public Boolean doC(String str){
//some code
}
What I want from checkstyle is to mark the line or report error when there is method that has public modifier and doesn't start with calling blabla() method. I tried to make some multiline regexp strings with /n as a newline but so far no success.
edit: so far I tried this but without success:
<module name="RegexpMultiline">
<property name="format" value="(public)(\\s+)((?:[a-z][a-z0-9_]*))(\\s+)((?:[a-z][a-z0-9_]*))(\\(.*\\))(\\{)(/n)(blablabla)"/>
<property name="message" value="Public method should have blablabla."/>
</module>