nus-yam/ex-repair huggingface dataset:
Program: 69196
Project: 69196
Buggy source:
/** 
 * @param parent
 * @param index
 */
private void createAggrListCell(final Composite parent,final int index){
  ControlProvider.createLabel(parent,dialogLabels[index]);
  cmbAggregation=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbAggregation.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  cmbAggregation.add(BLANK);
  cmbAggregation.setData(BLANK,new Integer(0));
  for (int i=0; i < functions.length; i++) {
    cmbAggregation.add(functions[i].getDisplayName());
    cmbAggregation.setData(functions[i].getName(),new Integer(i + 1));
  }
  String aggrFuncName=(String)getProperty(getStructureOrHandle(),cellProperties[index]);
  int selectionIndex=getAggrFuncIndex(aggrFuncName);
  cmbAggregation.select(selectionIndex);
  cmbAggregation.setToolTipText(selectionIndex > 0 ? functions[selectionIndex - 1].getDescription() : BLANK);
  cmbAggregation.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleAggrSelectEvent(true);
      validateSyntax();
      updateFilterUIStatus();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param index
 */
private void createAggrListCell(final Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbAggregation=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbAggregation.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  cmbAggregation.add(BLANK);
  cmbAggregation.setData(BLANK,new Integer(0));
  for (int i=0; i < functions.length; i++) {
    cmbAggregation.add(functions[i].getDisplayName());
    cmbAggregation.setData(functions[i].getName(),new Integer(i + 1));
  }
  String aggrFuncName=(String)getProperty(getStructureOrHandle(),cellProperties[index]);
  int selectionIndex=getAggrFuncIndex(aggrFuncName);
  cmbAggregation.select(selectionIndex);
  cmbAggregation.setToolTipText(selectionIndex > 0 ? functions[selectionIndex - 1].getDescription() : BLANK);
  cmbAggregation.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleAggrSelectEvent(true);
      validateSyntax();
      updateFilterUIStatus();
    }
  }
);
}
Program: 69198
Project: 69198
Buggy source:
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    ContentEmitterUtil.startContent(content,emitter);
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
 else   if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}

Fixed version (ground truth):
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    visible=true;
  }
  if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}
Program: 69199
Project: 69199
Buggy source:
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator,visible);
setup(pageNode,isFirst);
currentNode=pageNode;
break;
case IContent.TABLE_CONTENT:
tableIds.add(content.getInstanceID().toUniqueString());
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator,visible);
setup(node,isFirst);
currentNode=node;
break;
}
}

Fixed version (ground truth):
public void startContainer(IContent content,boolean isFirst,IContentEmitter emitter,boolean visible) throws BirtException {
  int type=content.getContentType();
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    visible=true;
  }
switch (type) {
case IContent.TABLE_BAND_CONTENT:
case IContent.LIST_BAND_CONTENT:
    boolean first=isFirst && !isRepeated;
  ContainerBufferNode bandNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(bandNode,first);
currentNode=bandNode;
break;
case IContent.CELL_CONTENT:
ContainerBufferNode cellNode=new ContainerBufferNode(content,emitter,generator,visible);
setup(cellNode,isFirst);
if (currentNode.isStarted()) {
cellNode.start();
}
currentNode=cellNode;
break;
case IContent.PAGE_CONTENT:
PageNode pageNode=new PageNode(content,emitter,generator,visible);
setup(pageNode,isFirst);
currentNode=pageNode;
break;
case IContent.TABLE_CONTENT:
tableIds.add(content.getInstanceID().toUniqueString());
default :
ContainerBufferNode node=new ContainerBufferNode(content,emitter,generator,visible);
setup(node,isFirst);
currentNode=node;
break;
}
}
Program: 69200
Project: 69200
Buggy source:
public void setPattern(String patternStr){
  String patt=valPattern(patternStr);
  this.useSep=patt.indexOf("String_Node_Str") != -1;
  this.useSpace=patt.indexOf("String_Node_Str") != -1;
  this.useBracket=patt.indexOf("String_Node_Str") != -1 && patt.indexOf("String_Node_Str") != -1;
  if (patt.indexOf("String_Node_Str") != -1) {
    this.decPlaces=patt.lastIndexOf("String_Node_Str") - patt.lastIndexOf("String_Node_Str");
  }
  for (int i=0; i < symbols.length; i++) {
    String sTemp=symbols[i];
    int sPos=patt.indexOf(sTemp);
    if (sPos != -1) {
      this.symbol=sTemp;
      if (sPos == 0) {
        this.symPos=FormatNumberPattern.SYMBOL_POSITION_BEFORE;
      }
 else {
        this.symPos=FormatNumberPattern.SYMBOL_POSITION_AFTER;
      }
      break;
    }
  }
  return;
}

