nus-yam/ex-repair huggingface dataset:
Program: 136693
Project: 136693
Buggy source:
public void controlResized(ControlEvent e){
  parent.getParent().layout(true);
  parent.layout(true);
}

Fixed version (ground truth):
@Override public void controlResized(ControlEvent e){
  parent.getParent().layout(true);
  parent.layout(true);
}
Program: 136694
Project: 136694
Buggy source:
/** 
 * Sets the session to use for executing queries
 * @param session The new Session
 */
public void setSession(Session session){
  if (session == this.session) {
    return;
  }
  if (getSession() != null && session != this.session) {
    this.session.close();
  }
  this.session=session;
  if (textEditor != null) {
    textEditor.onEditorSessionChanged(session);
  }
  if (toolBar != null) {
    toolBar.onEditorSessionChanged(session);
  }
}

Fixed version (ground truth):
/** 
 * Sets the session to use for executing queries
 * @param session The new Session
 */
@Override public void setSession(Session session){
  if (session == this.session) {
    return;
  }
  if (getSession() != null && session != this.session) {
    this.session.close();
  }
  this.session=session;
  if (textEditor != null) {
    textEditor.onEditorSessionChanged(session);
  }
  if (toolBar != null) {
    toolBar.onEditorSessionChanged(session);
  }
}
Program: 136695
Project: 136695
Buggy source:
/** 
 * Creates the sash (the draggable splitter) between the editor and the results tab
 * @param parent
 * @return
 */
private Sash createSash(Composite parent){
  final Sash sash=new Sash(parent,SWT.HORIZONTAL);
  sash.setBackground(SASH_COLOR);
  sash.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      widgetSelected(e);
    }
    public void widgetSelected(    SelectionEvent e){
      FormData data=(FormData)sash.getLayoutData();
      Rectangle rect=sash.getParent().getBounds();
      data.top=new FormAttachment(e.y,rect.height,0);
      sash.getParent().layout();
      sash.getParent().getParent().layout();
    }
  }
);
  return sash;
}

Fixed version (ground truth):
/** 
 * Creates the sash (the draggable splitter) between the editor and the results tab
 * @param parent
 * @return
 */
private Sash createSash(Composite parent){
  final Sash sash=new Sash(parent,SWT.HORIZONTAL);
  sash.setBackground(SASH_COLOR);
  sash.addSelectionListener(new SelectionListener(){
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      widgetSelected(e);
    }
    @Override public void widgetSelected(    SelectionEvent e){
      FormData data=(FormData)sash.getLayoutData();
      Rectangle rect=sash.getParent().getBounds();
      data.top=new FormAttachment(e.y,rect.height,0);
      sash.getParent().layout();
      sash.getParent().getParent().layout();
    }
  }
);
  return sash;
}
Program: 136696
Project: 136696
Buggy source:
/** 
 * Creates the toolbar
 * @param parent
 */
private void createToolbar(final Composite parent){
  toolBar=new SQLEditorToolBar(parent,this);
  toolBar.addResizeListener(new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      parent.getParent().layout(true);
      parent.layout(true);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates the toolbar
 * @param parent
 */
private void createToolbar(final Composite parent){
  toolBar=new SQLEditorToolBar(parent,this);
  toolBar.addResizeListener(new ControlListener(){
    @Override public void controlMoved(    ControlEvent e){
    }
    @Override public void controlResized(    ControlEvent e){
      parent.getParent().layout(true);
      parent.layout(true);
    }
  }
);
}
Program: 136698
Project: 136698
Buggy source:
public void propertyChanged(Object source,int propertyId){
  SQLEditor.this.firePropertyChange(propertyId);
}

Fixed version (ground truth):
@Override public void propertyChanged(Object source,int propertyId){
  SQLEditor.this.firePropertyChange(propertyId);
}
Program: 136699
Project: 136699
Buggy source:
@Override public void dispose(){
  setSession(null);
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  setSession(null);
  if (this.textEditor.getTitleImage() != null) {
    this.textEditor.getTitleImage().dispose();
  }
  super.dispose();
}
Program: 136700
Project: 136700
Buggy source:
/** 
 * @return the session
 */
public Session getSession(){
  if (session != null && session.getUser() == null) {
    session=null;
  }
  return session;
}

Fixed version (ground truth):
/** 
 * @return the session
 */
@Override public Session getSession(){
  if (session != null && session.getUser() == null) {
    session=null;
  }
  return session;
}
Program: 136701
Project: 136701
Buggy source:
public void run(){
  if (sqlTextViewer != null) {
    sqlTextViewer.setNewDictionary(dictionary);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (sqlTextViewer != null && !editor.getTitleImage().isDisposed()) {
    sqlTextViewer.setNewDictionary(dictionary);
  }
}
Program: 136702
Project: 136702
Buggy source:
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null) {
    editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
      public void run(){
        if (sqlTextViewer != null) {
          sqlTextViewer.setNewDictionary(dictionary);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null) {
    editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (sqlTextViewer != null && !editor.getTitleImage().isDisposed()) {
          sqlTextViewer.setNewDictionary(dictionary);
        }
      }
    }
);
  }
}
Program: 136703
Project: 136703
Buggy source:
public void verifyKey(VerifyEvent event){
  if (event.stateMask == SWT.CTRL && event.keyCode == 13) {
    event.doit=false;
    _execSQLAction.run();
  }
}

