nus-yam/ex-repair huggingface dataset:
Program: 74397
Project: 74397
Buggy source:
public void testAddYear() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2015,10,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1805,10,15);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1910,10,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=0; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}

Fixed version (ground truth):
public void testAddYear() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(2015,10,15);
  Date d1=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1805,10,15,0,0,0);
  Date d2=new Date(c.getTimeInMillis());
  c.clear();
  c.set(1920,10,15);
  Date d3=new Date(c.getTimeInMillis());
  c.clear();
  Date[] values=new Date[]{d1,d2,d3};
  for (int i=1; i < values.length; i++) {
    assertEquals(cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null),values[i]);
  }
}
Program: 74398
Project: 74398
Buggy source:
public void testDiffMinute() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  int[] values=new int[]{1,-1 * 24 * 60,2 * 24 * 60,37 * 24 * 60,(65 * 24 + 11) * 60 + 2,(66 * 24 + 22) * 60 + 3,((66 + 365) * 24) * 60};
  for (int i=0; i < values.length; i++) {
    assertEquals(((Number)cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null)).intValue(),values[i]);
  }
}

Fixed version (ground truth):
public void testDiffMinute() throws BirtException {
  String[] scripts=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  int[] values=new int[]{1,-1 * 24 * 60,2 * 24 * 60,37 * 24 * 60,(65 * 24 + 11) * 60 + 2,(66 * 24 + 22) * 60 + 3,((66 + 365) * 24) * 60};
  for (int i=0; i < values.length; i++) {
    System.out.println(i);
    assertEquals(((Number)cx.evaluateString(scope,scripts[i],"String_Node_Str",1,null)).intValue(),values[i]);
  }
}
Program: 74400
Project: 74400
Buggy source:
public int getOutputType(){
  if ("String_Node_Str".equals(sExtension)) {
    return OUTPUT_AS_IMAGE;
  }
 else {
    return OUTPUT_AS_IMAGE_WITH_MAP;
  }
}

Fixed version (ground truth):
public int getOutputType(){
  if (outputType == -1) {
    if ("String_Node_Str".equals(sExtension) || "String_Node_Str".equals(sExtension)) {
      outputType=OUTPUT_AS_IMAGE;
    }
 else {
      outputType=OUTPUT_AS_IMAGE_WITH_MAP;
    }
  }
  return outputType;
}
Program: 74402
Project: 74402
Buggy source:
public String getImageMIMEType(){
  if (idr instanceof IImageMapEmitter) {
    return ((IImageMapEmitter)idr).getMimeType();
  }
 else   if ("String_Node_Str".equals(sExtension)) {
    return "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public String getImageMIMEType(){
  return idr.getMimeType();
}
Program: 74403
Project: 74403
Buggy source:
/** 
 * Saves input code to model
 */
public void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle) {
    saveEditorContentsDE((DesignElementHandle)editObject);
  }
  setIsModified(false);
}

Fixed version (ground truth):
/** 
 * Saves input code to model
 */
public void saveModel(){
  if (isCodeModified() && editObject instanceof DesignElementHandle) {
    saveEditorContentsDE((DesignElementHandle)editObject);
  }
  setIsModified(false);
  ((IFormPage)editingDomainEditor).getEditor().editorDirtyStateChanged();
  firePropertyChange(PROP_DIRTY);
}
Program: 74404
Project: 74404
Buggy source:
/** 
 * Number -> Boolean 0 		-> false others 	-> true String -> Boolean "true" 	-> true (ignore case) "false" -> false (ignore case) other string will throw an exception Date -> Boolean throw exception
 * @param source
 * @return
 * @throws BirtException
 */