Fixed version (ground truth):
public void setPattern(String patternStr){
  String patt=valPattern(patternStr);
  this.useSep=patt.indexOf("String_Node_Str") != -1;
  this.useSpace=patt.indexOf("String_Node_Str") != -1;
  this.useBracket=patt.indexOf("String_Node_Str") != -1 && patt.indexOf("String_Node_Str") != -1;
  this.decPlaces=0;
  if (patt.indexOf("String_Node_Str") != -1) {
    this.decPlaces=patt.lastIndexOf("String_Node_Str") - patt.lastIndexOf("String_Node_Str");
  }
  this.symbol="String_Node_Str";
  this.symPos="String_Node_Str";
  for (int i=0; i < BUILT_IN_SYMBOLS.length; i++) {
    String sTemp=BUILT_IN_SYMBOLS[i];
    int sPos=patt.indexOf(sTemp);
    if (sPos != -1) {
      this.symbol=sTemp;
      if (sPos == 0) {
        this.symPos=FormatNumberPattern.SYMBOL_POSITION_BEFORE;
      }
 else {
        this.symPos=FormatNumberPattern.SYMBOL_POSITION_AFTER;
      }
      break;
    }
  }
  if (this.symbol.length() == 0) {
  }
  return;
}
Program: 69201
Project: 69201
Buggy source:
public static String[] getCustormPatternCategorys(){
  return customFormatMap.keySet().toArray(new String[0]);
}

Fixed version (ground truth):
public static String[] getCustormPatternCategorys(){
  return customCategories;
}
Program: 69202
Project: 69202
Buggy source:
public static String getCustormFormatPattern(String custormCategory){
  return customFormatMap.get(custormCategory) == null ? "String_Node_Str" : customFormatMap.get(custormCategory).toString();
}

Fixed version (ground truth):
public static String getCustormFormatPattern(String custormCategory,ULocale locale){
  if (locale == null) {
    locale=ULocale.getDefault();
  }
  if (DATETIEM_FORMAT_TYPE_GENERAL_TIME.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_GENERAL_TIME,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_YEAR.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_YEAR,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_SHORT_YEAR.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_SHORT_YEAR,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_LONG_MONTH_YEAR.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_LONG_MONTH_YEAR,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_SHOT_MONTH_YEAR.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_SHOT_MONTH_YEAR,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_MONTH.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_MONTH,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_LONG_DAY_OF_WEEK.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_LONG_DAY_OF_WEEK,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_DAY_OF_MONTH.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_DAY_OF_MONTH,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_MEDIUM_DAY_OF_YEAR.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_MEDIUM_DAY_OF_YEAR,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_MINUTES.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_MINUTES,locale.toLocale());
  }
  if (DATETIEM_FORMAT_TYPE_SECONTDS.equals(custormCategory)) {
    return Messages.getString("String_Node_Str" + DATETIEM_FORMAT_TYPE_SECONTDS,locale.toLocale());
  }
  return "String_Node_Str";
}
Program: 69203
Project: 69203
Buggy source:
/** 
 * Adapts the specified Model Data Set to a Data Engine API data set design object
 */
public IBaseDataSetDesign appendRuntimeInfoToDataSet(DataSetHandle handle,BaseDataSetDesign dataSet) throws BirtException {
  if (dataSet instanceof OdaDataSetDesign)   return newOdaDataSet((OdaDataSetHandle)handle,(OdaDataSetDesign)dataSet,context);
  if (dataSet instanceof ScriptDataSetDesign)   return newScriptDataSet((ScriptDataSetHandle)handle,(ScriptDataSetDesign)dataSet,context);
  if (dataSet instanceof JointDataSetDesign)   return newJointDataSet((JointDataSetHandle)handle,(JointDataSetDesign)dataSet);
  return dteSession.getModelAdaptor().adaptDataSet(handle);
}

Fixed version (ground truth):
/** 
 * Adapts the specified Model Data Set to a Data Engine API data set design object
 */
public IBaseDataSetDesign appendRuntimeInfoToDataSet(DataSetHandle handle,BaseDataSetDesign dataSet) throws BirtException {
  if (dataSet instanceof OdaDataSetDesign)   return newOdaDataSet((OdaDataSetHandle)handle,(OdaDataSetDesign)dataSet,context);
  if (dataSet instanceof ScriptDataSetDesign)   return newScriptDataSet((ScriptDataSetHandle)handle,(ScriptDataSetDesign)dataSet,context);
  if (dataSet instanceof JointDataSetDesign)   return newJointDataSet((JointDataSetHandle)handle,(JointDataSetDesign)dataSet);
  if (dteSession == null)   return dataSet;
  return dteSession.getModelAdaptor().adaptDataSet(handle);
}
Program: 69206
Project: 69206
Buggy source:
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  return (new Long(diff / 1000)).longValue();
}

Fixed version (ground truth):
/** 
 * Return difference in number of seconds
 * @param d1
 * @param d2
 * @return
 */
