Buggy code:
public class LogFilter implements Filter { protected boolean CHANGEEXT = false ; protected String OLDEXT = null ; protected String NEWEXT = null ; protected String [ ] INCFILE = null ; protected String [ ] EXCFILE = null ; protected boolean FILEFILTER = false ; protected boolean USEFILE = true ; protected String [ ] INCPTRN = null ; protected String [ ] EXCPTRN = null ; protected boolean PTRNFILTER = false ; protected ArrayList EXCPATTERNS = new ArrayList ( ) ; protected ArrayList INCPATTERNS = new ArrayList ( ) ; protected String NEWFILE = null ; protected Perl5Matcher MATCHER = null ; public LogFilter ( ) { } public void setReplaceExtension ( String oldext , String newext ) { } public void includeFiles ( String [ ] filenames ) { } public void excludeFiles ( String [ ] filenames ) { } public void includePattern ( String [ ] regexp ) { } public void excludePattern ( String [ ] regexp ) { } public boolean isFiltered ( String path ) { } protected boolean filterFile ( String file ) { } public boolean incFile ( String text ) { } public boolean excFile ( String text ) { } protected boolean filterPattern ( String text ) { } protected boolean incPattern ( String text ) { } protected boolean excPattern ( String text ) { } public boolean replaceExtension ( String text ) { } public String filter ( String text ) { } public Pattern createPattern ( String pattern ) { try { Perl5Compiler comp = new Perl5Compiler ( ) ; <START_BUG> return comp . compile ( pattern ) ; <END_BUG> } catch ( Exception exception ) { exception . printStackTrace ( ) ; return null ; } } public static class Test extends JMeterTestCase { private static final String TESTSTR = "//test//helloworld.html" ; private static final String TESTSTROUT = "//test//helloworld.jsp" ; private static class TestData { private final String file ; private final boolean exclfile ; private final boolean inclfile ; private final boolean exclpatt ; private final boolean inclpatt ; TestData ( String f , boolean exf , boolean inf , boolean exp , boolean inp ) { } } private static final String [ ] INCL = new String [ ] { "hello.html" , "index.html" , "//index.jsp" } ; private static final String [ ] PATTERNS = new String [ ] { "index" , ".jtml" } ; private static final LogFilter . Test . TestData [ ] TESTDATA = new LogFilter . Test . TestData [ ] { new LogFilter . Test . TestData ( "//test//hello.jsp" , true , false , true , false ) , new LogFilter . Test . TestData ( "//test//one//hello.html" , false , true , true , false ) , new LogFilter . Test . TestData ( "hello.jsp" , true , false , true , false ) , new LogFilter . Test . TestData ( "hello.htm" , true , false , true , false ) , new LogFilter . Test . TestData ( "//test//open.jsp" , true , false , true , false ) , new LogFilter . Test . TestData ( "//test//open.html" , true , false , true , false ) , new LogFilter . Test . TestData ( "//index.jsp" , false , true , false , true ) , new LogFilter . Test . TestData ( "//index.jhtml" , true , false , false , true ) , new LogFilter . Test . TestData ( "newindex.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex1.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex2.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex3.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex4.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex5.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "oldindex6.jsp" , true , false , false , true ) , new LogFilter . Test . TestData ( "//test//index.htm" , true , false , false , true ) } ; public void testConstruct ( ) { } private LogFilter testf ; public void setUp ( ) { } public void testReplaceExtension ( ) { } public void testExcludeFiles ( ) { } public void testIncludeFiles ( ) { } public void testExcludePattern ( ) { } public void testIncludePattern ( ) { } } }

Fix:
return comp . compile ( pattern , READ_ONLY_MASK ) ;