public static Boolean toBoolean(Object source) throws BirtException {
  if (source == null)   return null;
  if (source instanceof Boolean) {
    return (Boolean)source;
  }
 else   if (source instanceof Number) {
    if (((Number)source).doubleValue() == 0)     return new Boolean(false);
    return new Boolean(true);
  }
 else   if (source instanceof String) {
    if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.TRUE;
 else     if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.FALSE;
 else {
      try {
        if (Integer.parseInt((String)source) == 0)         return Boolean.FALSE;
 else         return Boolean.TRUE;
      }
 catch (      NumberFormatException e) {
        throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
      }
    }
  }
 else {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}

Fixed version (ground truth):
/** 
 * Number -> Boolean 0 		-> false others 	-> true String -> Boolean "true" 	-> true (ignore case) "false" -> false (ignore case) other string will throw an exception Date -> Boolean throw exception
 * @param source
 * @return
 * @throws BirtException
 */
public static Boolean toBoolean(Object source) throws BirtException {
  if (source == null)   return Boolean.FALSE;
  if (source instanceof Boolean) {
    return (Boolean)source;
  }
 else   if (source instanceof Number) {
    if (((Number)source).doubleValue() == 0)     return new Boolean(false);
    return new Boolean(true);
  }
 else   if (source instanceof String) {
    if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.TRUE;
 else     if (((String)source).equalsIgnoreCase("String_Node_Str"))     return Boolean.FALSE;
 else {
      try {
        if (Integer.parseInt((String)source) == 0)         return Boolean.FALSE;
 else         return Boolean.TRUE;
      }
 catch (      NumberFormatException e) {
        throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
      }
    }
  }
 else {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}
Program: 74405
Project: 74405
Buggy source:
private void applyTimeZone(){
  if (this.dateFormat != null) {
    this.dateFormat.setTimeZone(timeZone);
  }
  if (this.dateTimeFormat != null) {
    this.dateTimeFormat.setTimeZone(timeZone);
  }
  if (this.timeFormat != null) {
    this.timeFormat.setTimeZone(timeZone);
  }
}

Fixed version (ground truth):
private void applyTimeZone(){
  if (this.timeZone != null) {
    if (this.dateFormat != null) {
      this.dateFormat.setTimeZone(timeZone);
    }
    if (this.dateTimeFormat != null) {
      this.dateTimeFormat.setTimeZone(timeZone);
    }
    if (this.timeFormat != null) {
      this.timeFormat.setTimeZone(timeZone);
    }
  }
}
Program: 74406
Project: 74406
Buggy source:
public void setUp() throws Exception {
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtDateTime());
}

Fixed version (ground truth):
public void setUp() throws Exception {
  cx=Context.enter();
  scope=cx.initStandardObjects();
  ScriptableObject.putProperty(scope,"String_Node_Str",new BirtDateTime());
}
Program: 74407
Project: 74407
Buggy source:
public void tearDown(){
  Context.exit();
  TimeZone.setDefault(this.currentTimeZone);
}

Fixed version (ground truth):
public void tearDown(){
  Context.exit();
}
Program: 74408
Project: 74408
Buggy source:
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(contentDimension.getWidth());
  root.setContentHeight(Math.min(context.getMaxHeight(),contentDimension.getHeight()));
}

Fixed version (ground truth):
protected void init(){
  assert(content instanceof IImageContent);
  image=(IImageContent)content;
  maxWidth=parent.getCurrentMaxContentWidth();
  Dimension contentDimension=getSpecifiedDimension(image);
  root=(ContainerArea)createInlineContainer(image,true,true);
  validateBoxProperty(root.getStyle(),maxWidth,context.getMaxHeight());
  root.setAllocatedWidth(maxWidth);
  ImageArea imageArea=(ImageArea)AreaFactory.createImageArea(image);
  imageArea.setWidth(contentDimension.getWidth());
  imageArea.setHeight(contentDimension.getHeight());
  root.addChild(imageArea);
  imageArea.setPosition(root.getContentX(),root.getContentY());
  processChartLegend(image,imageArea);
  root.setContentWidth(Math.min(parent.getCurrentMaxContentWidth(),contentDimension.getWidth()));
  root.setContentHeight(Math.min(parent.getCurrentMaxContentHeight(),contentDimension.getHeight()));
}
Program: 74409
Project: 74409
Buggy source:
public void testDateFormat(){
  String golden="String_Node_Str";
  DateFormatter sample=new DateFormatter("String_Node_Str",ULocale.ENGLISH);
  Locale locDef=Locale.getDefault();
  Calendar dateCal=Calendar.getInstance(locDef);
  dateCal.set(8,8,13,20,1,44);
  Date date=dateCal.getTime();
  String fmtDate=sample.format(date);
  assertEquals(golden,fmtDate);
}

Fixed version (ground truth):
public void testDateFormat(){
  String golden="String_Node_Str";
  DateFormatter sample=new DateFormatter("String_Node_Str",ULocale.ENGLISH,TimeZone.getTimeZone("String_Node_Str"));
  Locale locDef=Locale.getDefault();
  Calendar dateCal=Calendar.getInstance(locDef);
  dateCal.set(8,8,13,20,1,44);
  Date date=dateCal.getTime();
  String fmtDate=sample.format(date);
  assertEquals(golden,fmtDate);
}
Program: 74410
Project: 74410
Buggy source:
public void testDateFormatString(){
  DateFormatter sample=new DateFormatter("String_Node_Str");
  Locale locDef=Locale.getDefault();
  Calendar dateCal=Calendar.getInstance(locDef);
  dateCal.set(8,8,13,20,1,44);
  Date date=dateCal.getTime();
  SimpleDateFormat sampleJava=new SimpleDateFormat("String_Node_Str",locDef);
  assertEquals(sampleJava.format(date),sample.format(date));
}

Fixed version (ground truth):
public void testDateFormatString(){
  DateFormatter sample=new DateFormatter("String_Node_Str",ULocale.ENGLISH,TimeZone.getTimeZone("String_Node_Str"));
  Locale locDef=Locale.getDefault();
  Calendar dateCal=Calendar.getInstance(locDef);
  dateCal.set(8,8,13,20,1,44);
  Date date=dateCal.getTime();
  SimpleDateFormat sampleJava=new SimpleDateFormat("String_Node_Str",locDef);
  assertEquals(sampleJava.format(date),sample.format(date));
}
Program: 74411
Project: 74411
Buggy source:
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  if (bindingName != null && reportItem != null) {
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,reportItem.getModuleHandle()));
    selectValueList.addAll(session.getColumnValueSet(reportItem.getDataSet(),reportItem.paramBindingsIterator(),reportItem.columnBindingsIterator(),bindingName));
    session.shutdown();
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}