private static long diffSecond(Date d1,Date d2){
  if (d1 == null || d2 == null) {
    throw new java.lang.IllegalArgumentException(Messages.getString("String_Node_Str"));
  }
  long diff=d2.getTime() - d1.getTime();
  diff+=timeZone.getDSTSavings();
  return (new Long(diff / 1000)).longValue();
}
Program: 69207
Project: 69207
Buggy source:
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,ExecutionContext context,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!(dataSet instanceof JointDataSetHandle) && context != null) {
    context.setReportContext(new ReportContextImpl(context));
    dataSetDesign=new ModelDteApiAdapter(context).appendRuntimeInfoToDataSet(dataSet,(BaseDataSetDesign)dataSetDesign);
  }
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  if (!(dataSet instanceof JointDataSetHandle) && context != null) {
    if (dataSet.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSet.getDataSource()));
    }
    session.defineDataSet(dataSetDesign);
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @param queryDefn
 * @param useColumnHints
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSet,IQueryDefinition queryDefn,boolean useColumnHints,boolean useFilters,boolean clearCache,ExecutionContext context,DataRequestSession session) throws BirtException {
  IBaseDataSetDesign dataSetDesign=session.getModelAdaptor().adaptDataSet(dataSet);
  if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {
    context.setReportContext(new ReportContextImpl(context));
    dataSetDesign=new ModelDteApiAdapter(context).appendRuntimeInfoToDataSet(dataSet,(BaseDataSetDesign)dataSetDesign);
  }
  if (clearCache) {
    IBaseDataSourceDesign dataSourceDesign=session.getModelAdaptor().adaptDataSource(dataSet.getDataSource());
    session.clearCache(dataSourceDesign,dataSetDesign);
  }
  if (!useColumnHints) {
    dataSetDesign.getResultSetHints().clear();
  }
  if (!useFilters) {
    dataSetDesign.getFilters().clear();
  }
  if (!(dataSet instanceof JointDataSetHandle || dataSet instanceof DerivedDataSetHandle) && context != null) {
    if (dataSet.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSet.getDataSource()));
    }
    session.defineDataSet(dataSetDesign);
  }
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSet,resultSet);
  return resultSet;
}
Program: 69209
Project: 69209
Buggy source:
/** 
 * This method computes the entire chart within the given bounds. If the dataset has changed but none of the axis attributes have changed, simply re-compute without 'rebuilding axes'.
 * @param bo
 */
public final void compute(Bounds bo) throws ChartException, IllegalArgumentException {
  ChartWithAxes cwa=getModel();
  initInnerFields(bo,cwa);
  if (boPlot.getWidth() <= 0 || boPlot.getHeight() <= 0) {
    return;
  }
  if (ChartUtil.hasMultipleYAxes(getModel()) && getModel().isStudyLayout()) {
    computeWithStudyLayout();
  }
 else {
    computeCommon();
  }
}

Fixed version (ground truth):
/** 
 * This method computes the entire chart within the given bounds. If the dataset has changed but none of the axis attributes have changed, simply re-compute without 'rebuilding axes'.
 * @param bo
 */
public final void compute(Bounds bo) throws ChartException, IllegalArgumentException {
  ChartWithAxes cwa=getModel();
  initInnerFields(bo,cwa);
  if (boPlot.getWidth() < 0 || boPlot.getHeight() < 0) {
    return;
  }
  if (ChartUtil.hasMultipleYAxes(getModel()) && getModel().isStudyLayout()) {
    computeWithStudyLayout();
  }
 else {
    computeCommon();
  }
}
Program: 69210
Project: 69210
Buggy source:
public void setHyperlinkDef(HyperlinkDef def){
  this.hyperLink=def;
  if (hyperLink != null) {
    style.setProperty(StyleConstant.COLOR_PROP,HYPERLINK_COLOR);
    style.setProperty(StyleConstant.TEXT_UNDERLINE_PROP,HYPERLINK_UNDERLINE);
    style.setName(StyleEntry.ENTRYNAME_HYPERLINK);
  }
}

Fixed version (ground truth):
public void setHyperlinkDef(HyperlinkDef def){
  this.hyperLink=def;
  if (hyperLink != null) {
    style.setProperty(StyleConstant.COLOR_PROP,HYPERLINK_COLOR);
    style.setProperty(StyleConstant.TEXT_UNDERLINE_PROP,true);
    style.setName(StyleEntry.ENTRYNAME_HYPERLINK);
  }
}
Program: 69213
Project: 69213
Buggy source:
private void loadReport() throws IOException {
  readDocumentExtension(0);
  int size=stream.readInt();
  if (size != -1) {
    byte[] buffer=new byte[size];
    stream.readFully(buffer,0,size);
    DataInputStream oi=new DataInputStream(new ByteArrayInputStream(buffer));
    int contentType=IOUtil.readInt(oi);
    if (contentType == IContent.REPORT_CONTENT) {
      reportContent.readContent(oi,loader);
      offset+=4 + size;
    }
  }
}

Fixed version (ground truth):
private void loadReport() throws IOException {
  readDocumentExtensionV1(0);
  int size=stream.readInt();
  if (size != -1) {
    byte[] buffer=new byte[size];
    stream.readFully(buffer,0,size);
    DataInputStream oi=new DataInputStream(new ByteArrayInputStream(buffer));
    int contentType=IOUtil.readInt(oi);
    if (contentType == IContent.REPORT_CONTENT) {
      reportContent.readContent(oi,loader);
      offset+=INDEX_ENTRY_SIZE_V1 + 4 + size;
      rootOffset=offset;
    }
  }
}
Program: 69214
Project: 69214
Buggy source:
ReportBodyExecutor(ExecutorManager manager,Fragment fragment){
  super(manager,-1);
  this.reportDesign=context.getReport();
  this.reader=manager.getReportReader();
  this.nextItem=0;
  if (fragment == null) {
    if (!reader.isEmpty()) {
      nextOffset=0;
    }
  }
 else {
    setFragment(fragment);
    Object[][] sections=fragment.getSections();
    if (sections != null && sections.length > 0) {
      Object[] edges=sections[0];
      if (edges[0] == Segment.LEFT_MOST_EDGE) {
        if (!reader.isEmpty()) {
          nextOffset=0;
        }
      }
 else {
        InstanceIndex leftEdge=(InstanceIndex)edges[0];
        if (leftEdge.getOffset() == -1) {
          if (!reader.isEmpty()) {
            nextOffset=0;
          }
        }
      }
    }
  }
  this.content=report.getRoot();
  initializeReportlet();
}

