nus-yam/ex-repair huggingface dataset:
Program: 134433
Project: 134433
Buggy source:
/** 
 * removes handle that is instantiated as   {@link IHasHandle} object 
 */
void remove(IHasHandle handle){
  handleObjects.remove(handle.getHandle());
}

Fixed version (ground truth):
/** 
 * removes handle that is instantiated as   {@link IHasHandle} object 
 */
void remove(IHasHandle handle){
  String stringHandle=handle.getHandle();
  List<IHasHandle> result=instantiatedHandles.get(stringHandle);
  if (result != null)   result.remove(handle);
  if (result == null || result.size() == 0) {
    handleObjects.remove(stringHandle);
    instantiatedHandles.remove(stringHandle);
  }
}
Program: 134434
Project: 134434
Buggy source:
/** 
 * Gets a new created listenable   {@link Handle} and notifies listenerthat there it is a new object
 * @param handle instantiated {@link Handle}
 * @param beanName Is a name of the {@link Bean}
 * @return listenable {@link Handle} instance
 */
@SuppressWarnings("String_Node_Str") <T extends Handle>T returnNewCreatedListenableHandle(Handle handle,String beanName){
  T result=(T)driverEncapsulation.context.getBean(beanName,handle);
  result.whenIsCreated();
  getHandleReceptionist().addKnown(result);
  return result;
}

Fixed version (ground truth):
/** 
 * Gets a new created listenable   {@link Handle} and notifies listenerthat there it is a new object
 * @param handle instantiated {@link Handle}
 * @param beanName Is a name of the {@link Bean}
 * @return listenable {@link Handle} instance
 */
@SuppressWarnings("String_Node_Str") <T extends Handle>T returnNewCreatedListenableHandle(Handle handle,String beanName){
  T result=(T)driverEncapsulation.context.getBean(beanName,handle);
  if (!getHandleReceptionist().isInstantiated(handle.getHandle()))   handle.whenIsCreated();
  getHandleReceptionist().addKnown(handle);
  return result;
}
Program: 134435
Project: 134435
Buggy source:
private void prelaunch(){
  DesiredCapabilities dc=new DesiredCapabilities();
  dc.merge(supportedDriver.getDefaultCapabilities());
  Arrays.asList(paramValues).forEach(param -> {
    if (Capabilities.class.isAssignableFrom(param.getClass()))     dc.merge((Capabilities)param);
  }
);
  supportedDriver.launchRemoteServerLocallyIfWasDefined();
  if (config == null) {
    supportedDriver.setSystemProperty(Configuration.byDefault,dc);
    return;
  }
  supportedDriver.setSystemProperty(config,dc);
}

Fixed version (ground truth):
private void prelaunch(){
  DesiredCapabilities dc=new DesiredCapabilities();
  dc.merge(supportedDriver.getDefaultCapabilities());
  Arrays.asList(paramValues).forEach(param -> {
    if (param == null)     return;
    if (Capabilities.class.isAssignableFrom(param.getClass()))     dc.merge((Capabilities)param);
  }
);
  supportedDriver.launchRemoteServerLocallyIfWasDefined();
  if (config == null) {
    supportedDriver.setSystemProperty(Configuration.byDefault,dc);
    return;
  }
  supportedDriver.setSystemProperty(config,dc);
}
Program: 134436
Project: 134436
Buggy source:
/** 
 * Allows to instantiate the selected   {@link WebDriver} by given parameters.These parameters should correspond existing  {@link WebDriver} constructors
 * @param supporteddriver the selected {@link WebDriver} representation
 * @param values they are used to launch {@link WebDriver}
 */