Fixed version (ground truth):
private List getSelectValueList() throws BirtException {
  List selectValueList=new ArrayList();
  ReportItemHandle reportItem=DEUtil.getBindingHolder(currentItem);
  if (bindingName != null && reportItem != null) {
    selectValueList=SelectValueFetcher.getSelectValueList(expression.getText(),reportItem.getDataSet(),false);
  }
 else {
    ExceptionHandler.openErrorMessageBox(Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return selectValueList;
}
Program: 74413
Project: 74413
Buggy source:
private boolean compareFiles(String src,String golden){
  boolean result=false;
  try {
    InputStream goldenInputStream=new FileInputStream(new File(golden));
    assert(goldenInputStream != null);
    StringBuffer goldenBuffer=new StringBuffer();
    byte[] buffer=new byte[5120];
    int readCount=-1;
    while ((readCount=goldenInputStream.read(buffer)) != -1) {
      goldenBuffer.append(new String(buffer));
    }
    InputStream srcInputStream=new FileInputStream(new File(golden));
    assert(srcInputStream != null);
    StringBuffer srcBuffer=new StringBuffer();
    buffer=new byte[5120];
    readCount=-1;
    while ((readCount=srcInputStream.read(buffer)) != -1) {
      srcBuffer.append(new String(buffer));
    }
    result=(srcBuffer.toString()).equals(goldenBuffer.toString());
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return result;
}

Fixed version (ground truth):
private boolean compareFiles(String src,String golden){
  boolean result=false;
  try {
    InputStream goldenInputStream=new FileInputStream(new File(golden));
    assert(goldenInputStream != null);
    StringBuffer goldenBuffer=new StringBuffer();
    byte[] buffer=new byte[5120];
    int readCount=-1;
    while ((readCount=goldenInputStream.read(buffer)) != -1) {
      goldenBuffer.append(new String(buffer,0,readCount));
    }
    InputStream srcInputStream=new FileInputStream(new File(golden));
    assert(srcInputStream != null);
    StringBuffer srcBuffer=new StringBuffer();
    buffer=new byte[5120];
    readCount=-1;
    while ((readCount=srcInputStream.read(buffer)) != -1) {
      srcBuffer.append(new String(buffer,0,readCount));
    }
    result=(srcBuffer.toString()).equals(goldenBuffer.toString());
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return result;
}
Program: 74414
Project: 74414
Buggy source:
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  prepareToExecuteChildren();
  return listContent;
}

Fixed version (ground truth):
/** 
 * Execute a listint and create the contents. List create a serials of contents. The execution process is: <li> create an container which will contain all the contents it creates. <li> push it into the stack <li> open query <li> process action, bookmark, style and visibility <li> call the onCreate if necessary <li> call emitter to start the list <li> access the query <li> call emitter to end the list <li> close the query. <li> pop up the container.
 * @see org.eclipse.birt.report.engine.executor.ReportItemExecutor#load(org.eclipse.birt.report.engine.ir.ReportItemDesign,org.eclipse.birt.report.engine.emitter.IReportEmitter)
 */
public IContent execute(){
  ListItemDesign listDesign=(ListItemDesign)getDesign();
  IListContent listContent=report.createListContent();
  setContent(listContent);
  executeQuery();
  initializeContent(listDesign,listContent);
  processAction(listDesign,listContent);
  processBookmark(listDesign,listContent);
  processStyle(listDesign,listContent);
  processVisibility(listDesign,listContent);
  if (context.isInFactory()) {
    handleOnCreate(listContent);
  }
  startTOCEntry(listContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return listContent;
}
Program: 74415
Project: 74415
Buggy source:
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  prepareToExecuteChildren();
  return tableContent;
}

Fixed version (ground truth):
public IContent execute(){
  TableItemDesign tableDesign=(TableItemDesign)getDesign();
  ITableContent tableContent=report.createTableContent();
  setContent(tableContent);
  executeQuery();
  initializeContent(tableDesign,tableContent);
  processStyle(tableDesign,tableContent);
  processVisibility(tableDesign,tableContent);
  processBookmark(tableDesign,tableContent);
  processAction(tableDesign,tableContent);
  for (int i=0; i < tableDesign.getColumnCount(); i++) {
    ColumnDesign columnDesign=tableDesign.getColumn(i);
    Column column=new Column(report);
    column.setGenerateBy(columnDesign);
    InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
    column.setInstanceID(iid);
    processColumnVisibility(columnDesign,column);
    tableContent.addColumn(column);
  }
  if (context.isInFactory()) {
    handleOnCreate(tableContent);
  }
  startTOCEntry(tableContent);
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
  prepareToExecuteChildren();
  return tableContent;
}
Program: 74416
Project: 74416
Buggy source:
protected void doExecute() throws Exception {
  executeQuery();
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  executeQuery();
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}
Program: 74417
Project: 74417
Buggy source:
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      InstanceID instanceId=getInstanceID();
      if (offset != -1) {
        content=reader.loadContent(offset);
        InstanceID id=content.getInstanceID();
        if (!isSameInstance(instanceId,id)) {
          content=doCreateContent();
          content.setInstanceID(instanceId);
        }
      }
 else {
        content=doCreateContent();
      }
      content.setGenerateBy(design);
      content.setInstanceID(instanceId);
      IContent pContent=getParentContent();
      if (pContent != null) {
        content.setParent(pContent);
      }
      doExecute();
    }
 catch (    Exception ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      context.addException(new EngineException(ex.getLocalizedMessage()));
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      InstanceID instanceId=getInstanceID();
      if (offset != -1) {
        content=reader.loadContent(offset);
        InstanceID id=content.getInstanceID();
        if (!isSameInstance(instanceId,id)) {
          content=doCreateContent();
          content.setInstanceID(instanceId);
        }
      }
 else {
        content=doCreateContent();
      }
      content.setGenerateBy(design);
      content.setInstanceID(instanceId);
      IContent pContent=getParentContent();
      if (pContent != null) {
        content.setParent(pContent);
      }
      doExecute();
    }
 catch (    Exception ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      context.addException(new EngineException(ex.getLocalizedMessage(),ex));
    }
  }
  return content;
}
Program: 74418
Project: 74418
Buggy source:
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
}