Fixed version (ground truth):
ReportBodyExecutor(ExecutorManager manager,Fragment fragment){
  super(manager,-1);
  this.reportDesign=context.getReport();
  this.reader=manager.getReportReader();
  this.nextItem=0;
  if (fragment == null) {
    if (!reader.isEmpty()) {
      nextOffset=reader.getRootOffset();
    }
  }
 else {
    setFragment(fragment);
    Object[][] sections=fragment.getSections();
    if (sections != null && sections.length > 0) {
      Object[] edges=sections[0];
      if (edges[0] == Segment.LEFT_MOST_EDGE) {
        if (!reader.isEmpty()) {
          nextOffset=reader.getRootOffset();
        }
      }
 else {
        InstanceIndex leftEdge=(InstanceIndex)edges[0];
        if (leftEdge.getOffset() == -1) {
          if (!reader.isEmpty()) {
            nextOffset=reader.getRootOffset();
          }
        }
      }
    }
  }
  this.content=report.getRoot();
  initializeReportlet();
}
Program: 69215
Project: 69215
Buggy source:
@Override public void handleEvent(Event event){
  if (event.data instanceof String[]) {
    preview(DEUtil.removeQuote(((String[])event.data)[1]));
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (event.data instanceof String[]) {
    preview(DEUtil.removeQuote(((String[])event.data)[1]));
  }
}
Program: 69217
Project: 69217
Buggy source:
public synchronized static void setCrosstabModelListener(ICrosstabModelListener listener){
  modelListener=listener;
}

Fixed version (ground truth):
public static void setCrosstabModelListener(ICrosstabModelListener listener){
  if (listener == null) {
    modelListener.remove();
  }
 else {
    modelListener.set(listener);
  }
}
Program: 69218
Project: 69218
Buggy source:
public static ICrosstabModelListener getCrosstabModelListener(){
  return modelListener;
}

Fixed version (ground truth):
public static ICrosstabModelListener getCrosstabModelListener(){
  return modelListener.get();
}
Program: 69219
Project: 69219
Buggy source:
/** 
 * Notifies any creation event for crosstab model.
 * @param type see <code>ICrosstabModelListener</code> for the type constants.
 * @param model the model object associated with this event.
 */
public static void notifyCreation(int type,Object model){
  if (modelListener != null) {
    modelListener.onCreated(type,model);
  }
}

Fixed version (ground truth):
/** 
 * Notifies any creation event for crosstab model.
 * @param type see <code>ICrosstabModelListener</code> for the type constants.
 * @param model the model object associated with this event.
 */
public static void notifyCreation(int type,Object model){
  ICrosstabModelListener listener=modelListener.get();
  if (listener != null) {
    listener.onCreated(type,model);
  }
}
Program: 69220
Project: 69220
Buggy source:
public EmitterInfo(String format,String id,String pagination,String mimeType,String icon,String namespace,String fileExt,Boolean outputDisplayNone,Boolean isHidden,String supportedImageFormats,boolean needOutputResultSet,IConfigurationElement emitter){
  this.format=format;
  this.id=id;
  this.emitter=emitter;
  this.pagination=pagination;
  this.mimeType=mimeType;
  this.icon=icon;
  this.namespace=namespace;
  this.fileExtension=fileExt;
  this.outputDisplayNone=outputDisplayNone;
  this.isHidden=isHidden;
  this.supportedImageFormats=supportedImageFormats;
}

Fixed version (ground truth):
public EmitterInfo(String format,String id,String pagination,String mimeType,String icon,String namespace,String fileExt,Boolean outputDisplayNone,Boolean isHidden,String supportedImageFormats,boolean needOutputResultSet,IConfigurationElement emitter){
  this.format=format;
  this.id=id;
  this.emitter=emitter;
  this.pagination=pagination;
  this.mimeType=mimeType;
  this.icon=icon;
  this.namespace=namespace;
  this.fileExtension=fileExt;
  this.outputDisplayNone=outputDisplayNone;
  this.isHidden=isHidden;
  this.supportedImageFormats=supportedImageFormats;
  this.needOutputResultSet=needOutputResultSet;
}
Program: 69221
Project: 69221
Buggy source:
protected void putCachedQueryResult(IBaseQueryDefinition query,String id){
  if (query.cacheQueryResults()) {
    queryCache.putCachedQuery(query,id);
  }
}

Fixed version (ground truth):
protected void putCachedQueryResult(IBaseQueryDefinition query,String id){
  queryCache.putCachedQuery(query,id);
}
Program: 69222
Project: 69222
Buggy source:
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResultSet,IQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  IPreparedQuery pQuery=(IPreparedQuery)queryMap.get(query);
  if (pQuery == null) {
    return null;
  }
  ScriptContext scriptContext=context.getScriptContext();
  IBaseQueryResults dteResults=null;
  boolean needExecute=queryCache.needExecute(query,queryOwner,needCache || useCache);
  if (!needExecute) {
    dteResults=getCachedQueryResult(query,parentResultSet);
  }
  if (dteResults == null) {
    if (parentResultSet == null) {
      dteResults=dteSession.execute(pQuery,null,scriptContext);
    }
 else {
      dteResults=dteSession.execute(pQuery,parentResultSet.getQueryResults(),scriptContext);
    }
    putCachedQueryResult(query,dteResults.getID());
  }
  IBaseResultSet resultSet;
  if (parentResultSet == null) {
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    resultSet=new QueryResultSet(this,context,parentResultSet,query,(IQueryResults)dteResults);
  }
  if (resultSet != null && needCache) {
    cacheResultID(parentResultSet,query,resultSet);
  }
  return resultSet;
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResultSet,IQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  IPreparedQuery pQuery=(IPreparedQuery)queryMap.get(query);
  if (pQuery == null) {
    return null;
  }
  ScriptContext scriptContext=context.getScriptContext();
  IBaseQueryResults dteResults=null;
  boolean needExecute=queryCache.needExecute(query,queryOwner,useCache);
  if (!needExecute) {
    dteResults=getCachedQueryResult(query,parentResultSet);
  }
  if (dteResults == null) {
    if (needCache) {
      ((BaseQueryDefinition)query).setCacheQueryResults(true);
    }
    if (parentResultSet == null) {
      dteResults=dteSession.execute(pQuery,null,scriptContext);
    }
 else {
      dteResults=dteSession.execute(pQuery,parentResultSet.getQueryResults(),scriptContext);
    }
    queryCache.putCachedQuery(query,dteResults.getID());
  }
  IBaseResultSet resultSet;
  if (parentResultSet == null) {
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    resultSet=new QueryResultSet(this,context,parentResultSet,query,(IQueryResults)dteResults);
  }
  if (needCache) {
    cacheResultID(parentResultSet,query,resultSet);
  }
  return resultSet;
}
Program: 69223
Project: 69223
Buggy source:
protected IBaseResultSet doExecuteCube(IBaseResultSet parentResultSet,ICubeQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  if (needCache || useCache) {
    Object obj=cachedQueryToResults.get(query);
    String rsetId=obj == null ? null : String.valueOf(obj);
    query.setQueryResultsID(rsetId);
  }
 else {
    query.setQueryResultsID(null);
  }
  IBasePreparedQuery pQuery=(IBasePreparedQuery)queryMap.get(query);
  if (pQuery == null) {
    throw new EngineException(MessageConstants.PREPARED_QUERY_NOT_FOUND_ERROR,query);
  }
  ScriptContext scriptContext=context.getScriptContext();
  IBaseResultSet resultSet;
  ICubeQueryResults dteResults;
  if (parentResultSet == null) {
    dteResults=(ICubeQueryResults)dteSession.execute(pQuery,null,scriptContext);
    resultSet=new CubeResultSet(this,context,query,dteResults);
  }
 else {
    dteResults=(ICubeQueryResults)dteSession.execute(pQuery,parentResultSet.getQueryResults(),scriptContext);
    resultSet=new CubeResultSet(this,context,parentResultSet,query,(ICubeQueryResults)dteResults);
  }
  if (query.cacheQueryResults()) {
    cachedQueryToResults.put(query,dteResults.getID());
  }
  if (resultSet != null && needCache) {
    cacheResultID(parentResultSet,query,resultSet);
  }
  return resultSet;
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteCube(IBaseResultSet parentResultSet,ICubeQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  if (useCache) {
    Object obj=cachedQueryToResults.get(query);
    String rsetId=obj == null ? null : String.valueOf(obj);
    query.setQueryResultsID(rsetId);
  }
 else {
    query.setQueryResultsID(null);
  }
  if (needCache) {
    ((ICubeQueryDefinition)query).setCacheQueryResults(true);
  }
  IBasePreparedQuery pQuery=(IBasePreparedQuery)queryMap.get(query);
  if (pQuery == null) {
    throw new EngineException(MessageConstants.PREPARED_QUERY_NOT_FOUND_ERROR,query);
  }
  ScriptContext scriptContext=context.getScriptContext();
  IBaseResultSet resultSet;
  ICubeQueryResults dteResults;
  if (parentResultSet == null) {
    dteResults=(ICubeQueryResults)dteSession.execute(pQuery,null,scriptContext);
    resultSet=new CubeResultSet(this,context,query,dteResults);
  }
 else {
    dteResults=(ICubeQueryResults)dteSession.execute(pQuery,parentResultSet.getQueryResults(),scriptContext);
    resultSet=new CubeResultSet(this,context,parentResultSet,query,(ICubeQueryResults)dteResults);
  }
  cachedQueryToResults.put(query,dteResults.getID());
  if (needCache) {
    cacheResultID(parentResultSet,query,resultSet);
  }
  return resultSet;
}
Program: 69224
Project: 69224
Buggy source:
/** 
 * @param fm
 * @return The width of the line containing the maximum width (if multilinesplit by hard breaks) or the width of the single line of text
 */
private final double stringWidth(){
  if (!Double.isNaN(cachedwidth)) {
    return cachedwidth;
  }
  cachedwidth=0;
  Rectangle2D r2d;
  if (iLineCount > 1) {
    double dWidth, dMaxWidth=0;
    for (int i=0; i < iLineCount; i++) {
      r2d=fm.getStringBounds(fsa[0],g2d);
      dWidth=r2d.getWidth();
      if (dWidth > dMaxWidth) {
        dMaxWidth=dWidth;
      }
    }
    cachedwidth=Math.max(0,dMaxWidth);
  }
 else   if (iLineCount == 1) {
    double w=fm.getStringBounds(fsa[0],g2d).getWidth();
    cachedwidth=Math.max(0,w);
  }
  return cachedwidth;
}

Fixed version (ground truth):
/** 
 * @param fm
 * @return The width of the line containing the maximum width (if multilinesplit by hard breaks) or the width of the single line of text
 */
private final double stringWidth(){
  if (!Double.isNaN(cachedwidth)) {
    return cachedwidth;
  }
  cachedwidth=0;
  Rectangle2D r2d;
  if (iLineCount > 1) {
    double dWidth, dMaxWidth=0;
    for (int i=0; i < iLineCount; i++) {
      r2d=tla[i].getBounds();
      dWidth=r2d.getWidth();
      if (dWidth > dMaxWidth) {
        dMaxWidth=dWidth;
      }
    }
    cachedwidth=Math.max(0,dMaxWidth);
  }
 else   if (iLineCount == 1) {
    double w=fm.getStringBounds(fsa[0],g2d).getWidth();
    cachedwidth=Math.max(0,w);
  }
  return cachedwidth;
}
Program: 69225
Project: 69225
Buggy source:
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}

