nus-yam/ex-repair huggingface dataset:
Program: 69820
Project: 69820
Buggy source:
public void testCSSStyleClass() throws EngineException, IOException {
  HTMLRenderOption options=new HTMLRenderOption();
  options.setEmbeddable(true);
  options.setEnableInlineStyle(false);
  ByteArrayOutputStream output=new ByteArrayOutputStream();
  List instanceIDs=new ArrayList();
  options.setInstanceIDs(instanceIDs);
  options.setOutputStream(output);
  IRenderTask task=createRenderTask(designFile);
  task.setRenderOption(options);
  task.render();
  task.close();
  String content=new String(output.toByteArray());
  output.close();
  String regex="String_Node_Str";
  Matcher matcher=Pattern.compile(regex).matcher(content);
  assertEquals(true,matcher.find());
  regex="String_Node_Str";
  matcher=Pattern.compile(regex).matcher(content);
  assertEquals(true,matcher.find());
  regex="String_Node_Str";
  matcher=Pattern.compile(regex).matcher(content);
  assertEquals(false,matcher.find());
}

Fixed version (ground truth):
public void testCSSStyleClass() throws EngineException, IOException {
  HTMLRenderOption options=new HTMLRenderOption();
  options.setEmbeddable(true);
  options.setEnableInlineStyle(false);
  ByteArrayOutputStream output=new ByteArrayOutputStream();
  List instanceIDs=new ArrayList();
  options.setInstanceIDs(instanceIDs);
  options.setOutputStream(output);
  IRenderTask task=createRenderTask(designFile);
  task.setRenderOption(options);
  task.render();
  task.close();
  String content=new String(output.toByteArray());
  output.close();
  String regex="String_Node_Str";
  Matcher matcher=Pattern.compile(regex).matcher(content);
  assertEquals(true,matcher.find());
  regex="String_Node_Str";
  matcher=Pattern.compile(regex).matcher(content);
  assertEquals(false,matcher.find());
  regex="String_Node_Str";
  matcher=Pattern.compile(regex).matcher(content);
  assertEquals(false,matcher.find());
}
Program: 69821
Project: 69821
Buggy source:
public ApplicationClassLoader run(){
  return new ApplicationClassLoader(engine,getOnPreparedRunnable(),null);
}

Fixed version (ground truth):
public ApplicationClassLoader run(){
  return new ApplicationClassLoader(engine,getOnPreparedRunnable(),engine.getConfig().getAppContext());
}
Program: 69822
Project: 69822
Buggy source:
public ClassLoader getClassLoader(){
  if (applicationClassLoader != null) {
    return applicationClassLoader;
  }
synchronized (this) {
    if (applicationClassLoader == null) {
      applicationClassLoader=AccessController.doPrivileged(new PrivilegedAction<ApplicationClassLoader>(){
        public ApplicationClassLoader run(){
          return new ApplicationClassLoader(engine,getOnPreparedRunnable(),null);
        }
      }
);
    }
  }
  return applicationClassLoader;
}

Fixed version (ground truth):
public ClassLoader getClassLoader(){
  if (applicationClassLoader != null) {
    return applicationClassLoader;
  }
synchronized (this) {
    if (applicationClassLoader == null) {
      applicationClassLoader=AccessController.doPrivileged(new PrivilegedAction<ApplicationClassLoader>(){
        public ApplicationClassLoader run(){
          return new ApplicationClassLoader(engine,getOnPreparedRunnable(),engine.getConfig().getAppContext());
        }
      }
);
    }
  }
  return applicationClassLoader;
}
Program: 69823
Project: 69823
Buggy source:
/** 
 * create the class loader used by the design. the method should be synchronized as the class loader of a document may be used by multiple tasks.
 */
protected synchronized void createDesignClassLoader(){
  if (designClassLoader != null) {
    return;
  }
  ArrayList<URL> urls=new ArrayList<URL>();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY,executionContext.getAppContext());
      if (url != null) {
        urls.add(url);
      }
 else {
        if (executionContext != null) {
          executionContext.addException(new EngineException(MessageConstants.JAR_NOT_FOUND_ERROR,libPath));
        }
        logger.log(Level.SEVERE,"String_Node_Str" + libPath);
      }
    }
  }
  URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
  if (engine != null) {
    designClassLoader=new URLClassLoader(jarUrls,engine.getEngineClassLoader());
  }
 else {
    designClassLoader=new URLClassLoader(jarUrls);
  }
}

Fixed version (ground truth):
/** 
 * create the class loader used by the design. the method should be synchronized as the class loader of a document may be used by multiple tasks.
 */
protected synchronized void createDesignClassLoader(){
  if (designClassLoader != null) {
    return;
  }
  ArrayList<URL> urls=new ArrayList<URL>();
  if (runnable != null) {
    ModuleHandle module=(ModuleHandle)runnable.getDesignHandle();
    Iterator iter=module.scriptLibsIterator();
    while (iter.hasNext()) {
      ScriptLibHandle lib=(ScriptLibHandle)iter.next();
      String libPath=lib.getName();
      URL url=module.findResource(libPath,IResourceLocator.LIBRARY,appContext);
      if (url != null) {
        urls.add(url);
      }
 else {
        logger.log(Level.SEVERE,"String_Node_Str" + libPath);
      }
    }
  }
  URL[] jarUrls=(URL[])urls.toArray(new URL[]{});
  if (engine != null) {
    designClassLoader=new URLClassLoader(jarUrls,engine.getEngineClassLoader());
  }
 else {
    designClassLoader=new URLClassLoader(jarUrls);
  }
}
Program: 69824
Project: 69824
Buggy source:
public ApplicationClassLoader(ReportEngine engine,IReportRunnable reportRunnable,ExecutionContext executionContext){
  this.runnable=reportRunnable;
  this.engine=engine;
  this.executionContext=executionContext;
}