Fixed version (ground truth):
protected void doExecute() throws Exception {
  TableItemDesign tableDesign=(TableItemDesign)design;
  ITableContent tableContent=(ITableContent)content;
  executeQuery();
  if (tableContent.getColumnCount() == 0) {
    for (int i=0; i < tableDesign.getColumnCount(); i++) {
      ColumnDesign columnDesign=tableDesign.getColumn(i);
      Column column=new Column(report);
      column.setGenerateBy(columnDesign);
      InstanceID iid=new InstanceID(null,columnDesign.getID(),null);
      column.setInstanceID(iid);
      tableContent.addColumn(column);
    }
  }
 else {
    int columnCount=tableContent.getColumnCount();
    for (int i=0; i < columnCount; i++) {
      Column column=(Column)tableContent.getColumn(i);
      InstanceID iid=column.getInstanceID();
      if (iid != null) {
        long componentId=iid.getComponentID();
        ReportElementDesign element=report.getDesign().getReportItemByID(componentId);
        column.setGenerateBy(element);
      }
    }
  }
  boolean showIfBlank="String_Node_Str".equalsIgnoreCase(content.getStyle().getShowIfBlank());
  if (showIfBlank && rsetEmpty) {
    createQueryForShowIfBlank();
  }
}
Program: 74419
Project: 74419
Buggy source:
/** 
 * @throws DataException
 */
private void validateComputedMeasureNames() throws DataException {
  Set existNames=new HashSet();
  String[] measureNames=cube.getMeasureNames();
  for (int i=0; i < measureNames.length; i++) {
    existNames.add(measureNames[i]);
  }
  MeasureInfo[] mis=computedMeasureHelper.getAllComputedMeasureInfos();
  for (int i=0; i < mis.length; i++) {
    String name=mis[i].getMeasureName();
    if (existNames.contains(name)) {
      throw new DataException(ResourceConstants.DUPLICATE_MEASURE_NAME,name);
    }
    existNames.add(name);
  }
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void validateComputedMeasureNames() throws DataException {
  Set existNames=new HashSet(Arrays.asList(cube.getMeasureNames()));
  MeasureInfo[] mis=computedMeasureHelper.getAllComputedMeasureInfos();
  for (int i=0; i < mis.length; i++) {
    String name=mis[i].getMeasureName();
    if (existNames.contains(name)) {
      throw new DataException(ResourceConstants.DUPLICATE_MEASURE_NAME,name);
    }
    existNames.add(name);
  }
}
Program: 74421
Project: 74421
Buggy source:
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (this.getControl() == null || this.getControl().isDisposed())   return design;
  if (design != null && doc != null)   design.setQueryText(doc.get());
  if (this.shouldUpdateDataSetDesign || !formerQueryTxt.equals(design.getQueryText())) {
    SQLUtility.saveDataSetDesign(design);
    formerQueryTxt=design.getQueryText();
    this.shouldUpdateDataSetDesign=false;
  }
  return design;
}