Fixed version (ground truth):
public void startContent(IContent content,IContentEmitter emitter,boolean visible) throws BirtException {
  if (context.isFixedLayout() && (Integer)context.getLayoutEngine().getOption(EngineTask.TASK_TYPE) == IEngineTask.TASK_RUN) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    ContentEmitterUtil.startContent(content,emitter);
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
 else   if (isRepeated || (!visible && !currentNode.isStarted())) {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
  }
 else {
    LeafBufferNode leafNode=new LeafBufferNode(content,emitter,generator,visible);
    setup(leafNode,true);
    currentNode.start();
    if (visible) {
      ContentEmitterUtil.startContent(content,emitter);
    }
    generator.start(content,true);
    generator.end(content,true);
    currentNode.removeChildren();
  }
}
Program: 69226
Project: 69226
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  if (isAuto) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  if (isAuto) {
    info=LayoutUtil.createTable(table,width);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width));
    info=new ColumnsInfo(columns);
  }
  if (info == null)   return;
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption,table.getComputedStyle());
  }
  engine.addTable(table,info,sizeInfo);
}
Program: 69227
Project: 69227
Buggy source:
public void addCaption(String text){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=StyleBuilder.createEmptyStyleEntry();
  entry.setProperty(StyleEntry.H_ALIGN_PROP,"String_Node_Str");
  Data data=createData(text,entry);
  data.setSizeInfo(rule);
  addData(data);
}