public WebDriverEncapsulation(ESupportedDrivers supporteddriver,Object... values){
  try {
    Class<? extends WebDriver> driverClass=supporteddriver.getUsingWebDriverClass();
    Constructor<?> c=ExecutableUtil.getRelevantConstructor(driverClass,values);
    if (c == null) {
      throw new NoSuchMethodException(driverClass.getName() + "String_Node_Str" + "String_Node_Str"+ Arrays.asList(values).toString());
    }
    enclosedDriver=(RemoteWebDriver)context.getBean(MainBeanConfiguration.WEBDRIVER_BEAN,context,this,destroyableObjects,driverClass,c.getParameterTypes(),values);
    Log.message("String_Node_Str" + driverClass.getSimpleName());
    timeOut=getComponent(TimeOut.class);
    resetAccordingTo(configuration);
    this.instantiatedESupportedDriver=supporteddriver;
  }
 catch (  Exception e) {
    Log.error("String_Node_Str" + e.getMessage(),e);
    destroy();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Allows to instantiate the selected   {@link WebDriver} by given parameters.These parameters should correspond existing  {@link WebDriver} constructors
 * @param supporteddriver the selected {@link WebDriver} representation
 * @param values they are used to launch {@link WebDriver}
 */
public WebDriverEncapsulation(ESupportedDrivers supporteddriver,Object... values){
  try {
    Class<? extends WebDriver> driverClass=supporteddriver.getUsingWebDriverClass();
    enclosedDriver=(RemoteWebDriver)context.getBean(MainBeanConfiguration.WEBDRIVER_BEAN,context,this,destroyableObjects,driverClass,values);
    Log.message("String_Node_Str" + driverClass.getSimpleName());
    timeOut=getComponent(TimeOut.class);
    resetAccordingTo(configuration);
    this.instantiatedESupportedDriver=supporteddriver;
  }
 catch (  Exception e) {
    Log.error("String_Node_Str" + e.getMessage(),e);
    destroy();
    throw new RuntimeException(e);
  }
}
Program: 134437
Project: 134437
Buggy source:
/** 
 * Creates   {@link WebDriver} instance and makes it listenable.
 * @param context instantiated {@link AbstractApplicationContext} which is used by  {@link AspectWebDriverEventListener}
 * @param configurationWrapper something that wraps {@link Configuration}{@link AspectWebDriverEventListener} needs it
 * @param destroyable Something that implements {@link IDestroyable}
 * @param required Class of {@link WebDriver} implementor
 * @param paramClasses  Are constructor parameters
 * @param paramValues Are constructor parameter values
 * @return A listenable {@link WebDriver} instance
 */
@SuppressWarnings("String_Node_Str") @Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE) @Bean(name=WEBDRIVER_BEAN) public <T extends WebDriver>T getWebdriver(AbstractApplicationContext context,IConfigurationWrapper configurationWrapper,IDestroyable destroyable,Class<T> required,Class<?>[] paramClasses,Object[] paramValues){
  try {
    Constructor<?> c=required.getConstructor(paramClasses);
    T result=(T)c.newInstance(paramValues);
    return (T)populate(context,configurationWrapper,destroyable,result);
  }
 catch (  NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Creates   {@link WebDriver} instance and makes it listenable.
 * @param context instantiated {@link AbstractApplicationContext} which is used by  {@link AspectWebDriverEventListener}
 * @param configurationWrapper something that wraps {@link Configuration}{@link AspectWebDriverEventListener} needs it
 * @param destroyable Something that implements {@link IDestroyable}
 * @param required Class of {@link WebDriver} implementor
 * @param paramClasses  Are constructor parameters
 * @param paramValues Are constructor parameter values
 * @return A listenable {@link WebDriver} instance
 */
@SuppressWarnings("String_Node_Str") @Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE) @Bean(name=WEBDRIVER_BEAN) public <T extends WebDriver>T getWebdriver(AbstractApplicationContext context,IConfigurationWrapper configurationWrapper,IDestroyable destroyable,Class<T> required,Object[] paramValues){
  try {
    Constructor<?> c=ExecutableUtil.getRelevantConstructor(required,paramValues);
    if (c == null) {
      throw new NoSuchMethodException(required.getName() + "String_Node_Str" + "String_Node_Str"+ Arrays.asList(paramValues).toString());
    }
    T result=(T)c.newInstance(paramValues);
    return (T)populate(context,configurationWrapper,destroyable,result);
  }
 catch (  NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException(e);
  }
}
Program: 134439
Project: 134439
Buggy source:
private static By getChainedBy(FunctionalPart<?> parent,HowToGetByFrames path,By by){
  if (by == null) {
    return null;
  }
  if (path.getFramePath().size() > 0) {
    return by;
  }
  if (parent.rootElement == null) {
    return by;
  }
  LinkedList<By> previuosChain=new LinkedList<>();
  previuosChain.addFirst(by);
  FunctionalPart<?> previousParent=parent.parent;
  while (previousParent != null) {
    if (previousParent.pathStrategy.getFramePath().size() > 0)     break;
    if (previousParent.rootElement == null)     break;
    previuosChain.addFirst(parent.rootElement.getTheGivenByStrategy());
    previousParent=previousParent.parent;
  }
  return new ByChained(previuosChain.toArray(new By[]{}));
}

Fixed version (ground truth):
private static By getChainedBy(FunctionalPart<?> parent,HowToGetByFrames path,By by){
  if (path.getFramePath().size() > 0) {
    return by;
  }
  if (parent.rootElement == null) {
    return by;
  }
  LinkedList<By> previuosChain=new LinkedList<>();
  previuosChain.addFirst(by);
  FunctionalPart<?> previousParent=parent.parent;
  while (previousParent != null) {
    if (previousParent.pathStrategy.getFramePath().size() > 0)     break;
    if (previousParent.rootElement == null)     break;
    previuosChain.addFirst(parent.rootElement.getTheGivenByStrategy());
    previousParent=previousParent.parent;
  }
  if (previuosChain.size() == 0) {
    return by;
  }
  if (by != null) {
    previuosChain.addLast(by);
  }
  return new ByChained(previuosChain.toArray(new By[]{}));
}
Program: 134440
Project: 134440
Buggy source:
private Function<By,WebElement> getWaitForTheRootElementFunction(){
  WebDriver driver=functionalPart.getWrappedDriver();
  return input -> {
    try {
      return driver.findElement(by);
    }
 catch (    StaleElementReferenceException|NoSuchElementException ignored) {
      return null;
    }
  }
;
}

Fixed version (ground truth):
private Function<By,WebElement> getWaitForTheRootElementFunction(){
  return input -> {
    try {
      return functionalPart.getWrappedDriver().findElement(by);
    }
 catch (    StaleElementReferenceException|NoSuchElementException ignored) {
      return null;
    }
  }
;
}
Program: 134441
Project: 134441
Buggy source:
@Override public WebElement getWrappedElement(){
  return EnhancedProxyFactory.getProxy(RemoteWebElement.class,new Class[]{},new Object[]{},getRotElementMethodInterceptor());
}

Fixed version (ground truth):
@Override public WebElement getWrappedElement(){
  functionalPart.switchToMe();
  return EnhancedProxyFactory.getProxy(RemoteWebElement.class,new Class[]{},new Object[]{},getRotElementMethodInterceptor());
}
Program: 134442
Project: 134442
Buggy source:
private MethodInterceptor getRotElementMethodInterceptor(){
  WebDriver driver=functionalPart.getWrappedDriver();
  functionalPart.switchToMe();
  return (obj,method,args,proxy) -> {
    driver.manage().timeouts().implicitlyWait(0,TimeUnit.SECONDS);
    WebElement root=null;
    try {
      FluentWait<By> wait=new FluentWait<By>(by);
      wait.withTimeout(timeValue,timeUnit);
      root=wait.until(getWaitForTheRootElementFunction());
    }
 catch (    TimeoutException e) {
      throw new NoSuchElementException("String_Node_Str" + by.toString(),e);
    }
 finally {
      driver.manage().timeouts().implicitlyWait(timeValue,timeUnit);
    }
    return method.invoke(root,args);
  }
;
}

Fixed version (ground truth):
private MethodInterceptor getRotElementMethodInterceptor(){
  return (obj,method,args,proxy) -> {
    Timeouts t=functionalPart.getWrappedDriver().manage().timeouts();
    t.implicitlyWait(0,TimeUnit.SECONDS);
    WebElement root=null;
    try {
      FluentWait<By> wait=new FluentWait<By>(by);
      wait.withTimeout(timeValue,timeUnit);
      wait.pollingEvery(POLLING_EVERY,TimeUnit.MILLISECONDS);
      root=wait.until(getWaitForTheRootElementFunction());
    }
 catch (    TimeoutException e) {
      throw new NoSuchElementException("String_Node_Str" + by.toString(),e);
    }
 finally {
      t.implicitlyWait(timeValue,timeUnit);
    }
    return method.invoke(root,args);
  }
;
}
Program: 134443
Project: 134443
Buggy source:
/** 
 * This is the general constructor.
 * @param handle is the given browser window or mobile context which currently present
 */
protected ModelObject(S handle){
  this.handle=handle;
  driverEncapsulation=handle.driverEncapsulation;
  awaiting=new Awaiting(getWrappedDriver());
  logs=driverEncapsulation.getComponent(DriverLogs.class);
  IDefaultAnnotationReader idar=new IDefaultAnnotationReader(){
  }
;
  UsedImplicitExceptionHandlers[] annotations=idar.getAnnotations(UsedImplicitExceptionHandlers.class,this.getClass());
  if (annotations.length != 0) {
    UsedImplicitExceptionHandlers ueh=annotations[0];
    List<Class<? extends ModelObjectExceptionHandler>> throwableHandlers=Arrays.asList(ueh.areUsed());
    throwableHandlers.forEach((handler) -> {
      try {
        checkInExceptionHandler(handler.newInstance());
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * This is the general constructor.
 * @param handle is the given browser window or mobile context which currently present
 */
protected ModelObject(S handle){
  this.handle=handle;
  driverEncapsulation=handle.driverEncapsulation;
  awaiting=new Awaiting(driverEncapsulation.getWrappedDriver());
  logs=driverEncapsulation.getComponent(DriverLogs.class);
  IDefaultAnnotationReader idar=new IDefaultAnnotationReader(){
  }
;
  UsedImplicitExceptionHandlers[] annotations=idar.getAnnotations(UsedImplicitExceptionHandlers.class,this.getClass());
  if (annotations.length != 0) {
    UsedImplicitExceptionHandlers ueh=annotations[0];
    List<Class<? extends ModelObjectExceptionHandler>> throwableHandlers=Arrays.asList(ueh.areUsed());
    throwableHandlers.forEach((handler) -> {
      try {
        checkInExceptionHandler(handler.newInstance());
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
    }
);
  }
}
Program: 134444
Project: 134444
Buggy source:
/** 
 * This constructor should present when an instance of the class is going to be got from the given browser window or mobile context.<br/> <br/> The described piece of UI is inside frame (it is actual for browser and mobile hybrid apps). Path to desired frame is specified by  {@link HowToGetByFrames} instance. <br/><br/> There is known root  {@link WebElement} defined {@link By} locatorstrategy
 * @param handle is the given browser window or mobile context
 * @param path is a path to frame which is specified by {@link HowToGetByFrames}
 * @param by It is  {@link By} strategy which is used to get the rootelement
 * @see Application
 * @see IHowToGetHandle
 * @see HowToGetBrowserWindow
 * @see HowToGetMobileScreen
 * @see Handle
 * @see BrowserWindow
 * @see MobileScreen
 * @see HowToGetByFrames
 * @see By
 */
protected FunctionalPart(S handle,HowToGetByFrames path,By by){
  super(handle);
  this.pathStrategy=path;
  timeOut=getWebDriverEncapsulation().getTimeOut();
  long primaryTimeOut=timeOut.getImplicitlyWaitTimeOut();
  TimeUnit primaryTimeUnit=timeOut.getImplicitlyWaitTimeUnit();
  this.rootElement=new RootElement(this);
  this.rootElement.changeByStrategy(by);
  this.rootElement.setTimeValue(primaryTimeOut);
  this.rootElement.setTimeUnit(primaryTimeUnit);
  defaultFieldDecorator=new AppiumFieldDecorator(getCurrentSearcContext(),primaryTimeOut,primaryTimeUnit);
  ime=getComponent(Ime.class);
  scriptExecutor=getComponent(ScriptExecutor.class);
}

Fixed version (ground truth):
/** 
 * This constructor should present when an instance of the class is going to be got from the given browser window or mobile context.<br/> <br/> The described piece of UI is inside frame (it is actual for browser and mobile hybrid apps). Path to desired frame is specified by  {@link HowToGetByFrames} instance. <br/><br/> There is known root  {@link WebElement} defined {@link By} locatorstrategy
 * @param handle is the given browser window or mobile context
 * @param path is a path to frame which is specified by {@link HowToGetByFrames}
 * @param by It is  {@link By} strategy which is used to get the rootelement
 * @see Application
 * @see IHowToGetHandle
 * @see HowToGetBrowserWindow
 * @see HowToGetMobileScreen
 * @see Handle
 * @see BrowserWindow
 * @see MobileScreen
 * @see HowToGetByFrames
 * @see By
 */
protected FunctionalPart(S handle,HowToGetByFrames path,By by){
  super(handle);
  this.pathStrategy=path;
  timeOut=handle.driverEncapsulation.getTimeOut();
  long primaryTimeOut=timeOut.getImplicitlyWaitTimeOut();
  TimeUnit primaryTimeUnit=timeOut.getImplicitlyWaitTimeUnit();
  this.rootElement=new RootElement(this);
  this.rootElement.changeByStrategy(by);
  this.rootElement.setTimeValue(primaryTimeOut);
  this.rootElement.setTimeUnit(primaryTimeUnit);
  scriptExecutor=getComponent(ScriptExecutor.class);
  ime=getComponent(Ime.class);
  defaultFieldDecorator=new DefaultDecorator(getCurrentSearcContext(),this,primaryTimeOut,primaryTimeUnit);
  load();
}
Program: 134445
Project: 134445
Buggy source:
private static void resetTimeOut(FunctionalPart<?> funcPart,long timeOutValue,TimeUnit timeUnit){
  funcPart.getTimeOut().implicitlyWait(timeOutValue,timeUnit);
  funcPart.getDefaultFieldDecorator().resetImplicitlyWaitTimeOut(timeOutValue,timeUnit);
}

Fixed version (ground truth):
private static void resetTimeOut(FunctionalPart<?> funcPart,long timeOutValue,TimeUnit timeUnit){
  funcPart.getTimeOut().implicitlyWait(timeOutValue,timeUnit);
  if (funcPart.defaultFieldDecorator != null)   funcPart.defaultFieldDecorator.resetImplicitlyWaitTimeOut(timeOutValue,timeUnit);
}
Program: 134447
Project: 134447
Buggy source:
protected FakePageObject(S handle){
  super(handle);
  load();
}

Fixed version (ground truth):
protected FakePageObject(S handle){
  super(handle);
}
Program: 134448
Project: 134448
Buggy source:
private void test2(Google google){
  try {
    google.performSearch("String_Node_Str");
    Assert.assertNotSame(0,google.getLinkCount());
    google.close();
  }
  finally {
    google.quit();
  }
}

Fixed version (ground truth):
private void test2(Google google){
  try {
    google.close();
  }
  finally {
    google.quit();
  }
}
Program: 134449
Project: 134449
Buggy source:
private static <T extends Application<?,?>>T load(T instance,String urlToBeLoaded){
  instance.getWebDriverEncapsulation().getTo(urlToBeLoaded);
  return instance;
}

Fixed version (ground truth):
private static <T extends Application<?,?>>T load(T instance,String urlToBeLoaded){
  instance.getWebDriverEncapsulation().getWrappedDriver().navigate().to(urlToBeLoaded);
  return instance;
}
Program: 134450
Project: 134450
Buggy source:
@Override public abstract <T extends IDecomposable>T getPart(Class<T> partClass,FramePathStrategy pathStrategy);

Fixed version (ground truth):
@Override public abstract <T extends IDecomposable>T getPart(Class<T> partClass,HowToGetByFrames pathStrategy);
Program: 134451
Project: 134451
Buggy source:
protected BrowserApplication(SingleWindow window){
  super(window);
  cookies=driverEncapsulation.getComponent(Cookies.class);
}

Fixed version (ground truth):
protected BrowserApplication(BrowserWindow window){
  super(window);
  cookies=driverEncapsulation.getComponent(Cookies.class);
}
Program: 134452
Project: 134452
Buggy source:
@Override public void maximize(){
  ((SingleWindow)handle).maximize();
}

Fixed version (ground truth):
@Override public void maximize(){
  ((BrowserWindow)handle).maximize();
}
Program: 134453
Project: 134453
Buggy source:
@Override public Dimension getSize(){
  return ((SingleWindow)handle).getSize();
}

Fixed version (ground truth):
@Override public Dimension getSize(){
  return ((BrowserWindow)handle).getSize();
}
Program: 134454
Project: 134454
Buggy source:
protected BrowserPage(SingleWindow window,FramePathStrategy pathStrategy){
  super(window,pathStrategy);
}

Fixed version (ground truth):
protected BrowserPage(BrowserWindow window,HowToGetByFrames pathStrategy){
  super(window,pathStrategy);
}
Program: 134455
Project: 134455
Buggy source:
@Override public Point getPosition(){
  return ((SingleWindow)handle).getPosition();
}

Fixed version (ground truth):
@Override public Point getPosition(){
  return ((BrowserWindow)handle).getPosition();
}
Program: 134456
Project: 134456
Buggy source:
@Override public void setSize(Dimension size){
  ((SingleWindow)handle).setSize(size);
}

Fixed version (ground truth):
@Override public void setSize(Dimension size){
  ((BrowserWindow)handle).setSize(size);
}
Program: 134457
Project: 134457
Buggy source:
@Override public void forward(){
  ((SingleWindow)handle).forward();
}

Fixed version (ground truth):
@Override public void forward(){
  ((BrowserWindow)handle).forward();
}
Program: 134458
Project: 134458
Buggy source:
@Override public void back(){
  ((SingleWindow)handle).back();
}

Fixed version (ground truth):
@Override public void back(){
  ((BrowserWindow)handle).back();
}
Program: 134459
Project: 134459
Buggy source:
@Override public void refresh(){
  ((SingleWindow)handle).refresh();
}

Fixed version (ground truth):
@Override public void refresh(){
  ((BrowserWindow)handle).refresh();
}
Program: 134460
Project: 134460
Buggy source:
@Override public void to(URL url){
  ((SingleWindow)handle).to(url);
}

Fixed version (ground truth):
@Override public void to(URL url){
  ((BrowserWindow)handle).to(url);
}
Program: 134461
Project: 134461
Buggy source:
/** 
 * Closes browser window and destroys all page objects that are placed on it
 */
public void close() throws UnclosedWindowException, NoSuchWindowException, UnhandledAlertException, UnreachableBrowserException {
  try {
    ((SingleWindow)handle).close();
    destroy();
  }
 catch (  UnclosedWindowException e) {
    throw e;
  }
catch (  NoSuchWindowException e) {
    destroy();
    throw e;
  }
catch (  UnreachableBrowserException e) {
    destroy();
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Closes browser window and destroys all page objects that are placed on it
 */
public void close() throws UnclosedWindowException, NoSuchWindowException, UnhandledAlertException, UnreachableBrowserException {
  try {
    ((BrowserWindow)handle).close();
    destroy();
  }
 catch (  UnclosedWindowException e) {
    throw e;
  }
catch (  NoSuchWindowException e) {
    destroy();
    throw e;
  }
catch (  UnreachableBrowserException e) {
    destroy();
    throw e;
  }
}
Program: 134462
Project: 134462
Buggy source:
@Override public void setPosition(Point point){
  ((SingleWindow)handle).setPosition(point);
}

Fixed version (ground truth):
@Override public void setPosition(Point point){
  ((BrowserWindow)handle).setPosition(point);
}
Program: 134463
Project: 134463
Buggy source:
@Override public Alert getAlert() throws NoAlertPresentException {
  ContextTimeOuts timeOuts=getContextTimeOuts();
  return ComponentFactory.getComponent(AlertHandler.class,getWrappedDriver(),new Class[]{long.class},new Object[]{getTimeOut(timeOuts.getSecsForAwaitinAlertPresent(),defaultTime)});
}

Fixed version (ground truth):
@Override public Alert getAlert() throws NoAlertPresentException {
  ContextTimeOuts timeOuts=getContextTimeOuts();
  return getWebDriverEncapsulation().getComponent(AlertHandler.class,new Class[]{long.class},new Object[]{getTimeOut(timeOuts.getSecsForAwaitinAlertPresent(),defaultTime)});
}
Program: 134464
Project: 134464
Buggy source:
public ContextManager(WebDriverEncapsulation initialDriverEncapsulation){
  super(initialDriverEncapsulation);
  fluent=getWebDriverEncapsulation().getComponent(FluentContextConditions.class);
  contextTool=ComponentFactory.getComponent(ContextTool.class,getWrappedDriver());
}

Fixed version (ground truth):
public ContextManager(WebDriverEncapsulation initialDriverEncapsulation){
  super(initialDriverEncapsulation);
  fluent=getWebDriverEncapsulation().getComponent(FluentContextConditions.class);
  contextTool=getWebDriverEncapsulation().getComponent(ContextTool.class);
}
Program: 134465
Project: 134465
Buggy source:
@Override public synchronized Alert getAlert() throws NoAlertPresentException {
  WindowsTimeOuts timeOuts=getWindowTimeOuts();
  return ComponentFactory.getComponent(AlertHandler.class,getWrappedDriver(),new Class[]{long.class},new Object[]{getTimeOut(timeOuts.getSecsForAwaitinAlertPresent(),defaultTime)});
}

Fixed version (ground truth):
@Override public synchronized Alert getAlert() throws NoAlertPresentException {
  WindowsTimeOuts timeOuts=getWindowTimeOuts();
  return getWebDriverEncapsulation().getComponent(AlertHandler.class,new Class[]{long.class},new Object[]{getTimeOut(timeOuts.getSecsForAwaitinAlertPresent(),defaultTime)});
}
Program: 134466
Project: 134466
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridDataFactory.fillDefaults().grab(true,true).applyTo(content);
  GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
  super.createDialogArea(content);
  Composite appendix=new Composite(content,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
  layout.numColumns=2;
  appendix.setLayout(layout);
  appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  CLabel label=new CLabel(appendix,SWT.NONE);
  label.setText("String_Node_Str");
  prefix=new Text(appendix,SWT.BORDER);
  prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (null != obj) {
    prefix.setText(obj.getPrefix());
    ElementIndexInfo info=find(obj);
    if (null != info) {
      setSelection(new Object[]{info});
    }
  }
  return content;
}

Fixed version (ground truth):
/** 
 * Creates an area and a text field to enter prefix of the imported module into
 */
@Override protected Control createDialogArea(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridDataFactory.fillDefaults().grab(true,true).applyTo(content);
  GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
  super.createDialogArea(content);
  createPrefixArea(content);
  return content;
}
Program: 134467
Project: 134467
Buggy source:
public AddImportDialog(Shell parent,Module node,Import obj,IFile file){
  this(parent,node,file);
  this.obj=obj;
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link AddImportDialog}
 * @param parent the parent shell
 * @param module the edited {@link Module}
 * @param file file to get an {@link IProject} from; the existing modules are taken from thisproject
 */
public AddImportDialog(Shell parent,Module module,IFile file){
  super(parent,new ModuleLabelProvider());
  setAllowDuplicates(false);
  List<Import> imports=getImports(module);
  importPrefixes=getImportData(imports,ModelPackage.Literals.IMPORT__PREFIX);
  setElements(getModuleList(module,file,imports));
  setTitle("String_Node_Str");
  setImage(GraphitiUi.getImageService().getImageForId(YangDiagramImageProvider.DIAGRAM_TYPE_PROVIDER_ID,YangDiagramImageProvider.IMG_IMPORT_PROPOSAL));
}
Program: 134469
Project: 134469
Buggy source:
@Override public boolean consumes(ASTNode node){
  String thisModulePrefix=null;
  ASTNode thisModule=node.getModule();
  if (thisModule instanceof SubModule) {
    thisModulePrefix=null;
  }
 else {
    thisModulePrefix=((Module)thisModule).getPrefix().getValue();
  }
  if (node instanceof TypeReference) {
    String typeWholeName=((TypeReference)node).getName();
    String typePrefix=((TypeReference)node).getType().getPrefix();
    return !YangTypeUtil.isBuiltInType(typeWholeName) && !typePrefix.equals(thisModulePrefix);
  }
  if (node instanceof UsesNode) {
    String usesPrefix=((UsesNode)node).getGrouping().getPrefix();
    return !usesPrefix.equals(thisModulePrefix);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean consumes(ASTNode node){
  String thisModulePrefix=null;
  ASTNode thisModule=node.getModule();
  if (thisModule instanceof SubModule) {
    thisModulePrefix=null;
  }
 else {
    SimpleNode<String> prefixNode=((Module)thisModule).getPrefix();
    if (prefixNode != null) {
      thisModulePrefix=prefixNode.getValue();
    }
  }
  if (node instanceof TypeReference) {
    String typeWholeName=((TypeReference)node).getName();
    String typePrefix=((TypeReference)node).getType().getPrefix();
    return !YangTypeUtil.isBuiltInType(typeWholeName) && !typePrefix.equals(thisModulePrefix);
  }
  if (node instanceof UsesNode) {
    String usesPrefix=((UsesNode)node).getGrouping().getPrefix();
    if (usesPrefix != null) {
      return !usesPrefix.equals(thisModulePrefix);
    }
  }
  return false;
}
Program: 134470
Project: 134470
Buggy source:
private static FontData getDefaultFont(){
  FontData fontData=StringConverter.asFontData(Activator.getDefault().getPreferenceStore().getString(ModelEditorPreferences.DIAGRAM_EDITOR_FONT));
  if (fontData == null) {
    FontData fd=JFaceResources.getDefaultFont().getFontData()[0];
    if ("String_Node_Str".equals(fd.getName()) && fd.getHeight() == 11) {
      fd.setName("String_Node_Str");
    }
    return fd;
  }
  return fontData;
}

Fixed version (ground truth):
private static FontData getDefaultFont(){
  FontData fontData=null;
  try {
    fontData=StringConverter.asFontData(Activator.getDefault().getPreferenceStore().getString(ModelEditorPreferences.DIAGRAM_EDITOR_FONT));
  }
 catch (  DataFormatException e) {
  }
  if (fontData == null) {
    FontData fd=JFaceResources.getDefaultFont().getFontData()[0];
    if ("String_Node_Str".equals(fd.getName()) && fd.getHeight() == 11) {
      fd.setName("String_Node_Str");
    }
    return fd;
  }
  return fontData;
}
Program: 134471
Project: 134471
Buggy source:
@Override public void enterTypedef_stmt(Typedef_stmtContext ctx){
  TypeDefinition typeDefinition=new TypeDefinition(module);
  updateNamedNode(typeDefinition,ctx);
  module.getTypeDefinitions().add(typeDefinition);
  stack.push(typeDefinition);
}

Fixed version (ground truth):
@Override public void enterTypedef_stmt(Typedef_stmtContext ctx){
  ASTNode parent=stack.peek();
  TypeDefinition typeDefinition=new TypeDefinition(parent);
  updateNamedNode(typeDefinition,ctx);
  if (parent instanceof Module) {
    module.getTypeDefinitions().add(typeDefinition);
  }
  stack.push(typeDefinition);
}
Program: 134472
Project: 134472
Buggy source:
@Override public void enterBelongs_to_stmt(Belongs_to_stmtContext ctx){
  if (module instanceof SubModule) {
    String moduleName=stringFromNode(ctx);
    String prefix=null;
    for (int i=0; i < ctx.getChildCount(); ++i) {
      final ParseTree treeNode=ctx.getChild(i);
      if (treeNode instanceof Prefix_stmtContext) {
        prefix=stringFromNode(treeNode);
      }
    }
    ((SubModule)module).setParentModule(moduleName);
    ((SubModule)module).setParentPrefix(prefix);
  }
}

Fixed version (ground truth):
@Override public void enterBelongs_to_stmt(Belongs_to_stmtContext ctx){
  if (module instanceof SubModule) {
    String moduleName=stringFromNode(ctx);
    for (int i=0; i < ctx.getChildCount(); ++i) {
      final ParseTree treeNode=ctx.getChild(i);
      if (treeNode instanceof Prefix_stmtContext) {
        yangModelPrefix=stringFromNode(treeNode);
        SimpleNode<String> astNode=new SimpleNode<String>(module,((Prefix_stmtContext)treeNode).PREFIX_KEYWORD().getText(),yangModelPrefix);
        updateNodePosition(astNode,treeNode);
        module.setPrefix(astNode);
      }
    }
    ((SubModule)module).setParentModule(moduleName);
  }
}
Program: 134473
Project: 134473
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
  super.createDialogArea(content);
  Composite appendix=new Composite(content,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
  layout.numColumns=2;
  appendix.setLayout(layout);
  appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  CLabel label=new CLabel(appendix,SWT.NONE);
  label.setText("String_Node_Str");
  prefix=new Text(appendix,SWT.BORDER);
  prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (null != obj) {
    prefix.setText(obj.getPrefix());
    ElementIndexInfo info=find(obj);
    if (null != info) {
      setSelection(new Object[]{info});
    }
  }
  return content;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridDataFactory.fillDefaults().grab(true,true).applyTo(content);
  GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
  super.createDialogArea(content);
  Composite appendix=new Composite(content,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
  layout.numColumns=2;
  appendix.setLayout(layout);
  appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  CLabel label=new CLabel(appendix,SWT.NONE);
  label.setText("String_Node_Str");
  prefix=new Text(appendix,SWT.BORDER);
  prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  if (null != obj) {
    prefix.setText(obj.getPrefix());
    ElementIndexInfo info=find(obj);
    if (null != info) {
      setSelection(new Object[]{info});
    }
  }
  return content;
}
Program: 134474
Project: 134474
Buggy source:
public void dispose(){
  this.yangSourceEditor.removeReconcileHandler(this);
  DocumentUndoManagerRegistry.getDocumentUndoManager(yangSourceEditor.getDocument()).removeDocumentUndoListener(this);
}

Fixed version (ground truth):
public void dispose(){
  this.yangSourceEditor.removeReconcileHandler(this);
}
Program: 134475
Project: 134475
Buggy source:
private boolean processJavaDeltas(IJavaElementDelta[] affectedChildren){
  for (  IJavaElementDelta d : affectedChildren) {
    IJavaElement element=d.getElement();
    if (element instanceof IPackageFragmentRoot) {
      IClasspathEntry entry;
      try {
        entry=((IPackageFragmentRoot)element).getResolvedClasspathEntry();
        IPath path=entry.getPath();
        if (path != null && path.toFile().exists() && path.lastSegment().toLowerCase().endsWith("String_Node_Str")) {
switch (d.getKind()) {
case IJavaElementDelta.ADDED:
case IJavaElementDelta.CHANGED:
            this.manager.indexManager.addJarFile(element.getJavaProject().getProject(),path);
          break;
case IJavaElementDelta.REMOVED:
        this.manager.indexManager.indexAll(element.getJavaProject().getProject());
      return false;
  }
}
}
 catch (JavaModelException e) {
YangCorePlugin.log(e);
}
}
if (!processJavaDeltas(d.getAffectedChildren())) {
return false;
}
}
return true;
}

Fixed version (ground truth):
private boolean processJavaDeltas(IJavaElementDelta[] affectedChildren){
  for (  IJavaElementDelta d : affectedChildren) {
    IJavaElement element=d.getElement();
    if (element instanceof IPackageFragmentRoot) {
      IPath path=((IPackageFragmentRoot)element).getPath();
      if (path != null && path.toFile().exists() && path.lastSegment().toLowerCase().endsWith("String_Node_Str")) {
switch (d.getKind()) {
case IJavaElementDelta.ADDED:
case IJavaElementDelta.CHANGED:
          this.manager.indexManager.addJarFile(element.getJavaProject().getProject(),path);
        break;
case IJavaElementDelta.REMOVED:
      this.manager.indexManager.indexAll(element.getJavaProject().getProject());
    return false;
}
}
}
if (!processJavaDeltas(d.getAffectedChildren())) {
return false;
}
}
return true;
}
Program: 134476
Project: 134476
Buggy source:
@Override public String getName(){
  return entry;
}

Fixed version (ground truth):
@Override public String getName(){
  return new Path(entry).lastSegment();
}
Program: 134477
Project: 134477
Buggy source:
private Object resolveParent(IJarEntryResource parent,IPath path){
  if (path.segmentCount() > 0) {
    for (    IJarEntryResource element : parent.getChildren()) {
      if (path.segment(0).equals(element.getName())) {
        return resolveParent(element,path.removeFirstSegments(1));
      }
    }
  }
  return parent;
}

Fixed version (ground truth):
private Object resolveParent(IJarEntryResource parent,IPath path){
  if (path.segmentCount() > 0) {
    for (    IJarEntryResource element : parent.getChildren()) {
      if (path.segment(0).equals(element.getName())) {
        return resolveParent(element,path.removeFirstSegments(1));
      }
    }
  }
  return parent.getParent();
}
Program: 134478
Project: 134478
Buggy source:
private char[] getContent() throws YangModelException {
  try (JarFile file=new JarFile(getParent().getPath().toFile())){
    InputStreamReader in=new InputStreamReader(file.getInputStream(file.getEntry(path.toString())),"String_Node_Str");
    CharArrayWriter out=new CharArrayWriter();
    char[] buff=new char[1024];
    int len=0;
    while ((len=in.read(buff)) > 0) {
      out.write(buff,0,len);
    }
    return out.toCharArray();
  }
 catch (  IOException e) {
    throw new YangModelException(e,0);
  }
}

Fixed version (ground truth):
private char[] getContent() throws YangModelException {
  try (JarFile file=new JarFile(getParent().getPath().toFile())){
    ZipEntry entry=file.getEntry(path.toString());
    InputStreamReader in=new InputStreamReader(file.getInputStream(entry),"String_Node_Str");
    CharArrayWriter out=new CharArrayWriter();
    char[] buff=new char[1024];
    int len=0;
    while ((len=in.read(buff)) > 0) {
      out.write(buff,0,len);
    }
    return out.toCharArray();
  }
 catch (  IOException e) {
    throw new YangModelException(e,0);
  }
}
Program: 134479
Project: 134479
Buggy source:
@Override public Object getAdapter(Class key){
  if (projectionSupport != null) {
    Object adapter=projectionSupport.getAdapter(getSourceViewer(),key);
    if (adapter != null) {
      return adapter;
    }
  }
  return super.getAdapter(key);
}

Fixed version (ground truth):
@Override public Object getAdapter(@SuppressWarnings("String_Node_Str") Class key){
  if (projectionSupport != null) {
    Object adapter=projectionSupport.getAdapter(getSourceViewer(),key);
    if (adapter != null) {
      return adapter;
    }
  }
  return super.getAdapter(key);
}
Program: 134480
Project: 134480
Buggy source:
@Override public void projectionEnabled(){
  fFoldingStructureProvider=new YangFoldingStructureProvider(this);
  fFoldingStructureProvider.setDocument(getDocumentProvider().getDocument(getEditorInput()));
  Module module=YangParserUtil.parseYangFile(getDocumentProvider().getDocument(getEditorInput()).get().toCharArray());
  if (module != null)   fFoldingStructureProvider.updateFoldingRegions(module);
}

Fixed version (ground truth):
@Override public void projectionEnabled(){
  fFoldingStructureProvider=new YangFoldingStructureProvider(this);
  fFoldingStructureProvider.setDocument(getDocumentProvider().getDocument(getEditorInput()));
  Module module=YangParserUtil.parseYangFile(getDocumentProvider().getDocument(getEditorInput()).get().toCharArray());
  if (module != null) {
    fFoldingStructureProvider.updateFoldingRegions(module);
  }
}
Program: 134481
Project: 134481
Buggy source:
/** 
 * Returns whether <code>partType</code> is special, i.e. a YANG <code>String</code> or <code>Line End Comment</code> partition.
 * @param partType the partition type to check
 * @return <code>true</code> if <code>partType</code> is special, <code>false</code> otherwise
 */
private boolean isSpecialPartition(String partType){
  return partType == YangPartitionScanner.YANG_STRING;
}

Fixed version (ground truth):
/** 
 * Returns whether <code>partType</code> is special, i.e. a YANG <code>String</code> or <code>Line End Comment</code> partition.
 * @param partType the partition type to check
 * @return <code>true</code> if <code>partType</code> is special, <code>false</code> otherwise
 */
private boolean isSpecialPartition(String partType){
  return partType == YangPartitionScanner.YANG_STRING || partType == YangPartitionScanner.YANG_STRING_SQ;
}
Program: 134482
Project: 134482
Buggy source:
@Override public void projectionEnabled(){
  fFoldingStructureProvider=new YangFoldingStructureProvider(this);
  fFoldingStructureProvider.setDocument(getDocumentProvider().getDocument(getEditorInput()));
  Module module=YangParserUtil.parseYangFile(getDocumentProvider().getDocument(getEditorInput()).get().toCharArray());
  fFoldingStructureProvider.updateFoldingRegions(module);
}

Fixed version (ground truth):
@Override public void projectionEnabled(){
  fFoldingStructureProvider=new YangFoldingStructureProvider(this);
  fFoldingStructureProvider.setDocument(getDocumentProvider().getDocument(getEditorInput()));
  Module module=YangParserUtil.parseYangFile(getDocumentProvider().getDocument(getEditorInput()).get().toCharArray());
  if (module != null)   fFoldingStructureProvider.updateFoldingRegions(module);
}
Program: 134483
Project: 134483
Buggy source:
public void updateFoldingRegions(Module module){
  if (fFoldingStructureProvider != null) {
    fFoldingStructureProvider.updateFoldingRegions(module);
  }
}

Fixed version (ground truth):
public void updateFoldingRegions(Module module){
  if (fFoldingStructureProvider != null && module != null) {
    fFoldingStructureProvider.updateFoldingRegions(module);
  }
}
Program: 134484
Project: 134484
Buggy source:
public YangPartitionScanner(){
  List<IPredicateRule> rules=new ArrayList<IPredicateRule>();
  IToken comment=new Token(YANG_COMMENT);
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",comment,(char)0,true));
  rules.add(new EndOfLineRule("String_Node_Str",comment));
  IToken multiLineString=new Token(YANG_STRING);
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",multiLineString,'\\',true));
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",multiLineString,'\\',true));
  IPredicateRule[] result=new IPredicateRule[rules.size()];
  rules.toArray(result);
  setPredicateRules(result);
}

Fixed version (ground truth):
public YangPartitionScanner(){
  List<IPredicateRule> rules=new ArrayList<IPredicateRule>();
  IToken comment=new Token(YANG_COMMENT);
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",comment,(char)0,true));
  rules.add(new EndOfLineRule("String_Node_Str",comment));
  IToken multiLineString=new Token(YANG_STRING);
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",multiLineString,'\\',true));
  IToken multiLineString_sq=new Token(YANG_STRING_SQ);
  rules.add(new MultiLineRule("String_Node_Str","String_Node_Str",multiLineString_sq,'\\',true));
  IPredicateRule[] result=new IPredicateRule[rules.size()];
  rules.toArray(result);
  setPredicateRules(result);
}
Program: 134485
Project: 134485
Buggy source:
/** 
 * XXX dirty
 */
private String determineProposalScopeKeyword(IDocument doc,int offset){
  try {
    YangHeuristicScanner yangHeuristicScanner=new YangHeuristicScanner(doc);
    int blockStartPosition=yangHeuristicScanner.findOpeningPeer(offset,'{','}');
    int curPos=yangHeuristicScanner.findNonWhitespaceBackward(blockStartPosition - 1,YangHeuristicScanner.UNBOUND);
    int currentToken=yangHeuristicScanner.previousToken(curPos,YangHeuristicScanner.UNBOUND);
    int keywordEndPos=yangHeuristicScanner.getPosition();
    int keywordStartPos=keywordEndPos;
    if (currentToken == Symbols.TokenIDENT) {
      yangHeuristicScanner.previousToken(keywordEndPos,YangHeuristicScanner.UNBOUND);
      keywordStartPos=yangHeuristicScanner.getPosition();
    }
    String keyword=doc.get(keywordStartPos,keywordEndPos - keywordStartPos).trim();
    return keyword;
  }
 catch (  Exception e) {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * FIXME dirty and ugly
 */
private String determineProposalScopeKeyword(IDocument doc,int offset){
  try {
    YangHeuristicScanner yangHeuristicScanner=new YangHeuristicScanner(doc);
    int blockStartPosition=yangHeuristicScanner.findOpeningPeer(offset,'{','}');
    int curPos=yangHeuristicScanner.findNonWhitespaceBackward(blockStartPosition - 1,YangHeuristicScanner.UNBOUND);
    int currentToken=yangHeuristicScanner.previousToken(curPos,YangHeuristicScanner.UNBOUND);
    int keywordEndPos=yangHeuristicScanner.getPosition();
    int keywordStartPos=keywordEndPos;
    if (currentToken == Symbols.TokenIDENT) {
      yangHeuristicScanner.previousToken(keywordEndPos,YangHeuristicScanner.UNBOUND);
      keywordStartPos=yangHeuristicScanner.getPosition();
    }
    if (currentToken == Symbols.TokenKEYWORD) {
      keywordEndPos=curPos + 1;
    }
    String keyword=doc.get(keywordStartPos,keywordEndPos - keywordStartPos).trim();
    return keyword;
  }
 catch (  Exception e) {
    return "String_Node_Str";
  }
}
Program: 134486
Project: 134486
Buggy source:
@Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer){
  PresentationReconciler reconciler=new PresentationReconciler();
  reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
  DefaultDamagerRepairer dr=new DefaultDamagerRepairer(getYangScanner());
  reconciler.setDamager(dr,IDocument.DEFAULT_CONTENT_TYPE);
  reconciler.setRepairer(dr,IDocument.DEFAULT_CONTENT_TYPE);
  dr=new DefaultDamagerRepairer(getYangCommentScanner());
  reconciler.setDamager(dr,YangPartitionScanner.YANG_COMMENT);
  reconciler.setRepairer(dr,YangPartitionScanner.YANG_COMMENT);
  dr=new DefaultDamagerRepairer(getYangStringScanner());
  reconciler.setDamager(dr,YangPartitionScanner.YANG_STRING);
  reconciler.setRepairer(dr,YangPartitionScanner.YANG_STRING);
  return reconciler;
}

Fixed version (ground truth):
@Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer){
  PresentationReconciler reconciler=new PresentationReconciler();
  reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
  DefaultDamagerRepairer dr=new DefaultDamagerRepairer(getYangScanner());
  reconciler.setDamager(dr,IDocument.DEFAULT_CONTENT_TYPE);
  reconciler.setRepairer(dr,IDocument.DEFAULT_CONTENT_TYPE);
  dr=new DefaultDamagerRepairer(getYangCommentScanner());
  reconciler.setDamager(dr,YangPartitionScanner.YANG_COMMENT);
  reconciler.setRepairer(dr,YangPartitionScanner.YANG_COMMENT);
  dr=new DefaultDamagerRepairer(getYangStringScanner());
  reconciler.setDamager(dr,YangPartitionScanner.YANG_STRING);
  reconciler.setRepairer(dr,YangPartitionScanner.YANG_STRING);
  dr=new DefaultDamagerRepairer(getYangStringScanner());
  reconciler.setDamager(dr,YangPartitionScanner.YANG_STRING_SQ);
  reconciler.setRepairer(dr,YangPartitionScanner.YANG_STRING_SQ);
  return reconciler;
}
Program: 134487
Project: 134487
Buggy source:
@Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer){
  return new String[]{IDocument.DEFAULT_CONTENT_TYPE,YangPartitionScanner.YANG_COMMENT,YangPartitionScanner.YANG_STRING};
}

Fixed version (ground truth):
@Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer){
  return new String[]{IDocument.DEFAULT_CONTENT_TYPE,YangPartitionScanner.YANG_COMMENT,YangPartitionScanner.YANG_STRING,YangPartitionScanner.YANG_STRING_SQ};
}