Fixed version (ground truth):
protected DataSetDesign collectDataSetDesign(DataSetDesign design){
  if (this.getControl() == null || this.getControl().isDisposed())   return design;
  if (design != null && doc != null)   design.setQueryText(doc.get());
  if (this.shouldUpdateDataSetDesign || !formerQueryTxt.equals(design.getQueryText())) {
    MetaDataRetriever retriever=new MetaDataRetriever(this.metaDataProvider,design.getQueryText());
    IResultSetMetaData resultsetMeta=retriever.getResultSetMetaData();
    IParameterMetaData paramMeta=retriever.getParameterMetaData();
    SQLUtility.saveDataSetDesign(design,resultsetMeta,paramMeta);
    formerQueryTxt=design.getQueryText();
    this.shouldUpdateDataSetDesign=false;
    retriever.close();
  }
  return design;
}
Program: 74422
Project: 74422
Buggy source:
public static int in_word_set(String str){
  int len=str.length();
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
    int key=hash(str);
    if (key <= MAX_HASH_VALUE && key >= 0) {
      int index=lookup[key];
      if (index >= 0) {
        if (len == lengthtable[index]) {
          String s=wordlist[index];
          if (s.equals(str))           return index;
        }
      }
 else       if (index < -TOTAL_KEYWORDS) {
        int offset=-1 - TOTAL_KEYWORDS - index;
        int lengthptr=TOTAL_KEYWORDS + lookup[offset];
        int wordptr=TOTAL_KEYWORDS + lookup[offset];
        int wordendptr=wordptr + -lookup[offset + 1];
        while (wordptr < wordendptr) {
          if (len == lengthtable[lengthptr]) {
            String s=wordlist[wordptr];
            if (s.equals(str))             return wordptr;
          }
          lengthptr++;
          wordptr++;
        }
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
public static int in_word_set(String str){
  int len=str.length();
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
    int key=hash(str);
    if (key <= MAX_HASH_VALUE && key >= 0) {
      int index=lookup[key];
      if (index >= 0) {
        if (len == lengthtable[index]) {
          String s=wordlist[index];
          if (s.equals(str))           return index;
        }
      }
    }
  }
  return -1;
}
Program: 74423
Project: 74423
Buggy source:
public static int hash(String str){
  int len=str.length();
  return len + asso_values[str.charAt(len - 1)] + asso_values[str.charAt(0)];
}

Fixed version (ground truth):
public static int hash(String str){
  int hashValue=str.length();
switch (hashValue) {
default :
    hashValue+=asso_values[str.charAt(11)];
case 11:
case 10:
case 9:
case 8:
case 7:
case 6:
case 5:
case 4:
case 3:
  hashValue+=asso_values[str.charAt(2)];
case 2:
case 1:
hashValue+=asso_values[str.charAt(0)];
break;
}
return hashValue + asso_values[str.charAt(str.length() - 1)];
}
Program: 74425
Project: 74425
Buggy source:
/** 
 * This method is responsible for computing the aggregation result according to the specified aggregation definitions.
 * @param aggregations
 * @param stopSign
 * @return
 * @throws DataException
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet[] onePassExecute(AggregationDefinition[] aggregations,StopSign stopSign) throws DataException, IOException, BirtException {
  IDiskArray[] dimPosition=getFilterResult();
  int count=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      count++;
    }
  }
  IDimension[] dimensions=cube.getDimesions();
  String[] validDimensionName=new String[count];
  IDiskArray[] validDimPosition=new IDiskArray[count];
  int pos=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      validDimPosition[pos]=dimPosition[i];
      validDimensionName[pos]=dimensions[i].getName();
      pos++;
    }
  }
  FactTableRowIterator facttableRowIterator=new FactTableRowIterator(cube.getFactTable(),validDimensionName,validDimPosition,computedMeasureHelper,stopSign);
  DimensionResultIterator[] dimensionResultIterator=populateDimensionResultIterator(dimPosition,stopSign);
  AggregationExecutor aggregationCalculatorExecutor=new AggregationExecutor(dimensionResultIterator,facttableRowIterator,aggregations);
  return aggregationCalculatorExecutor.execute(stopSign);
}

Fixed version (ground truth):
/** 
 * This method is responsible for computing the aggregation result according to the specified aggregation definitions.
 * @param aggregations
 * @param stopSign
 * @return
 * @throws DataException
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet[] onePassExecute(AggregationDefinition[] aggregations,StopSign stopSign) throws DataException, IOException, BirtException {
  IDiskArray[] dimPosition=getFilterResult();
  int count=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      count++;
    }
  }
  IDimension[] dimensions=cube.getDimesions();
  String[] validDimensionName=new String[count];
  IDiskArray[] validDimPosition=new IDiskArray[count];
  int pos=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      validDimPosition[pos]=dimPosition[i];
      validDimensionName[pos]=dimensions[i].getName();
      pos++;
    }
  }
  FactTableRowIterator facttableRowIterator=new FactTableRowIterator(cube.getFactTable(),validDimensionName,validDimPosition,computedMeasureHelper,stopSign);
  DimensionResultIterator[] dimensionResultIterator=populateDimensionResultIterator(dimPosition,stopSign);
  AggregationExecutor aggregationCalculatorExecutor=new AggregationExecutor(dimensionResultIterator,facttableRowIterator,aggregations);
  try {
    return aggregationCalculatorExecutor.execute(stopSign);
  }
  finally {
    facttableRowIterator.close();
  }
}
Program: 74426
Project: 74426
Buggy source:
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        this.close();
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(getSubDimensionIndex(),combinedDimensionPosition.bytesValue());
      for (int i=0; i < this.currentMeasureValues.length; i++) {
        currentMeasureValues[i]=DocumentObjectUtil.readValue(currentSegment,factTable.getMeasureInfo()[i].getDataType());
      }
      currentMeasureMap.setMeasureValue(currentMeasureValues);
      if (computedMeasureHelper != null) {
        try {
          currentComputedMeasureValues=computedMeasureHelper.computeMeasureValues(currentMeasureMap);
        }
 catch (        DataException e) {
          throw new DataException(ResourceConstants.FAIL_COMPUTE_COMPUTED_MEASURE_VALUE,e);
        }
      }
      if (!isSelectedRow()) {
        continue;
      }
 else {
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    this.close();
    return false;
  }
  return next();
}

Fixed version (ground truth):
public boolean next() throws IOException, DataException {
  while (!stopSign.isStopped()) {
    try {
      if (currentSegment == null) {
        return false;
      }
      Bytes combinedDimensionPosition=currentSegment.readBytes();
      currentPos=factTable.getCombinedPositionCalculator().calculateDimensionPosition(getSubDimensionIndex(),combinedDimensionPosition.bytesValue());
      for (int i=0; i < this.currentMeasureValues.length; i++) {
        currentMeasureValues[i]=DocumentObjectUtil.readValue(currentSegment,factTable.getMeasureInfo()[i].getDataType());
      }
      currentMeasureMap.setMeasureValue(currentMeasureValues);
      if (computedMeasureHelper != null) {
        try {
          currentComputedMeasureValues=computedMeasureHelper.computeMeasureValues(currentMeasureMap);
        }
 catch (        DataException e) {
          throw new DataException(ResourceConstants.FAIL_COMPUTE_COMPUTED_MEASURE_VALUE,e);
        }
      }
      if (!isSelectedRow()) {
        continue;
      }
 else {
        return true;
      }
    }
 catch (    EOFException e) {
      break;
    }
  }
  if (stopSign.isStopped() || !nextSegment()) {
    return false;
  }
  return next();
}
Program: 74427
Project: 74427
Buggy source:
/** 
 * @throws DataException
 */
private void close() throws DataException {
  if (this.computedMeasureHelper != null)   this.computedMeasureHelper.cleanUp();
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void close() throws DataException {
  if (this.computedMeasureHelper != null)   this.computedMeasureHelper.cleanUp();
}
Program: 74433
Project: 74433
Buggy source:
public Object[] computeMeasureValues(IMeasureMap measureList){
  Object[] result=new Object[1];
  Integer value=new Integer(((Integer)measureList.getMeasureValue("String_Node_Str")).intValue() + 1);
  result[0]=value;
  return result;
}

Fixed version (ground truth):
public Object[] computeMeasureValues(IFacttableRow factTableRow) throws DataException {
  Object[] result=new Object[1];
  Integer value=new Integer(((Integer)factTableRow.getMeasureValue("String_Node_Str")).intValue() + 1);
  result[0]=value;
  return result;
}
Program: 74434
Project: 74434
Buggy source:
/** 
 * @return
 */
public Object[] computeMeasureValues(IMeasureMap measureMap) throws DataException ;

Fixed version (ground truth):
/** 
 * @return
 */
public Object[] computeMeasureValues(IFacttableRow factTableRow) throws DataException ;
Program: 74435
Project: 74435
Buggy source:
public Object[] computeMeasureValues(IMeasureList measureList){
  Object[] result=new Object[1];
  Integer value=new Integer(((Integer)measureList.getMeasureValue("String_Node_Str")).intValue() + 1);
  result[0]=value;
  return result;
}

Fixed version (ground truth):
public Object[] computeMeasureValues(IMeasureMap measureList){
  Object[] result=new Object[1];
  Integer value=new Integer(((Integer)measureList.getMeasureValue("String_Node_Str")).intValue() + 1);
  result[0]=value;
  return result;
}
Program: 74444
Project: 74444
Buggy source:
public void complete(){
  int rowcount=cache.getRowCount();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      if (row[j] == waste) {
        continue;
      }
      Data d=(Data)row[j];
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      Rule rule=d.getRule();
      int start=axis.getCoordinate(rule.getStart());
      int end=axis.getCoordinate(rule.getEnd());
      Span span=new Span(start + 1,end - start - 1);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}

Fixed version (ground truth):
public void complete(){
  int rowcount=cache.getRowCount();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      if (row[j] == waste) {
        continue;
      }
      Data d=(Data)row[j];
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      Rule rule=d.getRule();
      int start=axis.getCoordinate(rule.getStart());
      int end=axis.getCoordinate(rule.getEnd());
      Span span=new Span(start,end - start - 1);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}
Program: 74445
Project: 74445
Buggy source:
public IBaseQueryResults execute(IBasePreparedQuery query,IBaseQueryResults outerResults,Scriptable scope) throws AdapterException {
  try {
    if (query instanceof IPreparedQuery) {
      return ((IPreparedQuery)query).execute((outerResults instanceof IQueryResults) ? ((IQueryResults)outerResults) : null,scope);
    }
 else     if (query instanceof IPreparedCubeQuery) {
      return ((IPreparedCubeQuery)query).execute(scope);
    }
    return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public IBaseQueryResults execute(IBasePreparedQuery query,IBaseQueryResults outerResults,Scriptable scope) throws AdapterException {
  try {
    if (query instanceof IPreparedQuery) {
      return ((IPreparedQuery)query).execute((outerResults instanceof IQueryResults) ? ((IQueryResults)outerResults) : null,scope);
    }
 else     if (query instanceof IPreparedCubeQuery) {
      return ((IPreparedCubeQuery)query).execute(scope);
    }
    return null;
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 74447
Project: 74447
Buggy source:
/** 
 * @param objClass
 * @return
 */
public static int getDataType(Class objClass){
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return typeCodes[i];
    }
  }
  return UNKNOWN_TYPE;
}

Fixed version (ground truth):
/** 
 * @param objClass
 * @return
 */
public static int getDataType(Class objClass){
  if (objClass.equals(byte[].class))   return typeCodes[6];
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return typeCodes[i];
    }
  }
  return UNKNOWN_TYPE;
}
Program: 74448
Project: 74448
Buggy source:
public static IObjectWriter getRandomWriter(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomWriter();
case DataType.INTEGER_TYPE:
  return new IntegerRandomWriter();
case DataType.BYTES_TYPE:
return new BytesRandomWriter();
case DataType.DOUBLE_TYPE:
return new DoubleRandomWriter();
case DataType.STRING_TYPE:
return new StringRandomWriter();
case DataType.DATE_TYPE:
return new DateRandomWriter();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomWriter();
case DataType.SQL_DATE_TYPE:
return new DateRandomWriter();
case DataType.SQL_TIME_TYPE:
return new DateRandomWriter();
default :
return null;
}
}

Fixed version (ground truth):
public static IObjectWriter getRandomWriter(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomWriter();
case DataType.INTEGER_TYPE:
  return new IntegerRandomWriter();
case DataType.BYTES_TYPE:
return new BytesRandomWriter();
case DataType.DOUBLE_TYPE:
return new DoubleRandomWriter();
case DataType.STRING_TYPE:
return new StringRandomWriter();
case DataType.DATE_TYPE:
return new DateRandomWriter();
case DataType.BLOB_TYPE:
return new BlobRandomWriter();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomWriter();
case DataType.SQL_DATE_TYPE:
return new DateRandomWriter();
case DataType.SQL_TIME_TYPE:
return new DateRandomWriter();
default :
return null;
}
}
Program: 74449
Project: 74449
Buggy source:
public static IObjectReader getRandomReader(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomReader();
case DataType.INTEGER_TYPE:
  return new IntegerRandomReader();
case DataType.BYTES_TYPE:
return new BytesRandomReader();
case DataType.DOUBLE_TYPE:
return new DoubleRandomReader();
case DataType.STRING_TYPE:
return new StringRandomReader();
case DataType.DATE_TYPE:
return new DateTimeRandomReader();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomReader();
case DataType.SQL_DATE_TYPE:
return new DateRandomReader();
case DataType.SQL_TIME_TYPE:
return new TimeRandomReader();
default :
return null;
}
}

