Program: 185386
Project: 185386
Buggy source:
@Test public void testTypeCheckingExtension(){
  Activator.getInstancePreferences().getBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,Activator.DEFAULT_SCRIPT_FILTERS_ENABLED);
  Activator.getInstancePreferences().get(Activator.GROOVY_SCRIPT_FILTERS,Activator.DEFAULT_GROOVY_SCRIPT_FILTER);
  try {
    IPath robotPath=env.addPackage(project.getFolder("String_Node_Str").getFullPath(),"String_Node_Str");
    env.addGroovyClass(robotPath,"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    Activator.getInstancePreferences().putBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,true);
    Activator.getInstancePreferences().put(Activator.GROOVY_SCRIPT_FILTERS,"String_Node_Str");
    String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    int start=contents.lastIndexOf("String_Node_Str");
    int end=start + "String_Node_Str".length();
    assertType(contents,start,end,"String_Node_Str");
    start=contents.lastIndexOf("String_Node_Str");
    end=start + "String_Node_Str".length();
    assertType(contents,start,end,"String_Node_Str");
    env.fullBuild(project.getFullPath());
    Problem[] problems=env.getProblemsFor(project.getFullPath());
    assertEquals("String_Node_Str" + Arrays.toString(problems),0,problems.length);
  }
  finally {
    Activator.getInstancePreferences().putBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,Activator.DEFAULT_SCRIPT_FILTERS_ENABLED);
    Activator.getInstancePreferences().put(Activator.GROOVY_SCRIPT_FILTERS,Activator.DEFAULT_GROOVY_SCRIPT_FILTER);
  }
}

Fixed version (ground truth):
@Test public void testTypeCheckingExtension(){
  Activator.getInstancePreferences().getBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,Activator.DEFAULT_SCRIPT_FILTERS_ENABLED);
  Activator.getInstancePreferences().get(Activator.GROOVY_SCRIPT_FILTERS,Activator.DEFAULT_GROOVY_SCRIPT_FILTER);
  try {
    IPath robotPath=env.addPackage(project.getFolder("String_Node_Str").getFullPath(),"String_Node_Str");
    env.addGroovyClass(robotPath,"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    Activator.getInstancePreferences().putBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,true);
    Activator.getInstancePreferences().put(Activator.GROOVY_SCRIPT_FILTERS,"String_Node_Str");
    String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
    int offset=contents.lastIndexOf("String_Node_Str");
    assertType(contents,offset,offset + "String_Node_Str".length(),"String_Node_Str");
    offset=contents.lastIndexOf("String_Node_Str");
    assertType(contents,offset,offset + "String_Node_Str".length(),"String_Node_Str");
    env.fullBuild(project.getFullPath());
    Problem[] problems=env.getProblemsFor(project.getFullPath());
    assertEquals("String_Node_Str" + Arrays.toString(problems),0,problems.length);
  }
  finally {
    Activator.getInstancePreferences().putBoolean(Activator.GROOVY_SCRIPT_FILTERS_ENABLED,Activator.DEFAULT_SCRIPT_FILTERS_ENABLED);
    Activator.getInstancePreferences().put(Activator.GROOVY_SCRIPT_FILTERS,Activator.DEFAULT_GROOVY_SCRIPT_FILTER);
  }
}