Fixed version (ground truth):
public void addCaption(String text,IStyle style){
  ContainerSizeInfo rule=getCurrentContainer().getSizeInfo();
  StyleEntry entry=StyleBuilder.createEmptyStyleEntry();
  entry.setProperty(StyleEntry.H_ALIGN_PROP,"String_Node_Str");
  entry.setProperty(StyleEntry.FONT_SIZE_PROP,StyleBuilder.convertFontSize(style.getFontSize()));
  Data data=createData(text,entry);
  data.setSizeInfo(rule);
  addData(data);
}
Program: 69232
Project: 69232
Buggy source:
/** 
 * Returns the referred template parameter definition of the template element.
 * @return the handle to the referred template parameter definition
 */
TemplateParameterDefinitionHandle getRefTemplateParameter(){
}

Fixed version (ground truth):
/** 
 * Returns the referred template parameter definition of the template element.
 * @return the handle to the referred template parameter definition
 */
TemplateParameterDefinitionHandle getRefTemplateParameter(){
  TemplateParameterDefinition refTemplateParam=((TemplateElement)getElement()).getTemplateParameterElement(module);
  if (refTemplateParam == null)   return null;
  return (TemplateParameterDefinitionHandle)refTemplateParam.getHandle(module);
}
Program: 69233
Project: 69233
Buggy source:
/** 
 * Creates a row in the slot.
 * @param row the row element
 */
protected void newLayoutRow(TableRow row){
  int rowCount=rows.size();
  if (rowCount == 0 || rowCount == currentRowId + 1)   ensureSize(rowCount + 1,colCount);
  if (rowCount != 0)   currentRowId++;
  rowCount++;
}

Fixed version (ground truth):
/** 
 * Creates a row in the slot.
 * @param row the row element
 */
protected void newLayoutRow(TableRow row){
  int rowCount=rows.size();
  if (rowCount == 0 || rowCount == currentRowId + 1)   ensureSize(rowCount + 1,colCount);
  if (rowCount != 0)   currentRowId++;
}
Program: 69234
Project: 69234
Buggy source:
/** 
 * Creates a new design session handle. The application uses the handle to open, create and manage designs. The session also represents the user and maintains the user's locale information.
 * @param locale the user's locale. If <code>null</code>, uses the system locale.
 * @return the design session handle
 * @see SessionHandle
 */