Fixed version (ground truth):
public ApplicationClassLoader(ReportEngine engine,IReportRunnable reportRunnable,Map<String,Object> appContext){
  this.runnable=reportRunnable;
  this.engine=engine;
  this.appContext=appContext;
}
Program: 69825
Project: 69825
Buggy source:
/** 
 * return application class loader. The application class loader is used to load the report item event handle and  java classes called in the javascript.
 * @return class loader
 */
public ClassLoader getApplicationClassLoader(){
  if (applicationClassLoader == null) {
    closeClassLoader=true;
    applicationClassLoader=new ApplicationClassLoader(engine,runnable,this);
    if (scriptContext != null) {
      scriptContext.setApplicationClassLoader(applicationClassLoader);
    }
  }
  return applicationClassLoader;
}

Fixed version (ground truth):
/** 
 * return application class loader. The application class loader is used to load the report item event handle and  java classes called in the javascript.
 * @return class loader
 */
public ClassLoader getApplicationClassLoader(){
  if (applicationClassLoader == null) {
    closeClassLoader=true;
    applicationClassLoader=new ApplicationClassLoader(engine,runnable,appContext);
    if (scriptContext != null) {
      scriptContext.setApplicationClassLoader(applicationClassLoader);
    }
  }
  return applicationClassLoader;
}
Program: 69826
Project: 69826
Buggy source:
/** 
 * Puts container's child areas into the visual (display) order and repositions them following that order horizontally.
 * @author Lina Kemmel
 */
private void reorderVisually(ContainerArea parent){
  int n=parent.getChildrenCount();
  if (n == 0)   return;
  int i=0;
  AbstractArea[] areas=new AbstractArea[n];
  byte[] levels=new byte[n];
  Iterator<?> iter=parent.getChildren();
  for (; i < n && iter.hasNext(); i++) {
    AbstractArea area=(AbstractArea)iter.next();
    areas[i]=area;
    if (area instanceof TextArea)     levels[i]=(byte)((TextArea)area).getRunLevel();
 else {
      levels[i]=baseLevel;
      if (area instanceof ContainerArea) {
        reorderVisually((ContainerArea)area);
      }
    }
  }
  if (n > 1) {
    int x=areas[0].getAllocatedX();
    Bidi.reorderVisually(levels,0,areas,0,n);
    for (i=0; i < n - 1; i++) {
      areas[i].setAllocatedPosition(x,areas[i].getAllocatedY());
      x+=areas[i].getAllocatedWidth();
    }
    areas[i].setAllocatedPosition(x,areas[i].getAllocatedY());
  }
}

Fixed version (ground truth):
/** 
 * Puts container's child areas into the visual (display) order and repositions them following that order horizontally.
 * @author Lina Kemmel
 */
private void reorderVisually(ContainerArea parent){
  int n=parent.getChildrenCount();
  if (n == 0)   return;
  int i=0;
  AbstractArea[] areas=new AbstractArea[n];
  byte[] levels=new byte[n];
  Iterator<?> iter=parent.getChildren();
  for (; i < n && iter.hasNext(); i++) {
    AbstractArea area=(AbstractArea)iter.next();
    areas[i]=area;
    if (area instanceof TextArea)     levels[i]=(byte)((TextArea)area).getRunLevel();
 else {
      levels[i]=baseLevel;
      if (area instanceof InlineStackingArea) {
        reorderVisually((ContainerArea)area);
      }
    }
  }
  if (n > 1) {
    int x=areas[0].getAllocatedX();
    Bidi.reorderVisually(levels,0,areas,0,n);
    for (i=0; i < n - 1; i++) {
      areas[i].setAllocatedPosition(x,areas[i].getAllocatedY());
      x+=areas[i].getAllocatedWidth();
    }
    areas[i].setAllocatedPosition(x,areas[i].getAllocatedY());
  }
}
Program: 69827
Project: 69827
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleClass the style name
 */
