Program: 87540
Project: 87540
Buggy source:
/** 
 * Here is the scenario : - fact is the last word of a string - some regex based rules with logged actions log each matches as : <code>'[fact]' triggers [rule]</code> - If action occurs, log success
 */
@Test public void testScenario(){
  String token1="String_Node_Str";
  String token2="String_Node_Str";
  String token3="String_Node_Str";
  String token4="String_Node_Str";
  String token5="String_Node_Str";
  RegexRule lcRule=new RegexRule("String_Node_Str","String_Node_Str");
  lcRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule domainRule=new RegexRule("String_Node_Str","String_Node_Str");
  domainRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule instanceRule=new RegexRule("String_Node_Str","String_Node_Str");
  instanceRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule withRule=new RegexRule("String_Node_Str","String_Node_Str");
  withRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  SingleFactRulesEngine engine=new SingleFactRulesEngine(OrderMode.INSERT);
  engine.addRule(lcRule);
  engine.addRule(domainRule);
  engine.addRule(instanceRule);
  engine.addRule(withRule);
  System.out.println("String_Node_Str");
  engine.processFact(token1);
  System.out.println("String_Node_Str");
  engine.processFact(token2);
  System.out.println("String_Node_Str");
  engine.processFact(token3);
  System.out.println("String_Node_Str");
  engine.processFact(token4);
  System.out.println("String_Node_Str");
  engine.processFact(token5);
  Report ctx=engine.getReport();
  engine.clearReport();
  Assert.assertTrue("String_Node_Str",ctx.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",ctx.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token3 + "String_Node_Str",ctx.contains("String_Node_Str" + token3 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token3 + "String_Node_Str",ctx.contains("String_Node_Str" + token3 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Here is the scenario : - fact is the last word of a string - some regex based rules with logged actions log each matches as : <code>'[fact]' triggers [rule]</code> - If action occurs, log success
 */
@Test public void testScenario(){
  String token1="String_Node_Str";
  String token2="String_Node_Str";
  String token3="String_Node_Str";
  String token4="String_Node_Str";
  String token5="String_Node_Str";
  RegexRule lcRule=new RegexRule("String_Node_Str","String_Node_Str");
  lcRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule domainRule=new RegexRule("String_Node_Str","String_Node_Str");
  domainRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule instanceRule=new RegexRule("String_Node_Str","String_Node_Str");
  instanceRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  RegexRule withRule=new RegexRule("String_Node_Str","String_Node_Str");
  withRule.addCommand(new LogFactVerbRuleCommand("String_Node_Str"));
  SingleFactRulesEngine engine=new SingleFactRulesEngine(OrderMode.INSERT);
  engine.addRule(lcRule);
  engine.addRule(domainRule);
  engine.addRule(instanceRule);
  engine.addRule(withRule);
  System.out.println("String_Node_Str");
  engine.processFact(token1);
  System.out.println("String_Node_Str");
  engine.processFact(token2);
  System.out.println("String_Node_Str");
  engine.processFact(token3);
  System.out.println("String_Node_Str");
  engine.processFact(token4);
  System.out.println("String_Node_Str");
  engine.processFact(token5);
  Report ctx=engine.getReport();
  Assert.assertTrue("String_Node_Str",ctx.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",ctx.contains("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token3 + "String_Node_Str",ctx.contains("String_Node_Str" + token3 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token3 + "String_Node_Str",ctx.contains("String_Node_Str" + token3 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token4 + "String_Node_Str",ctx.contains("String_Node_Str" + token4 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + token5 + "String_Node_Str",ctx.contains("String_Node_Str" + token5 + "String_Node_Str"));
}