public SessionHandle newSessionHandle(ULocale locale){
  if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())   return new SessionHandle(locale);
synchronized (isInitialized) {
    if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())     return new SessionHandle(locale);
    if (!isInitialized.booleanValue())     MetaDataDictionary.reset();
    try {
      initialize(ReportDesign.class.getResourceAsStream(ROM_DEF_FILE_NAME));
    }
 catch (    MetaDataReaderException e) {
    }
 finally {
      MetaLogManager.shutDown();
    }
    isInitialized=Boolean.TRUE;
  }
  SessionHandle session=new SessionHandle(locale);
  if (designConfig != null) {
    IResourceLocator locator=designConfig.getResourceLocator();
    if (locator != null)     session.setResourceLocator(locator);
  }
  return session;
}

Fixed version (ground truth):
/** 
 * Creates a new design session handle. The application uses the handle to open, create and manage designs. The session also represents the user and maintains the user's locale information.
 * @param locale the user's locale. If <code>null</code>, uses the system locale.
 * @return the design session handle
 * @see SessionHandle
 */
public SessionHandle newSessionHandle(ULocale locale){
  if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())   return new SessionHandle(locale);
synchronized (DesignEngineImpl.class) {
    if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())     return new SessionHandle(locale);
    if (!isInitialized.booleanValue())     MetaDataDictionary.reset();
    try {
      initialize(ReportDesign.class.getResourceAsStream(ROM_DEF_FILE_NAME));
    }
 catch (    MetaDataReaderException e) {
    }
 finally {
      MetaLogManager.shutDown();
    }
    isInitialized=Boolean.TRUE;
  }
  SessionHandle session=new SessionHandle(locale);
  if (designConfig != null) {
    IResourceLocator locator=designConfig.getResourceLocator();
    if (locator != null)     session.setResourceLocator(locator);
  }
  return session;
}
Program: 69235
Project: 69235
Buggy source:
/** 
 * Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines. The application must call this method once (and only once) before opening or creating a design. It is the application's responsibility because the application will choose the location to store the definition file, and that location may differ for different applications.
 * @param is stream for reading the "rom.def" file that provides the meta-data for the system
 * @throws MetaDataReaderException if error occurs during read the meta-data file.
 */
private static void initialize(InputStream is) throws MetaDataReaderException {
  try {
    if (!isInitialized.booleanValue())     MetaDataReader.read(is);
    if (!MetaDataDictionary.getInstance().isIntializedExtension())     MetaDataDictionary.getInstance().intializeExtension();
    if (!isInitialized.booleanValue())     SimpleElementFactory.setInstance(new org.eclipse.birt.report.model.api.impl.SimpleElementFactory());
  }
 catch (  MetaDataParserException e) {
    throw new MetaDataReaderException(MetaDataReaderException.DESIGN_EXCEPTION_META_DATA_ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines. The application must call this method once (and only once) before opening or creating a design. It is the application's responsibility because the application will choose the location to store the definition file, and that location may differ for different applications.
 * @param is stream for reading the "rom.def" file that provides the meta-data for the system
 * @throws MetaDataReaderException if error occurs during read the meta-data file.
 */
private static void initialize(InputStream is) throws MetaDataReaderException {
  try {
    if (!isInitialized.booleanValue())     MetaDataReader.read(is);
    if (!MetaDataDictionary.getInstance().isIntializedExtension())     MetaDataDictionary.intializeExtension();
    if (!isInitialized.booleanValue())     SimpleElementFactory.setInstance(new org.eclipse.birt.report.model.api.impl.SimpleElementFactory());
  }
 catch (  MetaDataParserException e) {
    throw new MetaDataReaderException(MetaDataReaderException.DESIGN_EXCEPTION_META_DATA_ERROR,e);
  }
}
Program: 69236
Project: 69236
Buggy source:
/** 
 * Gets the meta-data of the design engine.
 * @return the meta-data of the design engine.
 */
public IMetaDataDictionary getMetaData(){
  if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())   return MetaDataDictionary.getInstance();
synchronized (isInitialized) {
    if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())     return MetaDataDictionary.getInstance();
    if (!isInitialized.booleanValue())     MetaDataDictionary.reset();
    try {
      initialize(ReportDesign.class.getResourceAsStream(ROM_DEF_FILE_NAME));
    }
 catch (    MetaDataReaderException e) {
    }
 finally {
      MetaLogManager.shutDown();
    }
    isInitialized=Boolean.TRUE;
  }
  return MetaDataDictionary.getInstance();
}

Fixed version (ground truth):
/** 
 * Gets the meta-data of the design engine.
 * @return the meta-data of the design engine.
 */
public IMetaDataDictionary getMetaData(){
  if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())   return MetaDataDictionary.getInstance();
synchronized (DesignEngineImpl.class) {
    if (isInitialized.booleanValue() && MetaDataDictionary.getInstance().isIntializedExtension())     return MetaDataDictionary.getInstance();
    if (!isInitialized.booleanValue())     MetaDataDictionary.reset();
    try {
      initialize(ReportDesign.class.getResourceAsStream(ROM_DEF_FILE_NAME));
    }
 catch (    MetaDataReaderException e) {
    }
 finally {
      MetaLogManager.shutDown();
    }
    isInitialized=Boolean.TRUE;
  }
  return MetaDataDictionary.getInstance();
}
Program: 69237
Project: 69237
Buggy source:
/** 
 * Validates whether the group with the given name can be added into the given listing element.
 * @param element List/Table element
 * @param groupName name of the group to add
 * @return error list, each of which is the instance of<code>SemanticException</code>.
 */