protected void setStyleName(String styleClass,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (!enableInlineStyle && styleClass != null && styleClass.length() > 0) {
    String[] strings=styleClass.split("String_Node_Str");
    for (    String string : strings) {
      string=string.trim();
      if (string.length() > 0) {
        if (classBuffer.length() > 0) {
          classBuffer.append(' ');
        }
        if (null != htmlIDNamespace) {
          classBuffer.append(htmlIDNamespace);
        }
        classBuffer.append(string);
      }
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (enableMetadata) {
    String metadataStyleClass=metadataEmitter.getMetadataStyleClass(content);
    if (null != metadataStyleClass) {
      classBuffer.append(metadataStyleClass);
    }
  }
  if (!enableInlineStyle && styleName != null && styleName.length() > 0) {
    if (outputtedStyles.contains(styleName)) {
      if (classBuffer.length() != 0) {
        classBuffer.append("String_Node_Str");
      }
      if (null != htmlIDNamespace) {
        classBuffer.append(htmlIDNamespace);
      }
      classBuffer.append(styleName);
    }
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 69829
Project: 69829
Buggy source:
/** 
 * Test get/setStyle methods set the style then get it to test if they work correctly
 */
public void testBaseStyle(){
  ((StyledElementDesign)element).setStyleClass("String_Node_Str");
  assertEquals("String_Node_Str",((StyledElementDesign)element).getStyleClass());
}

Fixed version (ground truth):
/** 
 * Test get/setStyle methods set the style then get it to test if they work correctly
 */
public void testBaseStyle(){
  ((StyledElementDesign)element).setStyleName("String_Node_Str");
  assertEquals("String_Node_Str",((StyledElementDesign)element).getStyleName());
}
Program: 69830
Project: 69830
Buggy source:
/** 
 * test if the shared style is same. Two element use the same shared style, so those two elements should have same style properties.
 */
public void testSharedStyle(){
  GridItemDesign grid=(GridItemDesign)report.getContent(0);
  IStyle style=grid.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  RowDesign row=grid.getRow(0);
  style=row.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  CellDesign cell=row.getCell(0);
  style=cell.getStyle();
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getFontSize(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  LabelItemDesign label=(LabelItemDesign)cell.getContent(0);
  assertTrue(label.getStyleClass() == null);
}

Fixed version (ground truth):
/** 
 * test if the shared style is same. Two element use the same shared style, so those two elements should have same style properties.
 */
public void testSharedStyle(){
  GridItemDesign grid=(GridItemDesign)report.getContent(0);
  IStyle style=report.findStyle(grid.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  RowDesign row=grid.getRow(0);
  style=report.findStyle(row.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  CellDesign cell=row.getCell(0);
  style=report.findStyle(cell.getStyleName());
  assertEquals(style.getColor(),"String_Node_Str");
  assertEquals(style.getFontSize(),"String_Node_Str");
  assertEquals(style.getBorderBottomStyle(),"String_Node_Str");
  LabelItemDesign label=(LabelItemDesign)cell.getContent(0);
  assertTrue(label.getStyleName() == null);
}
Program: 69831
Project: 69831
Buggy source:
protected void writeFields(DataOutputStream out) throws IOException {
  if (name != null) {
    IOUtil.writeShort(out,FIELD_NAME);
    IOUtil.writeString(out,name);
  }
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    x.writeObject(out);
  }
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    y.writeObject(out);
  }
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    width.writeObject(out);
  }
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    height.writeObject(out);
  }
  if (hyperlink != null) {
    IOUtil.writeShort(out,FIELD_HYPERLINK);
    ((ActionContent)hyperlink).writeObject(out);
  }
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (helpText != null) {
    IOUtil.writeShort(out,FIELD_HELPTEXT);
    IOUtil.writeString(out,helpText);
  }
  if (inlineStyle != null) {
    if (!inlineStyle.isEmpty()) {
      IOUtil.writeShort(out,FIELD_INLINESTYLE_VERSION_1);
      inlineStyle.write(out);
    }
  }
  if (classStyle != null && !classStyle.isEmpty()) {
    IOUtil.writeShort(out,FIELD_CLASS_STYLE);
    classStyle.write(out);
  }
  if (instanceId != null) {
    IOUtil.writeShort(out,FIELD_INSTANCE_ID);
    IOUtil.writeString(out,instanceId.toString());
  }
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeObject(out,toc);
  }
  if (acl != null) {
    IOUtil.writeShort(out,FIELD_ACL);
    IOUtil.writeObject(out,acl);
  }
}

Fixed version (ground truth):
protected void writeFields(DataOutputStream out) throws IOException {
  if (name != null) {
    IOUtil.writeShort(out,FIELD_NAME);
    IOUtil.writeString(out,name);
  }
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    x.writeObject(out);
  }
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    y.writeObject(out);
  }
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    width.writeObject(out);
  }
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    height.writeObject(out);
  }
  if (hyperlink != null) {
    IOUtil.writeShort(out,FIELD_HYPERLINK);
    ((ActionContent)hyperlink).writeObject(out);
  }
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (helpText != null) {
    IOUtil.writeShort(out,FIELD_HELPTEXT);
    IOUtil.writeString(out,helpText);
  }
  if (inlineStyle != null) {
    if (!inlineStyle.isEmpty()) {
      IOUtil.writeShort(out,FIELD_INLINESTYLE_VERSION_1);
      inlineStyle.write(out);
    }
  }
  if (instanceId != null) {
    IOUtil.writeShort(out,FIELD_INSTANCE_ID);
    IOUtil.writeString(out,instanceId.toString());
  }
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeObject(out,toc);
  }
  if (acl != null) {
    IOUtil.writeShort(out,FIELD_ACL);
    IOUtil.writeObject(out,acl);
  }
}
Program: 69832
Project: 69832
Buggy source:
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof StyledElementDesign) {
    return ((StyledElementDesign)generateBy).getStyleClass();
  }
  return null;
}

Fixed version (ground truth):
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof StyledElementDesign) {
    return ((StyledElementDesign)generateBy).getStyleName();
  }
  return null;
}
Program: 69833
Project: 69833
Buggy source:
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in,loader);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE_VERSION_0:
String styleCssText=IOUtil.readString(in);
if (styleCssText != null && styleCssText.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(styleCssText);
}
break;
case FIELD_INLINESTYLE_VERSION_1:
inlineStyle=readStyle(in);
break;
case FIELD_CLASS_STYLE:
classStyle=readStyle(in);
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in,loader);
break;
case FIELD_ACL:
acl=IOUtil.readString(in);
}
}