Fixed version (ground truth):
@Override public void verifyKey(VerifyEvent event){
  if (event.stateMask == SWT.CTRL && event.keyCode == 13) {
    event.doit=false;
    _execSQLAction.run();
  }
}
Program: 136705
Project: 136705
Buggy source:
public void dispose(){
}

Fixed version (ground truth):
public void dispose(){
  dispose(Display.getCurrent());
}
Program: 136706
Project: 136706
Buggy source:
/** 
 * make the original image name and overlay image name as a key, find the image from ImageLib.imageRegistry by this key. if not found,create a new Overlay image and put it into imageRegistry.
 * @param originalName
 * @param overImgName
 * @return
 */
public static ImageDescriptor getOverlayIcon(String originalName,String overImgName){
  String orininal_over_name=originalName + PluginConstant.UNDER_LINE + overImgName;
  if (imageRegistry == null) {
    initialize();
  }
  ImageDescriptor originalOverImg=imageRegistry.getDescriptor(orininal_over_name);
  if (originalOverImg == null) {
    ImageDescriptor orignalImg=getImageDescriptor(originalName);
    ImageDescriptor overImg=getImageDescriptor(overImgName);
    if (orignalImg != null && overImg != null) {
      originalOverImg=createIcon(orignalImg.createImage(),overImg);
      imageRegistry.put(orininal_over_name,originalOverImg);
    }
  }
  return originalOverImg;
}

Fixed version (ground truth):
/** 
 * make the original image name and overlay image name as a key, find the image from ImageLib.imageRegistry by this key. if not found,create a new Overlay image and put it's ImageDescriptor into imageRegistry.
 * @param originalName
 * @param overImgName
 * @return the image
 */
public static Image getOverlayIcon(String originalName,String overImgName){
  String orininal_over_name=originalName + PluginConstant.UNDER_LINE + overImgName;
  if (imageRegistry == null) {
    initialize();
  }
  Image originalOverImg=imageRegistry.get(orininal_over_name);
  if (originalOverImg == null) {
    ImageDescriptor orignalImg=getImageDescriptor(originalName);
    ImageDescriptor overImg=getImageDescriptor(overImgName);
    if (orignalImg != null && overImg != null) {
      ImageDescriptor originalOverImgDes=createIcon(orignalImg.createImage(),overImg);
      imageRegistry.put(orininal_over_name,originalOverImgDes);
      originalOverImg=imageRegistry.get(orininal_over_name);
    }
  }
  return originalOverImg;
}
Program: 136709
Project: 136709
Buggy source:
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter
 * @return
 */