public List<SemanticException> validateForAddingGroup(ListingHandle element,String groupName){
  List<GroupElement> groupList=Collections.emptyList();
  ListingElement targetElement=getListingElement(element.getModule(),(ListingElement)element.getElement());
  if (targetElement == null) {
    targetElement=(ListingElement)element.getElement();
    groupList=getGroups(element.getModule(),(ListingElement)element.getElement());
  }
 else {
    groupList=getGroupsWithContents(element.getModule(),targetElement);
  }
  List<SemanticException> list=new ArrayList<SemanticException>();
  if (isDuplicateGroupName(element.getModule(),groupList,groupName)) {
    list.add(new NameException(targetElement,groupName,NameException.DESIGN_EXCEPTION_DUPLICATE));
    return list;
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Validates whether the group with the given name can be added into the given listing element.
 * @param element List/Table element
 * @param groupName name of the group to add
 * @return error list, each of which is the instance of<code>SemanticException</code>.
 */
public List<SemanticException> validateForAddingGroup(ListingHandle element,String groupName){
  List<GroupElement> groupList=Collections.emptyList();
  ListingElement targetElement=(ListingElement)element.getElement();
  if (targetElement == null) {
    targetElement=(ListingElement)element.getElement();
    groupList=getGroups(element.getModule(),(ListingElement)element.getElement());
  }
 else {
    groupList=getGroupsWithContents(element.getModule(),targetElement);
  }
  List<SemanticException> list=new ArrayList<SemanticException>();
  if (isDuplicateGroupName(element.getModule(),groupList,groupName)) {
    list.add(new NameException(targetElement,groupName,NameException.DESIGN_EXCEPTION_DUPLICATE));
    return list;
  }
  return list;
}
Program: 69238
Project: 69238
Buggy source:
/** 
 * Validates whether the group can be renamed to the given name.
 * @param element List/Table element
 * @param group the group to rename
 * @param groupName name of the group to add
 * @return error list, each of which is the instance of<code>SemanticException</code>.
 */
public List<SemanticException> validateForRenamingGroup(ListingHandle element,GroupHandle group,String groupName){
  if (group.getName() == groupName || (groupName != null && groupName.equals(group.getName()))) {
    return Collections.emptyList();
  }
  ListingElement targetElement=getListingElement(element.getModule(),(ListingElement)element.getElement());
  if (targetElement == null)   return Collections.emptyList();
  List<GroupElement> groupList=getGroupsWithContents(element.getModule(),targetElement);
  List<SemanticException> list=new ArrayList<SemanticException>();
  if (isDuplicateGroupName(element.getModule(),groupList,groupName)) {
    list.add(new NameException(targetElement,groupName,NameException.DESIGN_EXCEPTION_DUPLICATE));
    return list;
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Validates whether the group can be renamed to the given name.
 * @param element List/Table element
 * @param group the group to rename
 * @param groupName name of the group to add
 * @return error list, each of which is the instance of<code>SemanticException</code>.
 */
public List<SemanticException> validateForRenamingGroup(ListingHandle element,GroupHandle group,String groupName){
  if (group.getName() == groupName || (groupName != null && groupName.equals(group.getName()))) {
    return Collections.emptyList();
  }
  ListingElement targetElement=(ListingElement)element.getElement();
  if (targetElement == null)   return Collections.emptyList();
  List<GroupElement> groupList=getGroupsWithContents(element.getModule(),targetElement);
  List<SemanticException> list=new ArrayList<SemanticException>();
  if (isDuplicateGroupName(element.getModule(),groupList,groupName)) {
    list.add(new NameException(targetElement,groupName,NameException.DESIGN_EXCEPTION_DUPLICATE));
    return list;
  }
  return list;
}
Program: 69241
Project: 69241
Buggy source:
/** 
 * Gets styles with default value for TOC.
 * @return list each item is <code>Style</code>
 */
public List<DesignElement> getDefaultTOCStyleValue(){
  if (isTOCStyleInitialized)   return Collections.unmodifiableList(defaultTOCStyleList);
synchronized (isTOCStyleInitialized) {
    if (!isTOCStyleInitialized) {
      initDefaultTOCStyle();
      isTOCStyleInitialized=Boolean.TRUE;
    }
  }
  return Collections.unmodifiableList(defaultTOCStyleList);
}

Fixed version (ground truth):
/** 
 * Gets styles with default value for TOC.
 * @return list each item is <code>Style</code>
 */
public List<DesignElement> getDefaultTOCStyleValue(){
  if (isTOCStyleInitialized)   return Collections.unmodifiableList(defaultTOCStyleList);
synchronized (DesignSession.class) {
    if (!isTOCStyleInitialized) {
      initDefaultTOCStyle();
      isTOCStyleInitialized=Boolean.TRUE;
    }
  }
  return Collections.unmodifiableList(defaultTOCStyleList);
}