Fixed version (ground truth):
protected void readField(int version,int filedId,DataInputStream in,ClassLoader loader) throws IOException {
switch (filedId) {
case FIELD_NAME:
    name=IOUtil.readString(in);
  break;
case FIELD_X:
x=new DimensionType();
x.readObject(in);
break;
case FIELD_Y:
y=new DimensionType();
y.readObject(in);
break;
case FIELD_WIDTH:
width=new DimensionType();
width.readObject(in);
break;
case FIELD_HEIGHT:
height=new DimensionType();
height.readObject(in);
break;
case FIELD_HYPERLINK:
ActionContent action=new ActionContent();
action.readObject(in,loader);
hyperlink=action;
break;
case FIELD_BOOKMARK:
bookmark=IOUtil.readString(in);
break;
case FIELD_HELPTEXT:
helpText=IOUtil.readString(in);
break;
case FIELD_INLINESTYLE_VERSION_0:
String styleCssText=IOUtil.readString(in);
if (styleCssText != null && styleCssText.length() != 0) {
inlineStyle=new StyleDeclaration(cssEngine);
inlineStyle.setCssText(styleCssText);
}
break;
case FIELD_INLINESTYLE_VERSION_1:
IStyle style=new StyleDeclaration(cssEngine);
if (null != style) {
style.read(in);
if (!style.isEmpty()) {
inlineStyle=style;
}
}
break;
case FIELD_INSTANCE_ID:
String value=IOUtil.readString(in);
instanceId=InstanceID.parse(value);
break;
case FIELD_TOC:
toc=IOUtil.readObject(in,loader);
break;
case FIELD_ACL:
acl=IOUtil.readString(in);
}
}
Program: 69834
Project: 69834
Buggy source:
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    IStyle classStyle=getClassStyle();
    if (classStyle != null) {
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return new ContentStyle((AbstractStyle)style);
}

Fixed version (ground truth):
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    if (styleClass != null) {
      IStyle classStyle=report.findStyle(styleClass);
      style=new CompositeStyle(classStyle,inlineStyle);
    }
 else {
      style=inlineStyle;
    }
  }
  return new ContentStyle((AbstractStyle)style);
}
Program: 69835
Project: 69835
Buggy source:
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    IStyle classStyle=getClassStyle();
    style=new CompositeStyle(classStyle,inlineStyle);
  }
  return style;
}

Fixed version (ground truth):
public IStyle getStyle(){
  if (style == null) {
    if (inlineStyle == null) {
      inlineStyle=report.createStyle();
    }
    String styleClass=getStyleClass();
    IStyle classStyle=report.findStyle(styleClass);
    style=new CompositeStyle(classStyle,inlineStyle);
  }
  return style;
}
Program: 69836
Project: 69836
Buggy source:
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof ColumnDesign) {
    return ((ColumnDesign)generateBy).getStyleClass();
  }
  return null;
}

Fixed version (ground truth):
public String getStyleClass(){
  if (styleClass != null) {
    return styleClass;
  }
  if (generateBy instanceof ColumnDesign) {
    return ((ColumnDesign)generateBy).getStyleName();
  }
  return null;
}
Program: 69837
Project: 69837
Buggy source:
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  IStyle style=item.getStyle();
  if (style != null) {
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || (pageBreakBefore != null) && !pageBreakBefore.equals(IStyle.AUTO_VALUE)) {
      node.breakBefore=true;
      node.execute=true;
    }
    if (pageBreakAfter != null && !pageBreakAfter.equals(IStyle.AUTO_VALUE)) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
    if (item instanceof TableItemDesign) {
      node.executeAll=true;
    }
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}

Fixed version (ground truth):
protected void setupPageBreak(PolicyNode node){
  ReportItemDesign item=node.design;
  String styleClass=item.getStyleName();
  if (styleClass != null) {
    IStyle style=report.findStyle(styleClass);
    CSSValue masterPage=style.getProperty(IStyle.STYLE_MASTER_PAGE);
    CSSValue pageBreakBefore=style.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    CSSValue pageBreakAfter=style.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
    if (masterPage != null || (pageBreakBefore != null) && !pageBreakBefore.equals(IStyle.AUTO_VALUE)) {
      node.breakBefore=true;
      node.execute=true;
    }
    if (pageBreakAfter != null && !pageBreakAfter.equals(IStyle.AUTO_VALUE)) {
      node.breakAfter=true;
      node.execute=true;
    }
  }
  if (item.getJavaClass() != null || item.getOnCreate() != null || item.getOnPageBreak() != null) {
    node.breakBefore=true;
    node.breakAfter=true;
    node.execute=true;
    if (item instanceof TableItemDesign) {
      node.executeAll=true;
    }
  }
  if (node.breakBefore || node.breakAfter) {
    Iterator iter=rows.iterator();
    while (iter.hasNext()) {
      PolicyNode row=(PolicyNode)iter.next();
      row.executeAll=true;
    }
    return;
  }
  if (item.getHighlight() != null || item.getMap() != null) {
    node.execute=true;
  }
  if (item.getTOC() != null || item.getBookmark() != null || item.getAction() != null) {
    node.execute=true;
  }
  if (item.getQueries() != null) {
    node.execute=true;
  }
  if (item.getVisibility() != null) {
    node.execute=true;
  }
}
Program: 69839
Project: 69839
Buggy source:
/** 
 * @param type: a Data Engine data type
 * @return Data Engine data types compatible with <code>type</code>, including <code>type</code> itself
 * @throws exception if <code>DataType.ANY_TYPE</code>, <code>DataType.UNKNOWN_TYPE</code> or other unsupported int value is passed into
 */