Fixed version (ground truth):
public static IObjectReader getRandomReader(int dataType){
switch (dataType) {
case DataType.BOOLEAN_TYPE:
    return new BooleanRandomReader();
case DataType.INTEGER_TYPE:
  return new IntegerRandomReader();
case DataType.BYTES_TYPE:
return new BytesRandomReader();
case DataType.DOUBLE_TYPE:
return new DoubleRandomReader();
case DataType.STRING_TYPE:
return new StringRandomReader();
case DataType.DATE_TYPE:
return new DateTimeRandomReader();
case DataType.BLOB_TYPE:
return new BlobRandomReader();
case DataType.BIGDECIMAL_TYPE:
return new BigDecimalRandomReader();
case DataType.SQL_DATE_TYPE:
return new DateRandomReader();
case DataType.SQL_TIME_TYPE:
return new TimeRandomReader();
default :
return null;
}
}
Program: 74450
Project: 74450
Buggy source:
protected void drawBackgroundColor(Color color,float x,float y,float width,float height){
  if (null == color) {
    return;
  }
  y=transformY(y,height);
  cbUnder.saveState();
  cbUnder.setColorFill(color);
  cbUnder.rectangle(x,y,width,height);
  cbUnder.fill();
  cbUnder.restoreState();
}

Fixed version (ground truth):
protected void drawBackgroundColor(Color color,float x,float y,float width,float height){
  if (null == color) {
    return;
  }
  y=transformY(y,height);
  contentByte.saveState();
  contentByte.setColorFill(color);
  contentByte.rectangle(x,y,width,height);
  contentByte.fill();
  contentByte.restoreState();
}
Program: 74451
Project: 74451
Buggy source:
public void clipSave(){
  cbUnder.saveState();
  contentByte.saveState();
}