public static String getClassName(String classPathParameter){
  return CustomAttributeMatcherClassNameConvert.getClassName(classPathParameter);
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter like "CustomMatcherTest.jar||MycustomMatch.jar||testCustomMatcher.myCustomMatcher" lastone is fully qualified name("testCustomMatcher" is package name and "myCustomMatcher" is class name).
 * @return the class name as the demo will return testCustomMatcher.myCustomMatcher
 */
public static String getClassName(String classPathParameter){
  return CustomAttributeMatcherClassNameConvert.getClassName(classPathParameter);
}
Program: 136710
Project: 136710
Buggy source:
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter
 * @return
 */
public static String getClassName(String classPathParameter){
  String[] allElements=classPathParameter.split(REGEXKEY);
  if (allElements.length > 0) {
    return allElements[allElements.length - 1];
  }
 else {
    return classPathParameter;
  }
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getClassName".
 * @param classPathParameter like "CustomMatcherTest.jar||MycustomMatch.jar||testCustomMatcher.myCustomMatcher" lastone is fully qualified name("testCustomMatcher" is package name and "myCustomMatcher" is class name).
 * @return the class name as the demo will return testCustomMatcher.myCustomMatcher
 */
public static String getClassName(String classPathParameter){
  String[] allElements=classPathParameter.split(REGEXKEY);
  if (allElements.length > 0) {
    return allElements[allElements.length - 1];
  }
 else {
    return classPathParameter;
  }
}
Program: 136711
Project: 136711
Buggy source:
/** 
 * DOC zshen Comment method "createMatchRuleBarChart".
 * @param title
 * @param dataset
 * @return
 */
public static JFreeChart createMatchRuleBarChart(String categoryAxisLabel,String valueAxisLabel,CategoryDataset dataset){
  ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
  JFreeChart localJFreeChart=ChartFactory.createBarChart(null,categoryAxisLabel,valueAxisLabel,dataset,PlotOrientation.VERTICAL,false,true,false);
  localJFreeChart.addSubtitle(new TextTitle(Messages.getString("String_Node_Str",sumItemCount(dataset),sumGroupCount(dataset))));
  CategoryPlot plot=(CategoryPlot)localJFreeChart.getPlot();
  BarRenderer barRenderer=new TalendBarRenderer(true,ChartDecorator.COLOR_LIST);
  barRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
  barRenderer.setBaseItemLabelsVisible(true);
  barRenderer.setShadowVisible(Boolean.FALSE);
  plot.setRenderer(barRenderer);
  CategoryAxis localCategoryAxis=plot.getDomainAxis();
  localCategoryAxis.setCategoryMargin(0.25D);
  localCategoryAxis.setUpperMargin(0.02D);
  localCategoryAxis.setLowerMargin(0.02D);
  NumberAxis localNumberAxis=(NumberAxis)plot.getRangeAxis();
  localNumberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  localNumberAxis.setUpperMargin(0.1D);
  return localJFreeChart;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "createMatchRuleBarChart".
 * @param title
 * @param dataset
 * @return
 */
public static JFreeChart createMatchRuleBarChart(String categoryAxisLabel,String valueAxisLabel,CategoryDataset dataset){
  ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
  JFreeChart localJFreeChart=ChartFactory.createBarChart(null,categoryAxisLabel,valueAxisLabel,dataset,PlotOrientation.VERTICAL,false,true,false);
  localJFreeChart.addSubtitle(new TextTitle(Messages.getString("String_Node_Str",sumItemCount(dataset),sumGroupCount(dataset))));
  CategoryPlot plot=(CategoryPlot)localJFreeChart.getPlot();
  List<Color> currentColorList=null;
  try {
    currentColorList=getCurrentColorList(dataset.getColumnKeys());
  }
 catch (  NumberFormatException e) {
    log.warn(e,e);
    currentColorList=ChartDecorator.COLOR_LIST;
  }
  BarRenderer barRenderer=new TalendBarRenderer(true,currentColorList);
  barRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
  barRenderer.setBaseItemLabelsVisible(true);
  barRenderer.setShadowVisible(Boolean.FALSE);
  plot.setRenderer(barRenderer);
  CategoryAxis localCategoryAxis=plot.getDomainAxis();
  localCategoryAxis.setCategoryMargin(0.25D);
  localCategoryAxis.setUpperMargin(0.02D);
  localCategoryAxis.setLowerMargin(0.02D);
  NumberAxis localNumberAxis=(NumberAxis)plot.getRangeAxis();
  localNumberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  localNumberAxis.setUpperMargin(0.1D);
  return localJFreeChart;
}
Program: 136712
Project: 136712
Buggy source:
@Override public org.eclipse.swt.graphics.Color getBackground(Object element,int columnIndex){
  int grpSizeValue=getGrpSize(((String[])element)[gidColumn]);
  return COLOR_LIST[groupSizeList.indexOf(grpSizeValue) % COLOR_LIST.length];
}

Fixed version (ground truth):
@Override public org.eclipse.swt.graphics.Color getBackground(Object element,int columnIndex){
  int grpSizeValue=getGrpSize(((String[])element)[gidColumn]);
  return COLOR_LIST[grpSizeValue % COLOR_LIST.length];
}
Program: 136713
Project: 136713
Buggy source:
@Test public void testDummyGood(){
  dv.parameters="String_Node_Str".split("String_Node_Str");
  String output=sdf.format(dv.generateMaskedRow(input));
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
public void testDummyGood() throws ParseException {
  dv.parameters="String_Node_Str".split("String_Node_Str");
  dv.parse("String_Node_Str",false,rand);
  for (int index=0; index < 20; index++) {
    String output=sdf.format(dv.generateMaskedRow(input));
    boolean result=checkResult(output,"String_Node_Str","String_Node_Str");
    Assert.assertTrue("String_Node_Str" + output,result);
  }
}
Program: 136714
Project: 136714
Buggy source:
@Test public void testBad(){
  dv.parameters="String_Node_Str".split("String_Node_Str");
  String output=sdf.format(dv.generateMaskedRow(input));
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBad() throws ParseException {
  dv.parameters="String_Node_Str".split("String_Node_Str");
  dv.parse("String_Node_Str",false,rand);
  for (int index=0; index < 20; index++) {
    String output=sdf.format(dv.generateMaskedRow(input));
    boolean result=checkResult(output,"String_Node_Str","String_Node_Str");
    Assert.assertTrue("String_Node_Str" + output,result);
  }
}
Program: 136715
Project: 136715
Buggy source:
@Before public void setUp() throws Exception {
  input=sdf.parse("String_Node_Str");
  dv.setRandomWrapper(new RandomWrapper(42));
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  input=sdf.parse("String_Node_Str");
  dv=new DateVariance();
}
Program: 136716
Project: 136716
Buggy source:
@Override public boolean prepare(){
  final TextParameters textParameter=this.getParameters() == null ? null : this.getParameters().getTextParameter();
  if (textParameter != null) {
    hasBeanCustomized=true;
    String replacementCharacters=textParameter.getReplacementCharacters();
    if (!StringUtils.isBlank(replacementCharacters)) {
      this.replacementChars=replacementCharacters;
    }
    String charactersToReplace=textParameter.getCharactersToReplace();
    if (!StringUtils.isBlank(charactersToReplace)) {
      this.charsToReplace=charactersToReplace;
    }
  }
  return super.prepare();
}

Fixed version (ground truth):
@Override public boolean prepare(){
  final TextParameters textParameter=this.getParameters() == null ? null : this.getParameters().getTextParameter();
  if (textParameter != null) {
    String replacementCharacters=textParameter.getReplacementCharacters();
    if (!StringUtils.isBlank(replacementCharacters)) {
      this.replacementChars=replacementCharacters;
      hasBeanCustomized=true;
    }
 else {
      replacementChars=REPLACEMENT_CHARS;
      hasBeanCustomized=false;
    }
    String charactersToReplace=textParameter.getCharactersToReplace();
    if (!StringUtils.isBlank(charactersToReplace)) {
      this.charsToReplace=charactersToReplace;
    }
 else {
      charsToReplace=CHARS_TO_REPLACE;
    }
  }
  return super.prepare();
}
Program: 136717
Project: 136717
Buggy source:
@Override public boolean prepare(){
  final TextParameters textParameter=this.getParameters() == null ? null : this.getParameters().getTextParameter();
  if (textParameter != null) {
    hasBeanCustomized=true;
    String replacementCharacters=textParameter.getReplacementCharacters();
    if (!StringUtils.isBlank(replacementCharacters)) {
      this.replacementChars=replacementCharacters;
    }
    String charactersToReplace=textParameter.getCharactersToReplace();
    if (!StringUtils.isBlank(charactersToReplace)) {
      this.charsToReplace=charactersToReplace;
    }
  }
  return super.prepare();
}

Fixed version (ground truth):
@Override public boolean prepare(){
  final TextParameters textParameter=this.getParameters() == null ? null : this.getParameters().getTextParameter();
  if (textParameter != null) {
    String replacementCharacters=textParameter.getReplacementCharacters();
    if (!StringUtils.isBlank(replacementCharacters)) {
      this.replacementChars=replacementCharacters;
      hasBeanCustomized=true;
    }
 else {
      replacementChars="String_Node_Str";
      hasBeanCustomized=false;
    }
    String charactersToReplace=textParameter.getCharactersToReplace();
    if (!StringUtils.isBlank(charactersToReplace)) {
      this.charsToReplace=charactersToReplace;
    }
 else {
      charsToReplace="String_Node_Str";
    }
  }
  return super.prepare();
}
Program: 136718
Project: 136718
Buggy source:
public Object[] getRecord(){
  Object[] oneRow=new Object[columnSize];
  for (int i=0; i < columnSize; i++) {
    oneRow[i]=csvReader.get(oldFullColumns.indexOf(columnIndexMap.get(i)));
  }
  return oneRow;
}

Fixed version (ground truth):
public Object[] getRecord(){
  Object[] oneRow=new Object[columnSize];
  try {
    for (int i=0; i < columnSize; i++) {
      String headerName=columnIndexMap.get(i);
      oneRow[i]=csvReader.get(headerName);
    }
  }
 catch (  IOException e) {
    log.error(e,e);
  }
  return oneRow;
}
Program: 136719
Project: 136719
Buggy source:
@Test public void testGetRecord() throws Exception {
  List<String> columnNames=new ArrayList<String>();
  fileDataSource=new FileSamplingDataSource(columnNames);
  DelimitedFileConnection createDelimitedFileConnection=ConnectionFactory.eINSTANCE.createDelimitedFileConnection();
  fileDataSource.setDataSource(createDelimitedFileConnection);
  int idx=0;
  while (fileDataSource.hasNext()) {
    String value=getString(fileDataSource.getRecord());
    System.out.println(value);
    if (0 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (1 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (5 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (9 == idx) {
      assertEquals("String_Node_Str",value);
    }
    idx++;
  }
}

Fixed version (ground truth):
@Test public void testGetRecord() throws Exception {
  fileDataSource=new FileSamplingDataSource();
  DelimitedFileConnection createDelimitedFileConnection=ConnectionFactory.eINSTANCE.createDelimitedFileConnection();
  fileDataSource.setDataSource(createDelimitedFileConnection);
  int idx=0;
  while (fileDataSource.hasNext()) {
    String value=getString(fileDataSource.getRecord());
    System.out.println(value);
    if (0 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (1 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (5 == idx) {
      assertEquals("String_Node_Str",value);
    }
 else     if (9 == idx) {
      assertEquals("String_Node_Str",value);
    }
    idx++;
  }
}
Program: 136723
Project: 136723
Buggy source:
public String getNameTextValue(){
  return nameText.getText();
}

Fixed version (ground truth):
public String getNameTextValue(){
  return nameText != null ? nameText.getText() : "String_Node_Str";
}
Program: 136728
Project: 136728
Buggy source:
/** 
 * Creates a single analyzer with provided   {@link Analyzer<?> analyzers}.
 * @param analyzers The analyzers to be combined together.
 * @return A single analyzer that ensure all underlying analyzers get called.
 */
public static Analyzer<Analyzers.Result> with(Analyzer<?>... analyzers){
  return new Analyzers(analyzers);
}

Fixed version (ground truth):
/** 
 * Creates a single analyzer with provided   {@link Analyzer analyzers}.
 * @param analyzers The analyzers to be combined together.
 * @return A single analyzer that ensure all underlying analyzers get called.
 */
public static Analyzer<Analyzers.Result> with(Analyzer<?>... analyzers){
  return new Analyzers(analyzers);
}
Program: 136729
Project: 136729
Buggy source:
@Override public void close() throws Exception {
}

Fixed version (ground truth):
@Override public void close() throws Exception {
  for (  Analyzer<?> analyzer : analyzers) {
    try {
      analyzer.close();
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str" + analyzer,e);
    }
  }
}
Program: 136730
Project: 136730
Buggy source:
@Override public void init(){
  Analyzer<T> analyzer=get();
  analyzer.init();
  returnObject(analyzer);
}

Fixed version (ground truth):
@Override public void init(){
  Analyzer<T> analyzer=pool.get();
  analyzer.init();
}
Program: 136731
Project: 136731
Buggy source:
@Override public boolean analyze(String... record){
  Analyzer<T> analyzer=get();
  boolean result=analyzer.analyze(record);
  returnObject(analyzer);
  return result;
}

Fixed version (ground truth):
@Override public boolean analyze(String... record){
  Analyzer<T> analyzer=pool.get();
  return analyzer.analyze(record);
}
Program: 136732
Project: 136732
Buggy source:
@Override public List<T> getResult(){
  Analyzer<T> analyzer=get();
  List<T> result=analyzer.getResult();
  returnObject(analyzer);
  return result;
}

Fixed version (ground truth):
@Override public List<T> getResult(){
  Analyzer<T> analyzer=pool.get();
  return analyzer.getResult();
}
Program: 136733
Project: 136733
Buggy source:
@Override public Analyzer<T> merge(Analyzer<T> another){
  Analyzer<T> analyzer=get();
  Analyzer<T> result=analyzer.merge(another);
  returnObject(analyzer);
  return result;
}

Fixed version (ground truth):
@Override public Analyzer<T> merge(Analyzer<T> another){
  Analyzer<T> analyzer=pool.get();
  return analyzer.merge(another);
}
Program: 136734
Project: 136734
Buggy source:
private ConcurrentAnalyzer(int maxSize,AnalyzerSupplier<Analyzer<T>> supplier){
  GenericKeyedObjectPool.Config config=new GenericKeyedObjectPool.Config();
  config.maxTotal=maxSize;
  config.maxActive=maxSize;
  config.maxIdle=maxSize;
  config.maxWait=3000;
  this.pool=new GenericKeyedObjectPool<>(new Factory<>(supplier),config);
}

Fixed version (ground truth):
private ConcurrentAnalyzer(int maxSize,AnalyzerSupplier<Analyzer<T>> supplier){
  GenericKeyedObjectPool.Config config=new GenericKeyedObjectPool.Config();
  config.maxTotal=maxSize;
  config.maxActive=maxSize;
  config.maxIdle=maxSize / 2;
  config.minIdle=maxSize / 2;
  config.maxWait=-1;
  final KeyedObjectPool<Thread,Analyzer<T>> pool=new GenericKeyedObjectPool<>(new Factory<>(supplier),config);
  this.pool=new ThreadLocal<Analyzer<T>>(){
    @Override protected Analyzer<T> initialValue(){
      try {
        return pool.borrowObject(Thread.currentThread());
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
    }
    @Override public void remove(){
      try {
        pool.returnObject(Thread.currentThread(),get());
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
 finally {
        super.remove();
      }
    }
  }
;
}
Program: 136735
Project: 136735
Buggy source:
@Override public void end(){
  Analyzer<T> analyzer=get();
  analyzer.end();
  returnObject(analyzer);
}

Fixed version (ground truth):
@Override public void end(){
  Analyzer<T> analyzer=pool.get();
  analyzer.end();
}
Program: 136736
Project: 136736
Buggy source:
@Override public void close() throws Exception {
  try {
    pool.clear(Thread.currentThread());
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void close() throws Exception {
  pool.remove();
}
Program: 136737
Project: 136737
Buggy source:
@Test public void testGood(){
  output=gffhi.generateMaskedRow(null).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  assertEquals(9,gffhi.generateMaskedRow(null).intValue());
}
Program: 136738
Project: 136738
Buggy source:
@Test public void testNull(){
  gffhi.keepNull=true;
  output=gffhi.generateMaskedRow(0).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testNull(){
  gffhi.keepNull=true;
  assertEquals(1,gffhi.generateMaskedRow(0).intValue());
  assertEquals(null,gffhi.generateMaskedRow(null));
}
Program: 136739
Project: 136739
Buggy source:
@Test public void testGood(){
  output=gffhl.generateMaskedRow(null).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  assertEquals(18,gffhl.generateMaskedRow(101L).longValue());
  assertEquals(9,gffhl.generateMaskedRow(null).longValue());
}
Program: 136740
Project: 136740
Buggy source:
@Test public void testBad(){
  gffhl.keepNull=true;
  output=gffhl.generateMaskedRow(0L).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBad(){
  gffhl.keepNull=true;
  assertEquals(null,gffhl.generateMaskedRow(null));
}
Program: 136741
Project: 136741
Buggy source:
@Test public void testGood(){
  output=gffhs.generateMaskedRow(null);
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  output=gffhs.generateMaskedRow(null);
  assertEquals("String_Node_Str",output);
}
Program: 136742
Project: 136742
Buggy source:
@Test public void testNull(){
  gffhs.keepNull=true;
  output=gffhs.generateMaskedRow(null);
  assertEquals(output,null);
}

Fixed version (ground truth):
@Test public void testNull(){
  gffhs.keepNull=true;
  output=gffhs.generateMaskedRow(null);
  assertEquals(null,output);
}
Program: 136743
Project: 136743
Buggy source:
@Test public void testGood(){
  gffi.parse(path,false,new RandomWrapper(42));
  output=gffi.generateMaskedRow(0).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  gffi.parse(path,false,new RandomWrapper(42));
  assertEquals(9,gffi.generateMaskedRow(0).intValue());
}
Program: 136744
Project: 136744
Buggy source:
@Test public void testNull(){
  gffi.parse(gffi.EMPTY_STRING,false,new RandomWrapper(42));
  output=gffi.generateMaskedRow(0).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testNull(){
  gffi.parse(gffi.EMPTY_STRING,false,new RandomWrapper(42));
  gffi.setKeepNull(true);
  assertEquals(0,gffi.generateMaskedRow(0).intValue());
  assertEquals(null,gffi.generateMaskedRow(null));
}
Program: 136745
Project: 136745
Buggy source:
@Test public void testGood(){
  gffl.parse(path,false,new RandomWrapper(42));
  output=gffl.generateMaskedRow(0L).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  gffl.parse(path,false,new RandomWrapper(42));
  assertEquals(9,gffl.generateMaskedRow(0L).longValue());
}
Program: 136746
Project: 136746
Buggy source:
@Test public void testNull(){
  gffl.parse(gffl.EMPTY_STRING,false,new RandomWrapper(42));
  output=gffl.generateMaskedRow(0L).toString();
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testNull(){
  gffl.parse(gffl.EMPTY_STRING,false,new RandomWrapper(42));
  gffl.setKeepNull(true);
  assertEquals(0,gffl.generateMaskedRow(0L).longValue());
  assertEquals(null,gffl.generateMaskedRow(null));
}
Program: 136747
Project: 136747
Buggy source:
@Test public void testGood(){
  output=gffs.generateMaskedRow(null);
  assertEquals(output,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGood(){
  output=gffs.generateMaskedRow(null);
  assertEquals("String_Node_Str",output);
}
Program: 136748
Project: 136748
Buggy source:
@Test public void testNull(){
  gffs.keepNull=true;
  output=gffs.generateMaskedRow(null);
  assertEquals(output,null);
}

Fixed version (ground truth):
@Test public void testNull(){
  gffs.keepNull=true;
  output=gffs.generateMaskedRow(null);
  assertEquals(null,output);
}
Program: 136749
Project: 136749
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  try {
    Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
    nodes=new ArrayList<IRepositoryNode>();
    if (object instanceof IRepositoryNode) {
      List<IRepositoryNode> list=((IStructuredSelection)event.getSelection()).toList();
      nodes.addAll(list);
      updateCompleteState();
    }
 else {
      setPageComplete(false);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  try {
    Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
    nodes=new ArrayList<IRepositoryNode>();
    if (object instanceof IRepositoryNode) {
      List<IRepositoryNode> list=((IStructuredSelection)event.getSelection()).toList();
      nodes.addAll(list);
      updateCompleteState();
      notifyObservers();
    }
 else {
      setPageComplete(false);
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
}
Program: 136750
Project: 136750
Buggy source:
@Override protected void addListeners(){
  addListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
      if (object instanceof DBCatalogRepNode) {
        advanceToNextPageOrFinish();
      }
    }
  }
);
  addListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      try {
        Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
        nodes=new ArrayList<IRepositoryNode>();
        if (object instanceof IRepositoryNode) {
          List<IRepositoryNode> list=((IStructuredSelection)event.getSelection()).toList();
          nodes.addAll(list);
          updateCompleteState();
        }
 else {
          setPageComplete(false);
        }
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addListeners(){
  addListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
      if (object instanceof DBCatalogRepNode) {
        advanceToNextPageOrFinish();
      }
    }
  }
);
  addListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      try {
        Object object=((IStructuredSelection)event.getSelection()).getFirstElement();
        nodes=new ArrayList<IRepositoryNode>();
        if (object instanceof IRepositoryNode) {
          List<IRepositoryNode> list=((IStructuredSelection)event.getSelection()).toList();
          nodes.addAll(list);
          updateCompleteState();
          notifyObservers();
        }
 else {
          setPageComplete(false);
        }
      }
 catch (      Exception e) {
        log.error(e,e);
      }
    }
  }
);
}
Program: 136752
Project: 136752
Buggy source:
/** 
 * DOC xqliu Comment method "buildGroupSizeArray".
 * @param groupSize2groupFrequency
 * @param minGroupSize
 */
private void initGroupSizeArray(TreeMap<Object,Long> groupSize2groupFrequency,int minGroupSize){
  groupSizeList.clear();
  for (  Object obj : groupSize2groupFrequency.keySet()) {
    int grpSize=Integer.valueOf(obj.toString());
    if (grpSize >= minGroupSize) {
      groupSizeList.add(grpSize);
    }
  }
  groupSizeList.sort(new Comparator<Integer>(){
    @Override public int compare(    Integer o1,    Integer o2){
      return o1 - o2;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "buildGroupSizeArray".
 * @param groupSize2groupFrequency
 * @param minGroupSize
 */
private void initGroupSizeArray(TreeMap<Object,Long> groupSize2groupFrequency,int minGroupSize){
  groupSizeList.clear();
  for (  Object obj : groupSize2groupFrequency.keySet()) {
    int grpSize=Integer.valueOf(obj.toString());
    if (grpSize >= minGroupSize) {
      groupSizeList.add(grpSize);
    }
  }
  Collections.sort(groupSizeList,new Comparator<Integer>(){
    @Override public int compare(    Integer o1,    Integer o2){
      return o1 - o2;
    }
  }
);
}
Program: 136753
Project: 136753
Buggy source:
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
    observer.update(observerEvent);
  }
}

Fixed version (ground truth):
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    if (currentColumn != null) {
      observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
      observer.update(observerEvent);
    }
  }
}
Program: 136754
Project: 136754
Buggy source:
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
    observer.update(observerEvent);
  }
}

Fixed version (ground truth):
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    if (currentColumn != null) {
      observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
      observer.update(observerEvent);
    }
  }
}
Program: 136755
Project: 136755
Buggy source:
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
    observer.update(observerEvent);
  }
}

Fixed version (ground truth):
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    if (currentColumn != null) {
      observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
      observer.update(observerEvent);
    }
  }
}
Program: 136756
Project: 136756
Buggy source:
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
    observer.update(observerEvent);
  }
}

Fixed version (ground truth):
@Override protected void notifyhandleColumnHighlight(MouseEvent e){
  if (observers == null) {
    return;
  }
  for (  TDQObserver<ObserverEvent> observer : observers) {
    ObserverEvent observerEvent=new ObserverEvent(ObserverEventEnum.ColumnHighlight);
    GridColumn currentColumn=this.getColumn(new Point(e.x,e.y));
    if (currentColumn != null) {
      observerEvent.putData(ObserverEvent.COLUMN_HIGH_LIGHT,this.indexOf(currentColumn));
      observer.update(observerEvent);
    }
  }
}
Program: 136757
Project: 136757
Buggy source:
/** 
 * Detect if the given value is a date type. <br> Date regex used to match: http://regexlib.com/REDetails.aspx?regexp_id=361 ,and regex matching yyy-MM-dd HH:mm:ss.SSS
 * @param value the value to be detected.
 * @return true if the value is a date type, false otherwise.
 */
public static boolean isDate(String value){
  if (value != null) {
    try {
      new DateTime(value);
      return true;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Detect if the given value is a date type. <br> Date regex used to match: http://regexlib.com/REDetails.aspx?regexp_id=361 ,and regex matching yyy-MM-dd HH:mm:ss.SSS
 * @param value the value to be detected.
 * @return true if the value is a date type, false otherwise.
 */
public static boolean isDate(String value){
  if (value != null) {
    try {
      if (patternDateA.matcher(value).find() || patternDateB.matcher(value).find()) {
        return true;
      }
      new DateTime(value);
      return true;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 136760
Project: 136760
Buggy source:
/** 
 * DOC talend Comment method "addVscrollBarListener".
 */
private void addVscrollBarListener(){
  getVerticalBar().addListener(SWT.Show,new Listener(){
    public void handleEvent(    Event event){
      fillWidth();
      if (getVerticalBar().isVisible()) {
        notifyVerticalBarShown(true);
      }
    }
  }
);
  getVerticalBar().addListener(SWT.Hide,new Listener(){
    public void handleEvent(    Event event){
      beginningWidth();
      if (!getVerticalBar().isVisible()) {
        notifyVerticalBarShown(false);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "addVscrollBarListener".
 */
protected void addVscrollBarListener(){
  getVerticalBar().addListener(SWT.Show,new Listener(){
    public void handleEvent(    Event event){
      fillWidth();
      if (getVerticalBar().isVisible()) {
        notifyVerticalBarShown(true);
      }
    }
  }
);
  getVerticalBar().addListener(SWT.Hide,new Listener(){
    public void handleEvent(    Event event){
      beginningWidth();
      if (!getVerticalBar().isVisible()) {
        notifyVerticalBarShown(false);
      }
    }
  }
);
}
Program: 136761
Project: 136761
Buggy source:
private boolean handleCellHighlight(MouseEvent e,GridVisibleRange range){
  Point cell=getCell(new Point(e.x,e.y));
  if (cell != null) {
    List<GridColumn> columnList=Arrays.asList(range.getColumns());
    cell.x=columnList.indexOf(getColumn(cell.x)) + 2;
    for (    GridItem item : range.getItems()) {
      int i=indexOf(item);
      if (i == cell.y) {
        item.setBackground(0,yellow);
        item.setBackground(1,lightYellow);
      }
 else {
        item.setBackground(0,gray);
        item.setBackground(1,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        if (item.getCheckable(1)) {
          item.setBackground(yellow);
        }
      }
      for (      GridColumn column : range.getColumns()) {
        int realIdx=columnList.indexOf(column) + 2;
        int j=indexOf(column);
        if (i == cell.y && realIdx == cell.x) {
          item.setBackground(j,yellow);
        }
 else         if (i == cell.y && realIdx < cell.x || realIdx == cell.x && i < cell.y) {
          item.setBackground(j,lightYellow);
        }
 else {
          item.setBackground(j,null);
        }
      }
    }
    for (    GridColumn column : range.getColumns()) {
      int realIdx=columnList.indexOf(column) + 2;
      column.getHeaderRenderer().setSelected(realIdx == cell.x);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean handleCellHighlight(MouseEvent e,GridVisibleRange range){
  Point cell=getCell(new Point(e.x,e.y));
  if (cell != null) {
    List<GridColumn> columnList=Arrays.asList(range.getColumns());
    cell.x=columnList.indexOf(getColumn(cell.x)) + 2;
    for (    GridItem item : range.getItems()) {
      int i=indexOf(item);
      if (i == cell.y) {
        item.setBackground(0,TalendColorPalette.PRIMARY_GREEN);
        item.setBackground(1,TalendColorPalette.PRIMARY_GREEN);
      }
 else {
        item.setBackground(0,gray);
        item.setBackground(1,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        if (item.getCheckable(1)) {
          item.setBackground(TalendColorPalette.PRIMARY_GREEN);
        }
      }
      for (      GridColumn column : range.getColumns()) {
        int realIdx=columnList.indexOf(column) + 2;
        int j=indexOf(column);
        if (i == cell.y && realIdx == cell.x) {
          item.setBackground(j,TalendColorPalette.PRIMARY_GREEN);
        }
 else         if (i == cell.y && realIdx < cell.x || realIdx == cell.x && i < cell.y) {
          item.setBackground(j,TalendColorPalette.PRIMARY_GREEN);
        }
 else {
          item.setBackground(j,null);
        }
      }
    }
    for (    GridColumn column : range.getColumns()) {
      int realIdx=columnList.indexOf(column) + 2;
      column.getHeaderRenderer().setSelected(realIdx == cell.x);
    }
    return true;
  }
  return false;
}
Program: 136763
Project: 136763
Buggy source:
private boolean handleRowHeaderHighlight(MouseEvent e,GridVisibleRange range){
  GridItem currentItem=getItem(new Point(e.x,e.y));
  if (currentItem != null) {
    if (overRowSelect(currentItem,new Point(e.x,e.y))) {
      for (      GridItem item : range.getItems()) {
        int i=indexOf(item);
        if (item.getCheckable(0)) {
          if (i == indexOf(currentItem)) {
            item.setBackground(0,yellow);
            item.setBackground(1,yellow);
          }
 else {
            item.setBackground(0,gray);
            item.setBackground(1,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
          }
        }
        for (        GridColumn column : range.getColumns()) {
          int j=indexOf(column);
          if (i == indexOf(currentItem)) {
            item.setBackground(j,lightYellow);
          }
 else {
            item.setBackground(j,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
          }
        }
      }
      for (      GridColumn column : range.getColumns()) {
        column.getHeaderRenderer().setSelected(false);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean handleRowHeaderHighlight(MouseEvent e,GridVisibleRange range){
  GridItem currentItem=getItem(new Point(e.x,e.y));
  if (currentItem != null) {
    if (overRowSelect(currentItem,new Point(e.x,e.y))) {
      for (      GridItem item : range.getItems()) {
        int i=indexOf(item);
        if (item.getCheckable(0)) {
          if (i == indexOf(currentItem)) {
            item.setBackground(0,TalendColorPalette.PRIMARY_GREEN);
            item.setBackground(1,TalendColorPalette.PRIMARY_GREEN);
          }
 else {
            item.setBackground(0,gray);
            item.setBackground(1,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
          }
        }
        for (        GridColumn column : range.getColumns()) {
          int j=indexOf(column);
          if (i == indexOf(currentItem)) {
            item.setBackground(j,TalendColorPalette.PRIMARY_GREEN);
          }
 else {
            item.setBackground(j,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
          }
        }
      }
      for (      GridColumn column : range.getColumns()) {
        column.getHeaderRenderer().setSelected(false);
      }
    }
    return true;
  }
  return false;
}
Program: 136764
Project: 136764
Buggy source:
private void onMouseMove(MouseEvent e){
  GridVisibleRange range=getVisibleRange();
  if (handleCellHighlight(e,range)) {
    return;
  }
  if (handleRowHeaderHighlight(e,range)) {
    return;
  }
  handleColumnHeaderHighlight(e,range);
}

Fixed version (ground truth):
private void onMouseMove(MouseEvent e){
  GridVisibleRange range=getVisibleRange();
  if (handleCellHighlight(e,range)) {
    notifyhandleColumnHighlight(e);
    return;
  }
  if (handleRowHeaderHighlight(e,range)) {
    return;
  }
  handleColumnHeaderHighlight(e,range);
  notifyhandleColumnHighlight(e);
}
Program: 136765
Project: 136765
Buggy source:
private void handleColumnHeaderHighlight(MouseEvent e,GridVisibleRange range){
  GridColumn currentColumn=getColumn(new Point(e.x,e.y));
  if (currentColumn != null && !isDraggingColumn()) {
    int currentColumnIndex=indexOf(currentColumn);
    for (    GridItem item : range.getItems()) {
      for (      GridColumn column : range.getColumns()) {
        int j=indexOf(column);
        if (j == currentColumnIndex) {
          item.setBackground(j,lightYellow);
        }
 else {
          item.setBackground(j,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        }
      }
      item.setBackground(0,gray);
      item.setBackground(1,null);
    }
    for (    GridColumn column : range.getColumns()) {
      int j=indexOf(column);
      column.getHeaderRenderer().setSelected(j == currentColumnIndex);
    }
  }
}

Fixed version (ground truth):
private void handleColumnHeaderHighlight(MouseEvent e,GridVisibleRange range){
  GridColumn currentColumn=getColumn(new Point(e.x,e.y));
  if (currentColumn != null && !isDraggingColumn()) {
    int currentColumnIndex=indexOf(currentColumn);
    for (    GridItem item : range.getItems()) {
      for (      GridColumn column : range.getColumns()) {
        int j=indexOf(column);
        if (j == currentColumnIndex) {
          item.setBackground(j,TalendColorPalette.PRIMARY_GREEN);
        }
 else {
          item.setBackground(j,getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        }
      }
      item.setBackground(0,gray);
      item.setBackground(1,null);
    }
    for (    GridColumn column : range.getColumns()) {
      int j=indexOf(column);
      column.getHeaderRenderer().setSelected(j == currentColumnIndex);
    }
  }
}