public static int[] getCompatibleDataTypes(int type) throws AdapterException {
switch (type) {
case DataType.BOOLEAN_TYPE:
    return new int[]{DataType.BOOLEAN_TYPE};
case DataType.INTEGER_TYPE:
  return new int[]{DataType.INTEGER_TYPE};
case DataType.DOUBLE_TYPE:
return new int[]{DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.DECIMAL_TYPE:
return new int[]{DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.STRING_TYPE:
return new int[]{DataType.STRING_TYPE,DataType.BOOLEAN_TYPE,DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE,DataType.DATE_TYPE,DataType.BLOB_TYPE,DataType.BINARY_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.DATE_TYPE:
return new int[]{DataType.DATE_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.BLOB_TYPE:
return new int[]{DataType.BLOB_TYPE};
case DataType.BINARY_TYPE:
return new int[]{DataType.BINARY_TYPE};
case DataType.SQL_DATE_TYPE:
return new int[]{DataType.SQL_DATE_TYPE};
case DataType.SQL_TIME_TYPE:
return new int[]{DataType.SQL_TIME_TYPE};
default :
throw new AdapterException(ResourceConstants.INVALID_DATA_TYPE,type);
}
}

Fixed version (ground truth):
/** 
 * @param type: a Data Engine data type
 * @return Data Engine data types compatible with <code>type</code>, including <code>type</code> itself
 * @throws exception if <code>DataType.ANY_TYPE</code>, <code>DataType.UNKNOWN_TYPE</code> or other unsupported int value is passed into
 */
public static int[] getCompatibleDataTypes(int type) throws AdapterException {
switch (type) {
case DataType.BOOLEAN_TYPE:
    return new int[]{DataType.BOOLEAN_TYPE};
case DataType.INTEGER_TYPE:
  return new int[]{DataType.INTEGER_TYPE};
case DataType.DOUBLE_TYPE:
return new int[]{DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.DECIMAL_TYPE:
return new int[]{DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.STRING_TYPE:
return new int[]{DataType.STRING_TYPE,DataType.BOOLEAN_TYPE,DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE,DataType.DATE_TYPE,DataType.BLOB_TYPE,DataType.BINARY_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.DATE_TYPE:
return new int[]{DataType.DATE_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.BLOB_TYPE:
return new int[]{DataType.BLOB_TYPE};
case DataType.BINARY_TYPE:
return new int[]{DataType.BINARY_TYPE};
case DataType.SQL_DATE_TYPE:
return new int[]{DataType.SQL_DATE_TYPE,DataType.DATE_TYPE};
case DataType.SQL_TIME_TYPE:
return new int[]{DataType.SQL_TIME_TYPE};
default :
throw new AdapterException(ResourceConstants.INVALID_DATA_TYPE,type);
}
}
Program: 69841
Project: 69841
Buggy source:
/** 
 * The page variable is only supported in VERSION_6
 */
synchronized public Collection<PageVariable> getPageVariables() throws IOException {
  if (pageVariables == null) {
    pageVariables=new ArrayList<PageVariable>();
    if (version == VERSION_6) {
      indexStream.seek(8);
      long offset=indexStream.readLong();
      hintsStream.seek(offset);
      readPageVariables(new DataInputStream(hintsStream),pageVariables);
    }
  }
  return pageVariables;
}

Fixed version (ground truth):
/** 
 * The page variable is only supported in VERSION_6
 */
synchronized public Collection<PageVariable> getPageVariables() throws IOException {
  if (pageVariables == null) {
    pageVariables=new ArrayList<PageVariable>();
    if (version == VERSION_6) {
      indexStream.seek(8);
      long offset=indexStream.readLong();
      if (offset != -1) {
        hintsStream.seek(offset);
        readPageVariables(new DataInputStream(hintsStream),pageVariables);
      }
    }
  }
  return pageVariables;
}
Program: 69842
Project: 69842
Buggy source:
public PageHintWriterV4(IDocArchiveWriter writer) throws IOException {
  this.writer=writer;
  try {
    hintsStream=writer.createRandomAccessStream(ReportDocumentConstants.PAGEHINT_STREAM);
    hintsStream.writeInt(IPageHintWriter.VERSION);
    indexStream=writer.createRandomAccessStream(ReportDocumentConstants.PAGEHINT_INDEX_STREAM);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
}

Fixed version (ground truth):
public PageHintWriterV4(IDocArchiveWriter writer) throws IOException {
  this.writer=writer;
  try {
    hintsStream=writer.createRandomAccessStream(ReportDocumentConstants.PAGEHINT_STREAM);
    hintsStream.writeInt(IPageHintWriter.VERSION);
    indexStream=writer.createRandomAccessStream(ReportDocumentConstants.PAGEHINT_INDEX_STREAM);
    indexStream.writeLong(0);
    indexStream.writeLong(-1);
  }
 catch (  IOException ex) {
    close();
    throw ex;
  }
}
Program: 69843
Project: 69843
Buggy source:
public void testImageBasic(){
  ImageItemDesign image=(ImageItemDesign)report.getContent(0);
  assertEquals("String_Node_Str",image.getName());
  assertEquals(10,image.getHeight().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(12,image.getWidth().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(1,image.getX().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(2,image.getY().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals("String_Node_Str",image.getImageUri());
  assertEquals(ActionDesign.ACTION_HYPERLINK,image.getAction().getActionType());
  assertEquals("String_Node_Str",image.getAction().getHyperlink().getDesignValue());
  assertEquals("String_Node_Str",image.getAltText().getValue());
}

Fixed version (ground truth):
public void testImageBasic(){
  ImageItemDesign image=(ImageItemDesign)report.getContent(0);
  assertEquals("String_Node_Str",image.getName());
  assertEquals(10,image.getHeight().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(12,image.getWidth().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(1,image.getX().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(2,image.getY().getValue().getMeasure(),Double.MIN_VALUE);
  assertEquals(Expression.newExpression("String_Node_Str"),image.getImageUri());
  assertEquals(ActionDesign.ACTION_HYPERLINK,image.getAction().getActionType());
  assertEquals("String_Node_Str",image.getAction().getHyperlink().getDesignValue());
  assertEquals("String_Node_Str",image.getAltText().getValue());
}
Program: 69845
Project: 69845
Buggy source:
/** 
 * Test get/setImageUri methods set the image by a URI address then get the address and check the source type to test if they work correctly
 */
public void testUri(){
  ImageItemDesign image=new ImageItemDesign();
  image.setImageUri("String_Node_Str");
  assertEquals(image.getImageUri(),"String_Node_Str");
  assertEquals(image.getImageSource(),ImageItemDesign.IMAGE_URI);
}

Fixed version (ground truth):
/** 
 * Test get/setImageUri methods set the image by a URI address then get the address and check the source type to test if they work correctly
 */
public void testUri(){
  ImageItemDesign image=new ImageItemDesign();
  image.setImageUri(Expression.newConstant("String_Node_Str"));
  assertEquals(image.getImageUri().getValue(),"String_Node_Str");
  assertEquals(image.getImageSource(),ImageItemDesign.IMAGE_URI);
  image.setImageUri(Expression.newExpression("String_Node_Str"));
  assertEquals(image.getImageUri(),Expression.newExpression("String_Node_Str"));
  assertEquals(image.getImageSource(),ImageItemDesign.IMAGE_URI);
}
Program: 69846
Project: 69846
Buggy source:
public Object visitImageItem(ImageItemDesign image,Object value){
  IDataQueryDefinition query;
  if (image.useCachedResult()) {
    query=getRefenceQuery(image);
    if (query == null) {
      registerUnresolvedQueryReference(image);
      return null;
    }
  }
 else {
    query=createQuery(image,(IDataQueryDefinition)value);
  }
  if (query != value && query instanceof BaseQueryDefinition) {
    setUsesDetails((BaseQueryDefinition)query);
  }
  try {
    if (image.getImageSource() == ImageItemDesign.IMAGE_EXPRESSION) {
      String newImageExpression=transformExpression(image.getImageExpression(),query);
      String newImageFormat=transformExpression(image.getImageFormat(),query);
      image.setImageExpression(newImageExpression,newImageFormat);
    }
 else     if (image.getImageSource() == ImageItemDesign.IMAGE_URI) {
      String newImageUri=transformExpression(image.getImageUri(),query);
      image.setImageUri(newImageUri);
    }
 else     if (image.getImageSource() == ImageItemDesign.IMAGE_FILE) {
      String newImageUri=transformExpression(image.getImageUri(),query);
      image.setImageFile(newImageUri);
    }
    transformExpressions(image,query);
    return getResultQuery(query,value);
  }
 catch (  BirtException ex) {
    context.addException(image.getHandle(),ex);
    return null;
  }
}

Fixed version (ground truth):
public Object visitImageItem(ImageItemDesign image,Object value){
  IDataQueryDefinition query;
  if (image.useCachedResult()) {
    query=getRefenceQuery(image);
    if (query == null) {
      registerUnresolvedQueryReference(image);
      return null;
    }
  }
 else {
    query=createQuery(image,(IDataQueryDefinition)value);
  }
  if (query != value && query instanceof BaseQueryDefinition) {
    setUsesDetails((BaseQueryDefinition)query);
  }
  try {
    if (image.getImageSource() == ImageItemDesign.IMAGE_EXPRESSION) {
      String newImageExpression=transformExpression(image.getImageExpression(),query);
      String newImageFormat=transformExpression(image.getImageFormat(),query);
      image.setImageExpression(newImageExpression,newImageFormat);
    }
 else     if (image.getImageSource() == ImageItemDesign.IMAGE_URI) {
      Expression<String> newImageUri=transformExpression(image.getImageUri(),query);
      image.setImageUri(newImageUri);
    }
 else     if (image.getImageSource() == ImageItemDesign.IMAGE_FILE) {
      Expression<String> newImageUri=transformExpression(image.getImageUri(),query);
      image.setImageFile(newImageUri);
    }
    transformExpressions(image,query);
    return getResultQuery(query,value);
  }
 catch (  BirtException ex) {
    context.addException(image.getHandle(),ex);
    return null;
  }
}
Program: 69847
Project: 69847
Buggy source:
protected void handleURIImage(String uriExpr,IImageContent imageContent) throws BirtException {
}

Fixed version (ground truth):
protected void handleURIImage(Expression<String> uriExpr,IImageContent imageContent) throws BirtException {
}
Program: 69848
Project: 69848
Buggy source:
protected void handleFileExpressionImage(String fileExpr,IImageContent imageContent) throws BirtException {
  String imageFile="String_Node_Str";
  try {
    Object file=evaluate(fileExpr);
    if (file != null) {
      imageFile=file.toString();
    }
 else     if (fileExpr != null && fileExpr.length() > 0) {
      imageFile=fileExpr;
    }
    handleFileImage(imageFile,imageContent);
  }
 catch (  BirtException ex) {
    if (fileExpr != null && fileExpr.length() > 0) {
      handleFileImage(fileExpr,imageContent);
    }
    throw ex;
  }
}

Fixed version (ground truth):
protected void handleFileExpressionImage(Expression<String> fileExpr,IImageContent imageContent) throws BirtException {
  String imageFile="String_Node_Str";
  Object file=evaluate(fileExpr);
  if (file != null) {
    imageFile=file.toString();
  }
 else   if (fileExpr != null) {
    imageFile=fileExpr.getValue();
  }
  handleFileImage(imageFile,imageContent);
}
Program: 69849
Project: 69849
Buggy source:
protected void readImageField(DataInputStream in,ImageItemDesign image,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_IMAGE_SOURCE:
    int imageSource=IOUtil.readInt(in);
switch (imageSource) {
case ImageItemDesign.IMAGE_NAME:
    String imageName=IOUtil.readString(in);
  image.setImageName(imageName);
break;
case ImageItemDesign.IMAGE_FILE:
String imageFile=IOUtil.readString(in);
image.setImageFile(imageFile);
break;
case ImageItemDesign.IMAGE_URI:
String imageUri=IOUtil.readString(in);
image.setImageUri(imageUri);
break;
case ImageItemDesign.IMAGE_EXPRESSION:
String imageExpr=IOUtil.readString(in);
String imageFormat=IOUtil.readString(in);
image.setImageExpression(imageExpr,imageFormat);
break;
default :
throw new IOException("String_Node_Str" + imageSource);
}
break;
case FIELD_ALT_TEXT:
Expression<String> altTextKey=readStringConstant(in);
Expression<String> altText=readStringConstant(in);
image.setAltText(altTextKey,altText);
break;
case FIELD_HELP_TEXT:
Expression<String> helpTextKey=readStringConstant(in);
Expression<String> helpText=readStringConstant(in);
image.setHelpText(helpTextKey,helpText);
break;
case FIELD_FIT_TO_CONTAINER:
Boolean isFitToContainer=IOUtil.readBool(in);
image.setFitToContainer(isFitToContainer);
break;
default :
readReportItemField(in,image,fieldType);
}
}

Fixed version (ground truth):
protected void readImageField(DataInputStream in,ImageItemDesign image,short fieldType) throws IOException {
switch (fieldType) {
case FIELD_IMAGE_SOURCE:
    int imageSource=IOUtil.readInt(in);
switch (imageSource) {
case ImageItemDesign.IMAGE_NAME:
    String imageName=IOUtil.readString(in);
  image.setImageName(imageName);
break;
case ImageItemDesign.IMAGE_FILE:
Expression<String> imageFile=readStringExpression(in);
image.setImageFile(imageFile);
break;
case ImageItemDesign.IMAGE_URI:
Expression<String> imageUri=readStringExpression(in);
image.setImageUri(imageUri);
break;
case ImageItemDesign.IMAGE_EXPRESSION:
String imageExpr=IOUtil.readString(in);
String imageFormat=IOUtil.readString(in);
image.setImageExpression(imageExpr,imageFormat);
break;
default :
throw new IOException("String_Node_Str" + imageSource);
}
break;
case FIELD_ALT_TEXT:
Expression<String> altTextKey=readStringConstant(in);
Expression<String> altText=readStringConstant(in);
image.setAltText(altTextKey,altText);
break;
case FIELD_HELP_TEXT:
Expression<String> helpTextKey=readStringConstant(in);
Expression<String> helpText=readStringConstant(in);
image.setHelpText(helpTextKey,helpText);
break;
case FIELD_FIT_TO_CONTAINER:
Boolean isFitToContainer=IOUtil.readBool(in);
image.setFitToContainer(isFitToContainer);
break;
default :
readReportItemField(in,image,fieldType);
}
}
Program: 69851
Project: 69851
Buggy source:
/** 
 * @param imageUri The imageUri to set.
 */
public void setImageUri(String imageUri){
  this.imageSource=IMAGE_URI;
  this.imageUri=imageUri;
}

Fixed version (ground truth):
/** 
 * @param imageUri The imageUri to set.
 */
public void setImageUri(Expression<String> imageUri){
  this.imageSource=IMAGE_URI;
  this.imageUri=imageUri;
}
Program: 69852
Project: 69852
Buggy source:
public void setImageFile(String file){
  imageSource=IMAGE_FILE;
  imageUri=file;
}

Fixed version (ground truth):
public void setImageFile(Expression<String> file){
  imageSource=IMAGE_FILE;
  imageUri=file;
}
Program: 69853
Project: 69853
Buggy source:
/** 
 * @return Returns the imageUri.
 */
public String getImageUri(){
  return imageUri;
}

Fixed version (ground truth):
/** 
 * @return Returns the imageUri.
 */
public Expression<String> getImageUri(){
  return imageUri;
}
Program: 69854
Project: 69854
Buggy source:
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  rowFilledFlag=true;
  context.startCell();
  int columnId=cell.getColumn();
  List<SpanInfo> spans=context.getSpans(columnId);
  if (spans != null) {
    for (int i=0; i < spans.size(); i++) {
      wordWriter.writeSpanCell(spans.get(i));
    }
  }
  int columnSpan=cell.getColSpan();
  int rowSpan=cell.getRowSpan();
  int cellWidth=context.getCellWidth(columnId,columnSpan);
  IStyle style=computeStyle(cell.getComputedStyle());
  if (rowSpan > 1) {
    context.addSpan(columnId,columnSpan,cellWidth,rowSpan,style);
  }
  SpanInfo info=null;
  if (columnSpan > 1 || rowSpan > 1) {
    info=new SpanInfo(columnId,columnSpan,cellWidth,true,style);
  }
  wordWriter.startTableCell(cellWidth,style,info);
  context.addWidth(getCellWidth(cellWidth,style));
  writeTableToc();
  if (cell.getDiagonalNumber() != 0 && cell.getDiagonalStyle() != null && !"String_Node_Str".equalsIgnoreCase(cell.getDiagonalStyle())) {
    drawDiagonalLine(cell,WordUtil.twipToPt(cellWidth));
  }
}
Program: 69855
Project: 69855
Buggy source:
public static <Type>Expression<Type> newConstant(Type value){
  if (value == null) {
    return null;
  }
  return new Expression<Type>(value,(Class<Type>)value.getClass());
}

Fixed version (ground truth):
public static <Type>Expression<Type> newConstant(String value,Class<Type> type){
  if (value == null) {
    return null;
  }
  try {
    return new Expression<Type>(DataUtil.convertType(value,type),type);
  }
 catch (  BirtException e) {
    logger.log(Level.SEVERE,e.getLocalizedMessage(),e);
    return null;
  }
}
Program: 69856
Project: 69856
Buggy source:
protected String encodeText(String text){
  return XLSEncodeUtil.encodeText(text);
}

Fixed version (ground truth):
protected String encodeText(String text){
  return XLSEncodeUtil.encodeXLSText(text);
}
Program: 69857
Project: 69857
Buggy source:
public boolean isValidAggregationType(Series series,SeriesDefinition orthSD,SeriesDefinition baseSD){
  boolean isValidAgg=true;
  EList<Query> queries=series.getDataDefinition();
  for (  int i : validationIndex(series)) {
    if (!isValidAgg) {
      break;
    }
    Query query=queries.get(i);
    boolean checked=false;
    String id=ChartWizard.Gatt_aggCheck_ID + series.eContainer().hashCode() + series.getDataDefinition().indexOf(query);
    if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
      checked=true;
      isValidAgg=isValidAggregation(query.getGrouping(),false,id);
    }
    if (!checked && orthSD.getGrouping() != null && orthSD.getGrouping().isEnabled()) {
      checked=true;
      isValidAgg=isValidAggregation(orthSD.getGrouping(),false,id);
    }
    if (!checked) {
      if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
        isValidAgg=isValidAggregation(baseSD.getGrouping(),true,id);
      }
    }
  }
  return isValidAgg;
}

Fixed version (ground truth):
public boolean isValidAggregationType(Series series,SeriesDefinition orthSD,SeriesDefinition baseSD){
  boolean isValidAgg=true;
  EList<Query> queries=series.getDataDefinition();
  for (  int i : validationIndex(series)) {
    if (!isValidAgg) {
      break;
    }
    Query query=queries.get(i);
    boolean checked=false;
    String id=ChartWizard.Gatt_aggCheck_ID + series.eContainer().hashCode() + series.getDataDefinition().indexOf(query);
    ChartWizard.removeException(id);
    if (query.getGrouping() != null && query.getGrouping().isEnabled()) {
      checked=true;
      isValidAgg=isValidAggregation(query.getGrouping(),false,id);
    }
    if (!checked && orthSD.getGrouping() != null && orthSD.getGrouping().isEnabled()) {
      checked=true;
      isValidAgg=isValidAggregation(orthSD.getGrouping(),false,id);
    }
    if (!checked) {
      if (baseSD.getGrouping() != null && baseSD.getGrouping().isEnabled()) {
        isValidAgg=isValidAggregation(baseSD.getGrouping(),true,id);
      }
    }
  }
  return isValidAgg;
}
Program: 69858
Project: 69858
Buggy source:
/** 
 * Check if default aggregation and value series aggregation are valid for Gantt chart and show warning message in UI.
 * @param grouping
 * @param isCategoryGrouping
 * @param id error id for log
 * @return <code>true</code> if aggregation is valid.
 * @since 2.3
 */
private boolean isValidAggregation(SeriesGrouping grouping,boolean isCategoryGrouping,String id){
  ChartWizard.removeAllExceptions(id);
  if (grouping == null || !grouping.isEnabled()) {
    return true;
  }
  String aggName=grouping.getAggregateExpression();
  if (!("String_Node_Str".equalsIgnoreCase(aggName) || "String_Node_Str".equalsIgnoreCase(aggName) || "String_Node_Str".equalsIgnoreCase(aggName)|| "String_Node_Str".equalsIgnoreCase(aggName))) {
    String aggPlace="String_Node_Str";
    if (isCategoryGrouping) {
      aggPlace=Messages.getString("String_Node_Str");
    }
 else {
      aggPlace=Messages.getString("String_Node_Str");
    }
    ChartWizard.showException(id,Messages.getString("String_Node_Str") + aggName + Messages.getString("String_Node_Str")+ aggPlace+ Messages.getString("String_Node_Str"));
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check if default aggregation and value series aggregation are valid for Gantt chart and show warning message in UI.
 * @param grouping
 * @param isCategoryGrouping
 * @param id error id for log
 * @return <code>true</code> if aggregation is valid.
 * @since 2.3
 */
private boolean isValidAggregation(SeriesGrouping grouping,boolean isCategoryGrouping,String id){
  if (grouping == null || !grouping.isEnabled()) {
    return true;
  }
  String aggName=grouping.getAggregateExpression();
  if (!("String_Node_Str".equalsIgnoreCase(aggName) || "String_Node_Str".equalsIgnoreCase(aggName) || "String_Node_Str".equalsIgnoreCase(aggName)|| "String_Node_Str".equalsIgnoreCase(aggName))) {
    String aggPlace="String_Node_Str";
    if (isCategoryGrouping) {
      aggPlace=Messages.getString("String_Node_Str");
    }
 else {
      aggPlace=Messages.getString("String_Node_Str");
    }
    ChartWizard.showException(id,Messages.getString("String_Node_Str") + aggName + Messages.getString("String_Node_Str")+ aggPlace+ Messages.getString("String_Node_Str"));
    return false;
  }
  return true;
}