nus-yam/ex-repair huggingface dataset:
Program: 72051
Project: 72051
Buggy source:
/** 
 * Evaluates a ROM script and converts the result type into one accepted by BIRT: Double (for all numeric types), java.util.Date, String, Boolean. Converts Javascript exception and script runtime exceptions to DataException
 * @param cx
 * @param scope
 * @param scriptText
 * @param source
 * @param lineNo
 * @return
 * @throws DataException
 */
public static Object evaluateJSAsExpr(Context cx,Scriptable scope,String scriptText,String source,int lineNo) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + scriptText + "String_Node_Str"+ source+ "String_Node_Str"+ lineNo);
  Object result;
  try {
    result=JavascriptEvalUtil.evaluateScript(cx,scope,scriptText,source,lineNo);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  if (result instanceof DataExceptionMocker) {
    throw DataException.wrap(((DataExceptionMocker)result).getCause());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Evaluates a ROM script and converts the result type into one accepted by BIRT: Double (for all numeric types), java.util.Date, String, Boolean. Converts Javascript exception and script runtime exceptions to DataException
 * @param cx
 * @param scope
 * @param scriptText
 * @param source
 * @param lineNo
 * @return
 * @throws DataException
 */
public static Object evaluateJSAsExpr(Context cx,Scriptable scope,String scriptText,String source,int lineNo) throws DataException {
  if (logger.isLoggable(Level.FINER))   logger.entering(ScriptEvalUtil.class.getName(),"String_Node_Str","String_Node_Str" + scriptText + "String_Node_Str"+ source+ "String_Node_Str"+ lineNo);
  Object result;
  try {
    result=JavascriptEvalUtil.evaluateScript(cx,scope,scriptText,source,lineNo);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  return result;
}
Program: 72052
Project: 72052
Buggy source:
public static String formatDate(Object data){
  if (data == null) {
    return null;
  }
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  Date date=null;
  if (data instanceof com.ibm.icu.util.Calendar) {
    date=((com.ibm.icu.util.Calendar)data).getTime();
  }
 else   if (data instanceof Date) {
    date=(Date)data;
  }
 else {
    return null;
  }
  return dateFormat.format(date);
}

Fixed version (ground truth):
public static String formatDate(Object data){
  SimpleDateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
  Date date=getDate(data);
  if (date == null) {
    return null;
  }
  return dateFormat.format(date);
}
Program: 72053
Project: 72053
Buggy source:
public void addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  Rule rule=getCurrentContainer().getRule();
  StyleEntry entry=engine.getStyle(style,rule);
  Data data=null;
  txt=((IDataContent)txt).getValue();
  data=createDateData(txt,entry,style.getDateTimeFormat());
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setRule(rule);
  addData(data);
}

Fixed version (ground truth):
public void addDateTime(Object txt,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  Rule rule=getCurrentContainer().getRule();
  StyleEntry entry=engine.getStyle(style,rule);
  Data data=null;
  IDataContent dataContent=(IDataContent)txt;
  Object value=dataContent.getValue();
  Date date=ExcelUtil.getDate(value);
  if (date != null && date.getYear() >= 0) {
    data=createDateData(value,entry,style.getDateTimeFormat());
    data.setHyperlinkDef(link);
    data.setBookmark(bookmark);
    data.setRule(rule);
    addData(data);
  }
 else {
    addData(dataContent.getText(),style,link,bookmark);
  }
}
Program: 72054
Project: 72054
Buggy source:
/** 
 * @return
 * @throws DataException
 */
private boolean loadFromCache() throws DataException {
  if (this.dataSource == null)   return false;
  if (!(this.baseQueryDefn instanceof IQueryDefinition))   return false;
  return this.session.getDataSetCacheManager().doesLoadFromCache(this.dataSource.getDesign(),this.dataSet.getDesign(),new ParameterUtil(this.tabularOuterResults == null ? null : this.tabularOuterResults.getQueryScope(),this.dataSet,(IQueryDefinition)this.baseQueryDefn,this.getQueryScope()).resolveDataSetParameters(true),this.queryAppContext);
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException
 */
private boolean loadFromCache() throws DataException {
  if (!(this.baseQueryDefn instanceof IQueryDefinition))   return false;
  return this.session.getDataSetCacheManager().doesLoadFromCache(this.dataSource == null ? null : this.dataSource.getDesign(),this.dataSet.getDesign(),new ParameterUtil(this.tabularOuterResults == null ? null : this.tabularOuterResults.getQueryScope(),this.dataSet,(IQueryDefinition)this.baseQueryDefn,this.getQueryScope()).resolveDataSetParameters(true),this.queryAppContext);
}
Program: 72056
Project: 72056
Buggy source:
/** 
 * Constructs instance based on param name and expression 
 */
public InputParamBindingAdapter(String paramName,String bindingExpr){
  super(paramName,new ExpressionAdapter(bindingExpr,DataType.ANY_TYPE));
}

Fixed version (ground truth):
/** 
 * Constructs instance base on param name, expression, and type.
 * @param paramName
 * @param bindingExpr
 * @param type
 */
public InputParamBindingAdapter(String paramName,ExpressionAdapter bindingExpr){
  super(paramName,bindingExpr);
}
Program: 72058
Project: 72058
Buggy source:
/** 
 * Creates a new DtE API IParameterDefinition from a model's DataSetParameterHandle.
 */
IParameterDefinition newParam(DataSetParameterHandle modelParam){
  ParameterDefinition dteParam=new ParameterDefinition();
  dteParam.setName(modelParam.getName());
  if (modelParam.getPosition() != null)   dteParam.setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   dteParam.setNativeType(modelParam.getNativeDataType().intValue());
  if (modelParam instanceof OdaDataSetParameterHandle) {
    dteParam.setNativeName(((OdaDataSetParameterHandle)modelParam).getNativeName());
  }
  dteParam.setType(toDteDataType(modelParam.getDataType()));
  dteParam.setInputMode(modelParam.isInput());
  dteParam.setOutputMode(modelParam.isOutput());
  dteParam.setNullable(modelParam.allowNull());
  dteParam.setInputOptional(modelParam.isOptional());
  dteParam.setDefaultInputValue(modelParam.getDefaultValue());
  return dteParam;
}

Fixed version (ground truth):
/** 
 * Creates a new DtE API IParameterDefinition from a model's DataSetParameterHandle.
 */
IParameterDefinition newParam(DataSetParameterHandle modelParam){
  ParameterDefinition dteParam=new ParameterDefinition();
  dteParam.setName(modelParam.getName());
  if (modelParam.getPosition() != null)   dteParam.setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   dteParam.setNativeType(modelParam.getNativeDataType().intValue());
  if (modelParam instanceof OdaDataSetParameterHandle) {
    dteParam.setNativeName(((OdaDataSetParameterHandle)modelParam).getNativeName());
  }
  dteParam.setType(DataAdapterUtil.modelDataTypeToCoreDataType(modelParam.getDataType()));
  dteParam.setInputMode(modelParam.isInput());
  dteParam.setOutputMode(modelParam.isOutput());
  dteParam.setNullable(modelParam.allowNull());
  dteParam.setInputOptional(modelParam.isOptional());
  dteParam.setDefaultInputValue(modelParam.getDefaultValue());
  return dteParam;
}
Program: 72059
Project: 72059
Buggy source:
private IInputParameterBinding newInputParamBinding(String paramName,String paramValue){
  if (paramValue == null)   return null;
  ScriptExpression paramValueExpr=new ScriptExpression(paramValue);
  return new InputParameterBinding(paramName,paramValueExpr);
}

Fixed version (ground truth):
private IInputParameterBinding newInputParamBinding(String paramName,ScriptExpression paramValueExpr){
  if (paramValueExpr == null)   return null;
  return new InputParameterBinding(paramName,paramValueExpr);
}
Program: 72060
Project: 72060
Buggy source:
public boolean exportable() throws DataException {
  return this.exportable();
}

Fixed version (ground truth):
public boolean exportable() throws DataException {
  return this.exportable;
}
Program: 72061
Project: 72061
Buggy source:
public void shutdown(){
  logger.entering("String_Node_Str","String_Node_Str");
  if (dataSources == null) {
    logger.fine("String_Node_Str");
    return;
  }
  if (shutdownListenerList != null) {
    for (int i=0; i < shutdownListenerList.size(); i++) {
      ((IShutdownListener)shutdownListenerList.get(i)).dataEngineShutdown();
    }
    shutdownListenerList.clear();
  }
  Collection col=dataSources.values();
  Iterator it=col.iterator();
  while (it.hasNext()) {
    DataSourceRuntime ds=(DataSourceRuntime)it.next();
    try {
      closeDataSource(ds);
    }
 catch (    DataException e) {
      if (logger.isLoggable(Level.FINE))       logger.log(Level.FINE,"String_Node_Str" + ds + "String_Node_Str",e);
    }
  }
  this.dataSourceManager.close();
  logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str");
  dataSetDesigns=null;
  dataSources=null;
  clearTempFile();
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
public void shutdown(){
  logger.entering("String_Node_Str","String_Node_Str");
  if (dataSources == null) {
    logger.fine("String_Node_Str");
    return;
  }
  Collection col=dataSources.values();
  Iterator it=col.iterator();
  while (it.hasNext()) {
    DataSourceRuntime ds=(DataSourceRuntime)it.next();
    try {
      closeDataSource(ds);
    }
 catch (    DataException e) {
      if (logger.isLoggable(Level.FINE))       logger.log(Level.FINE,"String_Node_Str" + ds + "String_Node_Str",e);
    }
  }
  this.dataSourceManager.close();
  if (shutdownListenerList != null) {
    for (int i=0; i < shutdownListenerList.size(); i++) {
      ((IShutdownListener)shutdownListenerList.get(i)).dataEngineShutdown();
    }
    shutdownListenerList.clear();
  }
  logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str");
  dataSetDesigns=null;
  dataSources=null;
  clearTempFile();
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}
Program: 72062
Project: 72062
Buggy source:
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  customDataSet.open();
  dataSet.afterOpen();
  ICandidateQuery candidateQuery=(ICandidateQuery)odiQuery;
  return candidateQuery.execute(eventHandler,stopSign);
}

Fixed version (ground truth):
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  customDataSet.open();
  dataSetAfterOpen();
  ICandidateQuery candidateQuery=(ICandidateQuery)odiQuery;
  return candidateQuery.execute(eventHandler,stopSign);
}
Program: 72063
Project: 72063
Buggy source:
public void close(){
  if (odiQuery == null) {
    logger.logp(Level.FINER,QueryExecutor.class.getName(),"String_Node_Str","String_Node_Str");
    return;
  }
  try {
    dataSet.beforeClose();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  if (odiResult != null) {
    try {
      odiResult.close();
    }
 catch (    DataException e1) {
      e1.printStackTrace();
    }
  }
  odiQuery.close();
  try {
    dataSet.close();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  odiQuery=null;
  odiDataSource=null;
  odiResult=null;
  queryScope=null;
  isPrepared=false;
  isExecuted=false;
  try {
    dataSet.afterClose();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  dataSet=null;
  dataSource=null;
  logger.logp(Level.FINER,QueryExecutor.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close(){
  if (odiQuery == null) {
    logger.logp(Level.FINER,QueryExecutor.class.getName(),"String_Node_Str","String_Node_Str");
    return;
  }
  try {
    dataSetBeforeClose();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  if (odiResult != null) {
    try {
      odiResult.close();
    }
 catch (    DataException e1) {
      e1.printStackTrace();
    }
  }
  odiQuery.close();
  try {
    dataSet.close();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  odiQuery=null;
  odiDataSource=null;
  odiResult=null;
  queryScope=null;
  isPrepared=false;
  isExecuted=false;
  try {
    dataSetAfterClose();
  }
 catch (  DataException e) {
    logger.logp(Level.FINE,QueryExecutor.class.getName(),"String_Node_Str",e.getMessage(),e);
  }
  dataSet=null;
  dataSource=null;
  logger.logp(Level.FINER,QueryExecutor.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 72064
Project: 72064
Buggy source:
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getListenPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error(Messages.getString("String_Node_Str"));
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error(Messages.getString("String_Node_Str"));
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
}

Fixed version (ground truth):
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getListenPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error(Messages.getString("String_Node_Str"));
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error(Messages.getString("String_Node_Str"));
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  initParameters();
}
Program: 72065
Project: 72065
Buggy source:
private void addParameter(Map map,String key,String value){
  String temp=key.substring(ATTR_PARAMRTER.length());
  map.put(temp,value);
}

Fixed version (ground truth):
private void addParameter(Map map,String key,String value){
  String temp=key.substring(ATTR_PARAMRTER.length());
  map.put(temp,getParameterObject(temp,value));
}
Program: 72066
Project: 72066
Buggy source:
private void initParameters(){
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
 else     if (str.startsWith(ATTR_MULPARAMRTER + "String_Node_Str")) {
      addMulitipleParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}

Fixed version (ground truth):
private void initParameters(){
  if (allParameters == null) {
    allParameters=new ArrayList();
    IReportRunnable runnable;
    try {
      runnable=engine.openReportDesign(reportDesignFile);
      List list=runnable.getDesignHandle().getRoot().getParametersAndParameterGroups();
      initAllParameters(allParameters,list);
    }
 catch (    EngineException e) {
    }
  }
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
 else     if (str.startsWith(ATTR_MULPARAMRTER + "String_Node_Str")) {
      addMulitipleParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}
Program: 72067
Project: 72067
Buggy source:
public ReportLauncher(){
  reportDesignFile=getFileName();
  debugScript=(getDebugType() & DEBUG_TYPE_JAVA_SCRIPT) == DEBUG_TYPE_JAVA_SCRIPT;
  targetFormat=getTargetFormat();
  initParameters();
}

Fixed version (ground truth):
public ReportLauncher(){
  reportDesignFile=getFileName();
  debugScript=(getDebugType() & DEBUG_TYPE_JAVA_SCRIPT) == DEBUG_TYPE_JAVA_SCRIPT;
  targetFormat=getTargetFormat();
}
Program: 72068
Project: 72068
Buggy source:
private void addMulitipleParameter(Map map,String key,String value){
  List list=new ArrayList();
  String temp=key.substring(ATTR_MULPARAMRTER.length() + 1);
  list.add(value);
  int i=1;
  Properties propertys=System.getProperties();
  Set set=propertys.keySet();
  while (set.contains(ATTR_MULPARAMRTER + i + temp)) {
    list.add(propertys.get(ATTR_MULPARAMRTER + i + temp));
    i++;
  }
  Object[] objs=new Object[list.size()];
  list.toArray(objs);
  map.put(temp,objs);
}

Fixed version (ground truth):
private void addMulitipleParameter(Map map,String key,String value){
  List list=new ArrayList();
  String temp=key.substring(ATTR_MULPARAMRTER.length() + 1);
  list.add(getParameterObject(temp,value));
  int i=1;
  Properties propertys=System.getProperties();
  Set set=propertys.keySet();
  while (set.contains(ATTR_MULPARAMRTER + i + temp)) {
    list.add(getParameterObject(temp,(String)propertys.get(ATTR_MULPARAMRTER + i + temp)));
    i++;
  }
  Object[] objs=new Object[list.size()];
  list.toArray(objs);
  map.put(temp,objs);
}
Program: 72069
Project: 72069
Buggy source:
/** 
 * Creates scalar parameter.
 * @param paramHandle
 * @return scalar parameter.
 */
private ScalarParameter createScalarParameter(ScalarParameterHandle paramHandle){
  ScalarParameter param=null;
  String controlType=paramHandle.getControlType();
  if (controlType.equals(LIST_BOX)) {
    boolean mustMatch=paramHandle.isMustMatch();
    if (mustMatch) {
      param=new ListBoxParameter(paramHandle,task);
    }
 else {
      param=new ComboBoxParameter(paramHandle,task);
    }
  }
 else   if (controlType.equals(TEXT_BOX)) {
    param=new StaticTextParameter(paramHandle,task);
  }
 else   if (controlType.equals(RADIO_BUTTON)) {
    param=new RadioParameter(paramHandle,task);
  }
  return param;
}

Fixed version (ground truth):
/** 
 * Creates scalar parameter.
 * @param paramHandle
 * @return scalar parameter.
 */
private ScalarParameter createScalarParameter(ScalarParameterHandle paramHandle){
  ScalarParameter param=null;
  String controlType=paramHandle.getControlType();
  if (controlType.equals(LIST_BOX)) {
    boolean mustMatch=paramHandle.isMustMatch();
    if (mustMatch) {
      param=new ListBoxParameter(paramHandle,task);
    }
 else {
      param=new ComboBoxParameter(paramHandle,task);
    }
  }
 else   if (controlType.equals(TEXT_BOX)) {
    param=new StaticTextParameter(paramHandle,task);
  }
 else   if (controlType.equals(RADIO_BUTTON)) {
    param=new RadioParameter(paramHandle,task);
  }
 else   if (controlType.equals(CHECK_BOX)) {
    param=new StaticTextParameter(paramHandle,task);
  }
  return param;
}
Program: 72070
Project: 72070
Buggy source:
public void setPagebreakPaginationOnly(boolean pageBreakPaginationOnly){
  this.pageBreakPaginationOnly=pageBreakPaginationOnly;
}

Fixed version (ground truth):
public void setPagebreakPaginationOnly(boolean pageBreakPaginationOnly){
  this.pageBreakPaginationOnly=pageBreakPaginationOnly;
  setAutoPageBreak(!pageBreakPaginationOnly);
}
Program: 72071
Project: 72071
Buggy source:
public boolean canLeaveThePage(){
  if (isDirty()) {
    MessageDialog prefDialog=new MessageDialog(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),null,Messages.getString("String_Node_Str"),MessageDialog.INFORMATION,new String[]{Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str")},0);
    int ret=prefDialog.open();
switch (ret) {
case 0:
      isLeaving=true;
    getReportEditor().doSave(null);
  break;
case 1:
if (getEditorInput() != null) {
  this.setInput(getEditorInput());
}
break;
case 2:
return false;
}
}
int errorLine=getErrorLIine(false);
if (errorLine > -1) {
if (errorDetail != null && errorDetail.getErrorCode().equals(ErrorDetail.DESIGN_EXCEPTION_UNSUPPORTED_VERSION)) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),errorDetail.getMessage());
}
 else {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
}
setFocus();
setHighlightLine(errorLine);
return false;
}
return true;
}

Fixed version (ground truth):
public boolean canLeaveThePage(){
  if (isDirty()) {
    MessageDialog prefDialog=new MessageDialog(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),null,Messages.getString("String_Node_Str"),MessageDialog.INFORMATION,new String[]{Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str")},0);
    int ret=prefDialog.open();
switch (ret) {
case 0:
      isLeaving=true;
    getReportEditor().doSave(null);
  break;
case 1:
if (getEditorInput() != null) {
  this.setInput(getEditorInput());
}
clearDirtyFlag();
break;
case 2:
return false;
}
}
int errorLine=getErrorLIine(false);
if (errorLine > -1) {
if (errorDetail != null && errorDetail.getErrorCode().equals(ErrorDetail.DESIGN_EXCEPTION_UNSUPPORTED_VERSION)) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),errorDetail.getMessage());
}
 else {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
}
setFocus();
setHighlightLine(errorLine);
return false;
}
return true;
}
Program: 72072
Project: 72072
Buggy source:
/** 
 * load report item emitters extension definitions
 */
protected void loadEmitterExtensionDefns(){
  IExtension[] exts=getExtensions(EXTENSION_POINT_EMITTERS);
  if (exts == null) {
    return;
  }
  for (int i=0; i < exts.length; i++) {
    String namespace=exts[i].getNamespace();
    IConfigurationElement[] configs=exts[i].getConfigurationElements();
    for (int j=0; j < configs.length; j++) {
      String format=configs[j].getAttribute("String_Node_Str");
      String mimeType=configs[j].getAttribute("String_Node_Str");
      String id=configs[j].getAttribute("String_Node_Str");
      String pagination=configs[j].getAttribute("String_Node_Str");
      String icon=configs[j].getAttribute("String_Node_Str");
      Boolean outDisplayNone=new Boolean(configs[j].getAttribute("String_Node_Str"));
      String fileExtension=configs[j].getAttribute("String_Node_Str");
      Boolean isHidden=new Boolean(configs[j].getAttribute("String_Node_Str"));
      EmitterInfo emitterInfo=new EmitterInfo(format,id,pagination,mimeType,icon,namespace,fileExtension,outDisplayNone,isHidden,configs[j]);
      emitterExtensions.add(emitterInfo);
      assert(format != null);
      formats.put(format.toLowerCase(),emitterInfo);
      emitters.put(id,emitterInfo);
      logger.log(Level.FINE,"String_Node_Str",new String[]{format,id});
    }
  }
}

Fixed version (ground truth):
/** 
 * load report item emitters extension definitions
 */
protected void loadEmitterExtensionDefns(){
  IExtension[] exts=getExtensions(EXTENSION_POINT_EMITTERS);
  if (exts == null) {
    return;
  }
  for (int i=0; i < exts.length; i++) {
    String namespace=exts[i].getNamespace();
    IConfigurationElement[] configs=exts[i].getConfigurationElements();
    for (int j=0; j < configs.length; j++) {
      String format=configs[j].getAttribute("String_Node_Str");
      String mimeType=configs[j].getAttribute("String_Node_Str");
      String id=configs[j].getAttribute("String_Node_Str");
      String pagination=configs[j].getAttribute("String_Node_Str");
      if (pagination == null) {
        pagination=PAGE_BREAK_PAGINATION;
      }
      String icon=configs[j].getAttribute("String_Node_Str");
      Boolean outDisplayNone=new Boolean(configs[j].getAttribute("String_Node_Str"));
      String fileExtension=configs[j].getAttribute("String_Node_Str");
      Boolean isHidden=new Boolean(configs[j].getAttribute("String_Node_Str"));
      EmitterInfo emitterInfo=new EmitterInfo(format,id,pagination,mimeType,icon,namespace,fileExtension,outDisplayNone,isHidden,configs[j]);
      emitterExtensions.add(emitterInfo);
      assert(format != null);
      formats.put(format.toLowerCase(),emitterInfo);
      emitters.put(id,emitterInfo);
      logger.log(Level.FINE,"String_Node_Str",new String[]{format,id});
    }
  }
}
Program: 72073
Project: 72073
Buggy source:
/** 
 * Checks if the selected resources can be modified.
 * @return <code>true</code> if the selected resources can be modified,<code>false</code> otherwise.
 */
protected boolean canModifySelectedResources(){
  Collection<?> resources=getSelectedResources();
  if (resources == null || resources.isEmpty()) {
    return false;
  }
  for (  Object resource : resources) {
    if (resource instanceof ResourceEntryWrapper) {
      if (((ResourceEntryWrapper)resource).getParent() instanceof FragmentResourceEntry) {
        return false;
      }
    }
 else     if (resource instanceof PathResourceEntry) {
      if (((PathResourceEntry)resource).isRoot()) {
        return false;
      }
    }
 else     if (resource instanceof FragmentResourceEntry) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks if the selected resources can be modified.
 * @return <code>true</code> if the selected resources can be modified,<code>false</code> otherwise.
 */
protected boolean canModifySelectedResources(){
  Collection<?> resources=getSelectedResources();
  if (resources == null || resources.isEmpty()) {
    return false;
  }
  for (  Object resource : resources) {
    if (resource instanceof ResourceEntryWrapper) {
      if (((ResourceEntryWrapper)resource).getParent() instanceof FragmentResourceEntry) {
        return false;
      }
    }
 else     if (resource instanceof PathResourceEntry) {
      if (((PathResourceEntry)resource).isRoot()) {
        return false;
      }
    }
 else     if (resource instanceof FragmentResourceEntry) {
      return false;
    }
 else     if (resource instanceof ReportElementEntry) {
      return false;
    }
  }
  return true;
}
Program: 72074
Project: 72074
Buggy source:
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterDefns();
  addCustomFields(odaStatement);
  addColumnHints(odaStatement);
  if (this.projectedFields != null)   odaStatement.setColumnsProjection(this.projectedFields);
  odaStatement.setMaxRows(this.getRowFetchLimit());
  try {
    IOdaDataSetDesign design=null;
    if (session.getDataSetCacheManager().getCurrentDataSetDesign() instanceof IOdaDataSetDesign)     design=(IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign();
    resultMetadata=getMetaData((IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign(),odaStatement);
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}

Fixed version (ground truth):
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterDefns();
  IOdaDataSetDesign design=null;
  if (session.getDataSetCacheManager().getCurrentDataSetDesign() instanceof IOdaDataSetDesign)   design=(IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign();
  if (design != null) {
    if (design.getPrimaryResultSetName() != null) {
      addCustomFields(design.getPrimaryResultSetName(),odaStatement);
      addColumnHints(design.getPrimaryResultSetName(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetName(),this.projectedFields);
    }
 else     if (design.getPrimaryResultSetNumber() > 0) {
      addCustomFields(design.getPrimaryResultSetNumber(),odaStatement);
      addColumnHints(design.getPrimaryResultSetNumber(),odaStatement);
      if (this.projectedFields != null)       odaStatement.setColumnsProjection(design.getPrimaryResultSetNumber(),this.projectedFields);
    }
 else {
      prepareColumns();
    }
  }
 else {
    prepareColumns();
  }
  odaStatement.setMaxRows(this.getRowFetchLimit());
  try {
    resultMetadata=getMetaData((IOdaDataSetDesign)session.getDataSetCacheManager().getCurrentDataSetDesign(),odaStatement);
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}
Program: 72075
Project: 72075
Buggy source:
/** 
 * Declares custom fields on Oda statement
 * @param stmt
 * @throws DataException
 */
private void addCustomFields(PreparedStatement stmt) throws DataException {
  if (this.customFields != null) {
    Iterator it=this.customFields.iterator();
    while (it.hasNext()) {
      CustomField customField=(CustomField)it.next();
      stmt.declareCustomColumn(customField.getName(),DataType.getClass(customField.getDataType()));
    }
  }
}

Fixed version (ground truth):
private void addCustomFields(int rsetNumber,PreparedStatement stmt) throws DataException {
  if (this.customFields != null) {
    Iterator it=this.customFields.iterator();
    while (it.hasNext()) {
      CustomField customField=(CustomField)it.next();
      stmt.declareCustomColumn(rsetNumber,customField.getName(),DataType.getClass(customField.getDataType()));
    }
  }
}
Program: 72076
Project: 72076
Buggy source:
/** 
 * Adds Odi column hints to ODA statement
 * @param stmt
 * @throws DataException
 */
private void addColumnHints(PreparedStatement stmt) throws DataException {
}

Fixed version (ground truth):
private void addColumnHints(int rsetNumber,PreparedStatement stmt) throws DataException {
}
Program: 72077
Project: 72077
Buggy source:
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  try {
{
      if (!maxRowsUpToDate) {
        callStat.setMaxRows(maxrows);
        maxRowsUpToDate=true;
      }
      this.registerOutputParameter();
      boolean execute=callStat.execute();
      if (this.cachedResultSet != null) {
        IResultSet ret=this.cachedResultSet;
        this.cachedResultSet=null;
        execute=true;
      }
      this.populateOutputParamResultSet();
      this.isExecuted=true;
      return execute;
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  return this.executeQuery() != null;
}
Program: 72078
Project: 72078
Buggy source:
public int[] resolveFixedLayout(int maxWidth){
  int columnNumber=table.getColumnCount();
  DimensionType[] columns=new DimensionType[columnNumber];
  for (int i=0; i < columnNumber; i++) {
    IColumn column=table.getColumn(i);
    DimensionType w=column.getWidth();
    if (startCol < 0) {
      startCol=i;
    }
    endCol=i;
    if (w == null) {
      columns[i]=null;
    }
 else {
      columns[i]=new DimensionType(w.getMeasure(),w.getUnits());
    }
  }
  if (startCol < 0)   startCol=0;
  if (endCol < 0)   endCol=0;
  int specifiedWidth=getDimensionValue(tableContent.getWidth(),maxWidth);
  int tableWidth;
  if (specifiedWidth > 0) {
    tableWidth=specifiedWidth;
  }
 else {
    tableWidth=maxWidth;
  }
  formalize(columns,tableWidth);
  return resolve(tableWidth,columns);
}

Fixed version (ground truth):
public int[] resolveFixedLayout(int maxWidth){
  int columnNumber=table.getColumnCount();
  DimensionType[] columns=new DimensionType[columnNumber];
  for (int i=0; i < columnNumber; i++) {
    IColumn column=table.getColumn(i);
    DimensionType w=column.getWidth();
    if (startCol < 0) {
      startCol=i;
    }
    endCol=i;
    if (w == null) {
      columns[i]=null;
    }
 else {
      columns[i]=new DimensionType(w.getMeasure(),w.getUnits());
    }
  }
  if (startCol < 0)   startCol=0;
  if (endCol < 0)   endCol=0;
  int specifiedWidth=getDimensionValue(tableContent.getWidth(),maxWidth);
  int tableWidth;
  if (specifiedWidth > 0) {
    tableWidth=specifiedWidth;
  }
 else {
    tableWidth=maxWidth;
  }
  return formalize(columns,tableWidth);
}
Program: 72080
Project: 72080
Buggy source:
public void connect(InetAddress host,int listenPort) throws VMException {
  try {
    requestSocket=new Socket(host,listenPort);
    requestWriter=new ObjectOutputStream(requestSocket.getOutputStream());
    requestReader=new ObjectInputStream(requestSocket.getInputStream());
    eventSocket=new Socket(host,listenPort);
    eventReader=new ObjectInputStream(eventSocket.getInputStream());
    isTerminated=false;
    isConnected=true;
    logger.info(Messages.getString("String_Node_Str"));
    addDeferredBreakPoints();
    startEventDispatch();
  }
 catch (  Exception e) {
    throw new VMException(e);
  }
}

Fixed version (ground truth):
public void connect(InetAddress host,int listenPort) throws VMException {
  try {
    requestSocket=new Socket("String_Node_Str",listenPort);
    requestWriter=new ObjectOutputStream(requestSocket.getOutputStream());
    requestReader=new ObjectInputStream(requestSocket.getInputStream());
    eventSocket=new Socket("String_Node_Str",listenPort);
    eventReader=new ObjectInputStream(eventSocket.getInputStream());
    isTerminated=false;
    isConnected=true;
    logger.info(Messages.getString("String_Node_Str"));
    addDeferredBreakPoints();
    startEventDispatch();
  }
 catch (  Exception e) {
    throw new VMException(e);
  }
}
Program: 72081
Project: 72081
Buggy source:
public void start(int listenPort,Context cx) throws VMException {
  try {
    serverSocket=new ServerSocket(listenPort,50,InetAddress.getLocalHost());
    Socket clientRequestSocket=serverSocket.accept();
    clientRequestReader=new ObjectInputStream(clientRequestSocket.getInputStream());
    clientRequestWriter=new ObjectOutputStream(clientRequestSocket.getOutputStream());
    Socket clientEventSocket=serverSocket.accept();
    clientEventWriter=new ObjectOutputStream(clientEventSocket.getOutputStream());
    logger.info(Messages.getString("String_Node_Str"));
    isShutdown=false;
    vm.attach(cx,true);
    startRequestDispatch();
  }
 catch (  IOException e) {
    throw new VMException(e);
  }
}

Fixed version (ground truth):
public void start(int listenPort,Context cx) throws VMException {
  try {
    serverSocket=new ServerSocket(listenPort,50,null);
    Socket clientRequestSocket=serverSocket.accept();
    clientRequestReader=new ObjectInputStream(clientRequestSocket.getInputStream());
    clientRequestWriter=new ObjectOutputStream(clientRequestSocket.getOutputStream());
    Socket clientEventSocket=serverSocket.accept();
    clientEventWriter=new ObjectOutputStream(clientEventSocket.getOutputStream());
    logger.info(Messages.getString("String_Node_Str"));
    isShutdown=false;
    vm.attach(cx,true);
    startRequestDispatch();
  }
 catch (  IOException e) {
    throw new VMException(e);
  }
}
Program: 72083
Project: 72083
Buggy source:
public void startPage(IPageContent page){
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
}

Fixed version (ground truth):
public void startPage(IPageContent page){
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
  if (needOutputInMasterPage(page.getPageHeader()) && needOutputInMasterPage(page.getPageFooter())) {
    outputInMasterPage=true;
    pageHeader=formatHeaderFooter(page.getPageHeader(),true);
    pageFooter=formatHeaderFooter(page.getPageFooter(),false);
  }
  if (!outputInMasterPage && page.getPageHeader() != null) {
    contentVisitor.visitChildren(page.getPageHeader(),null);
  }
}
Program: 72084
Project: 72084
Buggy source:
private void endSheet(ExcelWriter writer){
  writer.endTable();
  if (orientation != null) {
    writer.declareWorkSheetOptions(orientation);
  }
  writer.closeSheet();
}

Fixed version (ground truth):
private void endSheet(ExcelWriter writer){
  writer.endTable();
  writer.declareWorkSheetOptions(orientation,pageHeader,pageFooter);
  writer.closeSheet();
}
Program: 72085
Project: 72085
Buggy source:
public void endPage(IPageContent page){
}

Fixed version (ground truth):
public void endPage(IPageContent page){
  if (!outputInMasterPage && page.getPageFooter() != null) {
    contentVisitor.visitChildren(page.getPageFooter(),null);
  }
}
Program: 72086
Project: 72086
Buggy source:
public void declareWorkSheetOptions(String orientation){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",orientation);
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void declareWorkSheetOptions(String orientation,String pageHeader,String pageFooter){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  if (orientation != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",orientation);
    writer.closeTag("String_Node_Str");
  }
  if (pageHeader != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageHeader);
    writer.closeTag("String_Node_Str");
  }
  if (pageFooter != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageFooter);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 72087
Project: 72087
Buggy source:
/** 
 * Sort all form pages in the relative order.
 * @param formPageList
 * @return
 */
private static List sortFormPageList(List formPageList){
  List olist=new ArrayList(formPageList.size());
  olist.addAll(formPageList);
  List rlist=new ArrayList(olist.size());
  List unlist=new ArrayList();
  boolean resolved=true;
  while (olist.size() > 0 && resolved) {
    resolved=false;
    for (int i=0; i < olist.size(); i++) {
      FormPageDef element=(FormPageDef)olist.get(i);
      if (element.relative == null) {
        rlist.add(element);
        resolved=true;
      }
 else {
        int relativePosition=getRelativeElementPosition(element,rlist);
        if (relativePosition == -1) {
          relativePosition=getRelativeElementPosition(element,olist);
          if (relativePosition == -1) {
            rlist.add(element);
            resolved=true;
          }
 else {
            unlist.add(element);
          }
        }
 else {
          rlist.add(relativePosition + element.position,element);
          resolved=true;
        }
      }
    }
    for (Iterator itr=unlist.iterator(); itr.hasNext(); ) {
      FormPageDef element=(FormPageDef)itr.next();
      int relativePosition=getRelativeElementPosition(element,rlist);
      if (relativePosition != -1) {
        rlist.add(relativePosition + element.position,element);
        itr.remove();
        resolved=true;
      }
    }
    olist.removeAll(rlist);
  }
  rlist.addAll(unlist);
  return rlist;
}

Fixed version (ground truth):
/** 
 * Sort all form pages in the relative order.
 * @param formPageList
 * @return
 */
private static List sortFormPageList(List formPageList){
  List olist=new ArrayList(formPageList.size());
  olist.addAll(formPageList);
  List rlist=new ArrayList(olist.size());
  List unlist=new ArrayList();
  boolean resolved=true;
  while (olist.size() > 0 && resolved) {
    resolved=false;
    for (int i=0; i < olist.size(); i++) {
      FormPageDef element=(FormPageDef)olist.get(i);
      if (element.relative == null) {
        rlist.add(element);
        resolved=true;
      }
 else {
        int relativePosition=getRelativeElementPosition(element,rlist);
        if (relativePosition == -1) {
          relativePosition=getRelativeElementPosition(element,olist);
          if (relativePosition == -1) {
            rlist.add(element);
            resolved=true;
          }
 else {
            unlist.add(element);
          }
        }
 else {
          rlist.add(relativePosition + element.position,element);
          resolved=true;
        }
      }
    }
    unlist.removeAll(rlist);
    for (Iterator itr=unlist.iterator(); itr.hasNext(); ) {
      FormPageDef element=(FormPageDef)itr.next();
      int relativePosition=getRelativeElementPosition(element,rlist);
      if (relativePosition != -1) {
        rlist.add(relativePosition + element.position,element);
        itr.remove();
        resolved=true;
      }
    }
    olist.removeAll(rlist);
  }
  rlist.addAll(unlist);
  return rlist;
}
Program: 72088
Project: 72088
Buggy source:
public void layout(){
  init();
  if (PropertyUtil.isInlineElement(image)) {
    assert(parent instanceof IInlineStackingLayout);
    IInlineStackingLayout lineParent=(IInlineStackingLayout)parent;
    if (root.getAllocatedWidth() > parent.getCurrentMaxContentWidth()) {
      if (!lineParent.isEmptyLine()) {
        boolean ret=lineParent.endLine();
        layout();
      }
    }
  }
  boolean succeed=parent.addArea(root,0);
  if (succeed) {
    return;
  }
 else {
    if (!parent.isPageEmpty()) {
      parent.autoPageBreak();
    }
    parent.addToRoot(root,parent.contextList.size() - 1);
    if (parent.isInBlockStacking) {
      parent.flushFinishedPage();
    }
  }
}

Fixed version (ground truth):
public void layout(){
  init();
  if (PropertyUtil.isInlineElement(image)) {
    assert(parent instanceof IInlineStackingLayout);
    IInlineStackingLayout lineParent=(IInlineStackingLayout)parent;
    if (root.getAllocatedWidth() > parent.getCurrentMaxContentWidth()) {
      if (!lineParent.isEmptyLine()) {
        boolean ret=lineParent.endLine();
        layout();
      }
    }
 else {
      parent.addToRoot(root,0);
      return;
    }
  }
 else {
    boolean succeed=parent.addArea(root,0);
    if (succeed) {
      return;
    }
 else {
      if (!parent.isPageEmpty()) {
        parent.autoPageBreak();
      }
      parent.addToRoot(root,parent.contextList.size() - 1);
      if (parent.isInBlockStacking) {
        parent.flushFinishedPage();
      }
    }
  }
}
Program: 72090
Project: 72090
Buggy source:
/** 
 * Close the tag when implement the inline box.
 */
protected void closeInlineBoxTag(){
  writer.closeTag(HTMLTags.TAG_TD);
  writer.closeTag(HTMLTags.TAG_TR);
  writer.closeTag(HTMLTags.TAG_TABLE);
}

Fixed version (ground truth):
/** 
 * Close the tag when implement the inline box.
 */
protected void closeInlineBoxTag(){
  writer.closeTag(HTMLTags.TAG_TD);
  writer.closeTag(HTMLTags.TAG_TR);
  writer.closeTag(HTMLTags.TAG_TABLE);
  writer.closeTag(HTMLTags.TAG_DIV);
}
Program: 72091
Project: 72091
Buggy source:
/** 
 * Open the tag when implement the inline box.
 */
protected void openInlineBoxTag(){
  writer.openTag(HTMLTags.TAG_TABLE);
  writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
  writer.openTag(HTMLTags.TAG_TR);
  writer.openTag(HTMLTags.TAG_TD);
}

Fixed version (ground truth):
/** 
 * Open the tag when implement the inline box.
 */
protected void openInlineBoxTag(){
  writer.openTag(HTMLTags.TAG_DIV);
  writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
  writer.openTag(HTMLTags.TAG_TABLE);
  writer.openTag(HTMLTags.TAG_TR);
  writer.openTag(HTMLTags.TAG_TD);
}
Program: 72092
Project: 72092
Buggy source:
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  try {
{
      if (!maxRowsUpToDate) {
        callStat.setMaxRows(maxrows);
        maxRowsUpToDate=true;
      }
      this.registerOutputParameter();
      boolean execute=callStat.execute();
      this.populateOutputParamResultSet();
      this.isExecuted=true;
      return execute;
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}

Fixed version (ground truth):
public boolean execute() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(callStat);
  try {
{
      if (!maxRowsUpToDate) {
        callStat.setMaxRows(maxrows);
        maxRowsUpToDate=true;
      }
      this.registerOutputParameter();
      boolean execute=callStat.execute();
      if (this.cachedResultSet != null) {
        IResultSet ret=this.cachedResultSet;
        this.cachedResultSet=null;
        execute=true;
      }
      this.populateOutputParamResultSet();
      this.isExecuted=true;
      return execute;
    }
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.QUERY_EXECUTE_FAIL,e);
  }
}
Program: 72093
Project: 72093
Buggy source:
public void startPage(IPageContent page){
}

Fixed version (ground truth):
public void startPage(IPageContent page){
  if (orientation == null) {
    orientation=capitalize(page.getOrientation());
  }
}
Program: 72094
Project: 72094
Buggy source:
private void endSheet(ExcelWriter writer){
  writer.endTable();
  writer.closeSheet();
}

Fixed version (ground truth):
private void endSheet(ExcelWriter writer){
  writer.endTable();
  if (orientation != null) {
    writer.declareWorkSheetOptions(orientation);
  }
  writer.closeSheet();
}
Program: 72095
Project: 72095
Buggy source:
public void end(IReportContent report){
  engine.complete();
  boolean isRTLSheet=false;
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  ExcelWriter writer=new ExcelWriter(out,context,isRTLSheet);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  int count=0;
  if (tempWriter != null) {
    tempWriter.close(false);
    File file=new File(tempfilePath);
    writer.insertSheet(file);
    file.delete();
  }
  if (engine.getRowCount() != 0) {
    startSheet(writer);
    while (count < engine.getRowCount()) {
      outputData(engine.getRow(count),writer);
      count++;
    }
    endSheet(writer);
  }
  writer.close(true);
  sheetIndex=1;
}

Fixed version (ground truth):
public void end(IReportContent report){
  engine.complete();
  boolean isRTLSheet=false;
  String reportOrientation=report.getDesign().getReportDesign().getBidiOrientation();
  if ("String_Node_Str".equalsIgnoreCase(reportOrientation))   isRTLSheet=true;
  ExcelWriter writer=new ExcelWriter(out,context,isRTLSheet);
  writer.writeDeclarations();
  writer.writeDocumentProperties(report);
  writer.declareStyles(engine.getStyleMap());
  writer.defineNames(engine.getNamesRefer());
  if (tempWriter != null) {
    tempWriter.close(false);
    File file=new File(tempfilePath);
    writer.insertSheet(file);
    file.delete();
    if (engine.getRowCount() != 0) {
      outputCacheData(writer);
    }
  }
 else {
    outputCacheData(writer);
  }
  writer.close(true);
  sheetIndex=1;
}