Fixed version (ground truth):
public void clipSave(){
  contentByte.saveState();
}
Program: 74453
Project: 74453
Buggy source:
public void clipRestore(){
  cbUnder.restoreState();
  contentByte.restoreState();
}

Fixed version (ground truth):
public void clipRestore(){
  contentByte.restoreState();
}
Program: 74454
Project: 74454
Buggy source:
public PDFPage(int pageWidth,int pageHeight,Document document,PdfWriter writer,PDFPageDevice pageDevice){
  super(pageWidth,pageHeight);
  this.writer=writer;
  this.pageDevice=pageDevice;
  try {
    Rectangle pageSize=new Rectangle(this.pageWidth,this.pageHeight);
    document.setPageSize(pageSize);
    if (!document.isOpen())     document.open();
 else     document.newPage();
    this.contentByte=writer.getDirectContent();
    this.cbUnder=writer.getDirectContentUnder();
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}

Fixed version (ground truth):
public PDFPage(int pageWidth,int pageHeight,Document document,PdfWriter writer,PDFPageDevice pageDevice){
  super(pageWidth,pageHeight);
  this.writer=writer;
  this.pageDevice=pageDevice;
  try {
    Rectangle pageSize=new Rectangle(this.pageWidth,this.pageHeight);
    document.setPageSize(pageSize);
    if (!document.isOpen())     document.open();
 else     document.newPage();
    this.contentByte=writer.getDirectContent();
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}
Program: 74455
Project: 74455
Buggy source:
protected void clip(float startX,float startY,float width,float height){
  startY=transformY(startY,height);
  contentByte.clip();
  contentByte.rectangle(startX,startY,width,height);
  contentByte.newPath();
  cbUnder.clip();
  cbUnder.rectangle(startX,startY,width,height);
  cbUnder.newPath();
}

Fixed version (ground truth):
protected void clip(float startX,float startY,float width,float height){
  startY=transformY(startY,height);
  contentByte.clip();
  contentByte.rectangle(startX,startY,width,height);
  contentByte.newPath();
}
Program: 74456
Project: 74456
Buggy source:
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
  needClip=true;
}

Fixed version (ground truth):
CellArea(ICellContent cell){
  super(cell);
  removeBorder();
  setDefaultPadding();
  isClippingContainer=true;
}
Program: 74457
Project: 74457
Buggy source:
public boolean needClip(){
  return needClip;
}

Fixed version (ground truth):
public boolean needClip(){
  return isClippingContainer && needClip;
}
Program: 74458
Project: 74458
Buggy source:
public void addChild(IArea area){
  children.add(area);
}

Fixed version (ground truth):
public void addChild(IArea area){
  if (area.getX() < 0 || area.getX() + area.getWidth() > width || area.getY() < 0 || area.getY() + area.getHeight() > height) {
    needClip=true;
  }
  children.add(area);
}
Program: 74459
Project: 74459
Buggy source:
InlineContainerArea(IContent content){
  super(content);
  needClip=true;
}

Fixed version (ground truth):
InlineContainerArea(IContent content){
  super(content);
  needClip=true;
  isClippingContainer=true;
}
Program: 74461
Project: 74461
Buggy source:
protected void parseRunAndRenderOptions() throws Exception {
  assert(mode.equalsIgnoreCase("String_Node_Str"));
  if (results.hasOption('f')) {
    format=results.getOptionValue('f');
  }
  if (results.hasOption('t')) {
    htmlType=results.getOptionValue('t');
  }
  if (results.hasOption('o')) {
    targetFile=results.getOptionValue('o');
  }
  if (results.hasOption('l')) {
    locale=results.getOptionValue('l');
  }
  if (results.hasOption('e')) {
    encoding=results.getOptionValue('e');
  }
  parseParameterOptions();
}

Fixed version (ground truth):
protected void parseRunAndRenderOptions() throws Exception {
  assert(mode.equalsIgnoreCase("String_Node_Str"));
  if (params.get("String_Node_Str") != null) {
    format=(String)params.get("String_Node_Str");
  }
  if (results.hasOption('f')) {
    format=results.getOptionValue('f');
  }
  if (params.get("String_Node_Str") != null) {
    htmlType=(String)params.get("String_Node_Str");
  }
  if (results.hasOption('t')) {
    htmlType=results.getOptionValue('t');
  }
  if (params.get("String_Node_Str") != null) {
    targetFile=(String)params.get("String_Node_Str");
  }
  if (results.hasOption('o')) {
    targetFile=results.getOptionValue('o');
  }
  if (params.get("String_Node_Str") != null) {
    locale=(String)params.get("String_Node_Str");
  }
  if (results.hasOption('l')) {
    locale=results.getOptionValue('l');
  }
  if (params.get("String_Node_Str") != null) {
    encoding=(String)params.get("String_Node_Str");
  }
  if (results.hasOption('e')) {
    encoding=results.getOptionValue('e');
  }
}