nus-yam/ex-repair huggingface dataset:
Program: 69715
Project: 69715
Buggy source:
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    if ((bgi.getXOffset() != 0 || bgi.getYOffset() != 0)) {
      String imageUrl=bgi.getUrl();
      try {
        img=Image.getInstance(new URL(bgi.getUrl()));
      }
 catch (      Exception e) {
        if (SvgFile.isSvg(imageUrl)) {
          try {
            img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
          }
 catch (          Exception ex) {
            logger.log(Level.WARNING,ex.getMessage(),ex);
          }
        }
 else {
          logger.log(Level.WARNING,e.getMessage(),e);
        }
      }
      if (img != null) {
        int resolutionX=img.getDpiX();
        int resolutionY=img.getDpiY();
        if (0 == resolutionX || 0 == resolutionY) {
          resolutionX=96;
          resolutionY=96;
        }
        float imageWidth=img.plainWidth() / resolutionX * 72;
        float imageHeight=img.plainHeight() / resolutionY * 72;
        bgi.setXOffset(bgi.getXOffset() * (width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)) / 100);
        bgi.setYOffset(bgi.getYOffset() * (height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)) / 100);
      }
    }
  }
}

Fixed version (ground truth):
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    if ((bgi.getXOffset() != 0 || bgi.getYOffset() != 0)) {
      String imageUrl=bgi.getUrl();
      try {
        img=Image.getInstance(new URL(bgi.getUrl()));
      }
 catch (      Exception e) {
        if (SvgFile.isSvg(imageUrl)) {
          try {
            img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
          }
 catch (          Exception ex) {
            logger.log(Level.WARNING,ex.getMessage(),ex);
          }
        }
 else {
          logger.log(Level.WARNING,e.getMessage(),e);
        }
      }
      if (img != null) {
        int resolutionX=img.getDpiX();
        int resolutionY=img.getDpiY();
        if (0 == resolutionX || 0 == resolutionY) {
          resolutionX=96;
          resolutionY=96;
        }
        float imageWidth=img.plainWidth() / resolutionX * 72;
        float imageHeight=img.plainHeight() / resolutionY * 72;
        if (content != null) {
          IStyle style=content.getComputedStyle();
          int ox=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),(width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)));
          int oy=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),(height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)));
          bgi.setXOffset(ox);
          bgi.setYOffset(oy);
        }
      }
    }
  }
}
Program: 69717
Project: 69717
Buggy source:
protected void addRows(ContainerArea container,TableLayout layout) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      layout.addRow((RowArea)container,context.isFixedLayout());
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout);
      child.updateChildrenPosition();
    }
  }
}

Fixed version (ground truth):
protected void addRows(ContainerArea container,TableLayout layout) throws BirtException {
  if (container instanceof RowArea) {
    RowArea row=(RowArea)container;
    if (row.needResolveBorder) {
      int size=row.getChildrenCount();
      for (int i=0; i < size; i++) {
        CellArea cell=(CellArea)row.getChild(i);
        int ch=cell.getContentHeight();
        cell.boxStyle.clearBorder();
        layout.resolveBorderConflict(cell,true);
        cell.setContentHeight(ch);
      }
      row.needResolveBorder=false;
    }
    if (row.finished) {
      if (row.getChildrenCount() != row.cells.length) {
        for (int i=0; i < row.cells.length; i++) {
          if (row.cells[i] instanceof DummyCell) {
            row.cells[i]=null;
          }
        }
      }
      int rh=row.getHeight();
      layout.addRow(row,context.isFixedLayout());
      int delta=row.getHeight() - rh;
      if (delta > 0) {
        ContainerArea rowParent=row.getParent();
        if (rowParent != null) {
          rowParent.updateChildrenPosition();
        }
      }
    }
  }
 else {
    int size=container.getChildrenCount();
    for (int i=0; i < size; i++) {
      ContainerArea child=(ContainerArea)container.getChild(i);
      addRows(child,layout);
      child.updateChildrenPosition();
    }
  }
}
Program: 69718
Project: 69718
Buggy source:
public void updateRow(RowArea original){
  int height=0;
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    height=Math.max(height,cell.getHeight());
  }
  this.height=height;
  for (int i=0; i < cells.length; i++) {
    if (cells[i] == null) {
      CellArea oCell=original.getCell(i);
      if (oCell != null && !(oCell instanceof DummyCell)) {
        CellArea nCell=oCell.cloneArea();
        nCell.setHeight(height);
        nCell.setParent(this);
        children.add(nCell);
        i=i + oCell.getColSpan() - 1;
      }
    }
 else {
      cells[i].setHeight(height);
    }
  }
}

Fixed version (ground truth):
public void updateRow(RowArea original){
  int height=0;
  Iterator iter=children.iterator();
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    height=Math.max(height,cell.getHeight());
  }
  this.height=height;
  for (int i=0; i < cells.length; i++) {
    if (cells[i] == null) {
      CellArea oCell=original.getCell(i);
      if (oCell != null && !(oCell instanceof DummyCell)) {
        CellArea nCell=oCell.cloneArea();
        nCell.setHeight(height);
        nCell.setParent(this);
        addChildByColumnId(nCell);
        i=i + oCell.getColSpan() - 1;
      }
    }
 else {
      cells[i].setHeight(height);
    }
  }
}
Program: 69719
Project: 69719
Buggy source:
public void addChildByColumnId(CellArea cell){
  int columnId=cell.getColumnID();
  int index=0;
  for (int i=0; i < children.size(); i++) {
    CellArea current=(CellArea)children.get(i);
    if (current.getColumnID() >= columnId) {
      index=i;
      break;
    }
  }
  children.add(index,cell);
  setCell(cell);
}

Fixed version (ground truth):
public void addChildByColumnId(CellArea cell){
  int columnId=cell.getColumnID();
  int index=0;
  for (int i=0; i < children.size(); i++) {
    CellArea current=(CellArea)children.get(i);
    if (current.getColumnID() >= columnId) {
      index=i;
      children.add(index,cell);
      setCell(cell);
      return;
    }
  }
  children.add(children.size(),cell);
  setCell(cell);
}
Program: 69720
Project: 69720
Buggy source:
/** 
 * convert a object to given class Classes supported: Integer.class BigDecimal.class Boolean.class Time.class Date.class Double.class String.class Blob.class
 * @param source
 * @param toTypeClass
 * @return
 * @throws BirtException
 */
public static Object convert(Object source,Class toTypeClass) throws BirtException {
  if (source != null && source.getClass() == toTypeClass) {
    return source;
  }
  if (toTypeClass == DataType.getClass(DataType.ANY_TYPE))   return source;
  if (toTypeClass == Integer.class)   return toInteger(source);
  if (toTypeClass == BigDecimal.class)   return toBigDecimal(source);
  if (toTypeClass == Boolean.class)   return toBoolean(source);
  if (toTypeClass == Time.class)   return toSqlTime(source);
  if (toTypeClass == java.sql.Date.class)   return toSqlDate(source);
  if (toTypeClass == java.sql.Timestamp.class)   return toDate(source);
  if (toTypeClass == Date.class)   return toDate(source);
  if (toTypeClass == Double.class)   return toDouble(source);
  if (toTypeClass == String.class)   return toString(source);
  if (toTypeClass == Blob.class) {
    if (source instanceof byte[])     return source;
 else     return toBlob(source);
  }
  if (toTypeClass == byte[].class)   return source;
  throw new CoreException(ResourceConstants.INVALID_TYPE,resourceBundle);
}

Fixed version (ground truth):
/** 
 * convert a object to given class Classes supported: Integer.class BigDecimal.class Boolean.class Time.class Date.class Double.class String.class Blob.class
 * @param source
 * @param toTypeClass
 * @return
 * @throws BirtException
 */
public static Object convert(Object source,Class toTypeClass) throws BirtException {
  if (source != null && source.getClass() == toTypeClass) {
    return source;
  }
  if (toTypeClass == DataType.getClass(DataType.ANY_TYPE))   return source;
  if (toTypeClass == Integer.class)   return toInteger(source);
  if (toTypeClass == BigDecimal.class)   return toBigDecimal(source);
  if (toTypeClass == Boolean.class)   return toBoolean(source);
  if (toTypeClass == Time.class)   return toSqlTime(source);
  if (toTypeClass == java.sql.Date.class)   return toSqlDate(source);
  if (toTypeClass == java.sql.Timestamp.class)   return toTimestamp(source);
  if (toTypeClass == Date.class)   return toDate(source);
  if (toTypeClass == Double.class)   return toDouble(source);
  if (toTypeClass == String.class)   return toString(source);
  if (toTypeClass == Blob.class) {
    if (source instanceof byte[])     return source;
 else     return toBlob(source);
  }
  if (toTypeClass == byte[].class)   return source;
  throw new CoreException(ResourceConstants.INVALID_TYPE,resourceBundle);
}
Program: 69721
Project: 69721
Buggy source:
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,java.util.Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}

Fixed version (ground truth):
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}
Program: 69724
Project: 69724
Buggy source:
/** 
 * @param elSD orthogonal series definitions list
 * @param lhmLookup
 */
public void addSeriesDefinitions(EList<SeriesDefinition> elSD,GroupingLookupHelper lhmLookup) throws ChartException {
  for (  SeriesDefinition sdOrthogonal : elSD) {
    Series series=sdOrthogonal.getDesignTimeSeries();
    List<Query> qlist=ChartEngine.instance().getDataSetProcessor(series.getClass()).getDataDefinitionsForGrouping(series);
    String strOrtAgg=lhmLookup.getOrthogonalAggregationExpression(sdOrthogonal);
    for (    Query query : qlist) {
      if (strOrtAgg == null) {
        baseQueryList.add(query.getDefinition());
      }
 else {
        if (query.getGrouping() == null) {
          aggregationExpsList.add(strOrtAgg);
        }
 else {
          aggregationExpsList.add(query.getGrouping().getAggregateExpression());
        }
        querysList.add(query.getDefinition());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param elSD orthogonal series definitions list
 * @param lhmLookup
 */
public void addSeriesDefinitions(EList<SeriesDefinition> elSD,GroupingLookupHelper lhmLookup) throws ChartException {
  for (  SeriesDefinition sdOrthogonal : elSD) {
    Series series=sdOrthogonal.getDesignTimeSeries();
    List<Query> qlist=ChartEngine.instance().getDataSetProcessor(series.getClass()).getDataDefinitionsForGrouping(series);
    String strOrtAgg=lhmLookup.getOrthogonalAggregationExpression(sdOrthogonal);
    for (    Query query : qlist) {
      if (strOrtAgg == null) {
        baseQueryList.add(query.getDefinition());
      }
 else {
        if (query.getGrouping() == null || !query.getGrouping().isEnabled()) {
          aggregationExpsList.add(strOrtAgg);
        }
 else {
          aggregationExpsList.add(query.getGrouping().getAggregateExpression());
        }
        querysList.add(query.getDefinition());
      }
    }
  }
}
Program: 69725
Project: 69725
Buggy source:
public static byte[] getImageData(String imageURI){
  byte[] imageData=null;
  InputStream imageStream=null;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=readData(imageStream);
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
    imageData=null;
  }
 finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return imageData;
}

Fixed version (ground truth):
public static byte[] getImageData(String imageURI){
  byte[] imageData=null;
  if (SvgFile.isSvg(imageURI)) {
    try {
      imageData=SvgFile.transSvgToArray(imageURI);
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 else {
    imageData=getNonSVGImageData(imageURI);
  }
  return imageData;
}
Program: 69726
Project: 69726
Buggy source:
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension){
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          data=SvgFile.transSvgToArray(uri);
        }
 else {
          data=getImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  data=SvgFile.transSvgToArray(in);
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
 finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}

Fixed version (ground truth):
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension){
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          data=SvgFile.transSvgToArray(uri);
        }
 else {
          data=getNonSVGImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  data=SvgFile.transSvgToArray(in);
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
 finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}
Program: 69731
Project: 69731
Buggy source:
private void createImageMap(int[] area,IImageArea imageArea,String url,String targetWindow){
  if (url == null) {
    return;
  }
  ActionContent link=new ActionContent();
  if (isBookmark(url)) {
    String bookmark=getBookmark(url);
    link.setBookmark(bookmark);
  }
 else {
    link.setHyperlink(url,targetWindow);
  }
  area=getAbsoluteArea(area,imageArea);
  createImageMapContainer(area[0],area[1],area[2],area[3],link);
}

Fixed version (ground truth):
private void createImageMap(int[] area,IImageArea imageArea,String url,String targetWindow){
  if (url == null) {
    return;
  }
  url=url.replaceAll("String_Node_Str","String_Node_Str");
  ActionContent link=new ActionContent();
  if (isBookmark(url)) {
    String bookmark=getBookmark(url);
    link.setBookmark(bookmark);
  }
 else {
    link.setHyperlink(url,targetWindow);
  }
  area=getAbsoluteArea(area,imageArea);
  createImageMapContainer(area[0],area[1],area[2],area[3],link);
}
Program: 69732
Project: 69732
Buggy source:
protected void createVariablesCategory(){
  if (variablesItem == null) {
    int idx=getIndex(contextItem);
    variablesItem=createTopTreeItem(tree,"String_Node_Str",idx);
  }
  buildVariableTree();
}

Fixed version (ground truth):
protected void createVariablesCategory(){
  if (variablesItem == null || variablesItem.isDisposed()) {
    int idx=getIndex(contextItem);
    variablesItem=createTopTreeItem(tree,"String_Node_Str",idx);
  }
  buildVariableTree();
}
Program: 69733
Project: 69733
Buggy source:
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}

Fixed version (ground truth):
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,java.util.Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}
Program: 69735
Project: 69735
Buggy source:
private void preview(String uri){
  try {
    if (imageData != null) {
      ByteArrayInputStream bis=new ByteArrayInputStream(Base64.decodeBase64(imageData.getBytes()));
      previewCanvas.loadImage(bis);
    }
 else {
      previewCanvas.loadImage(new URL(uri));
    }
  }
 catch (  Exception e) {
    WizardBase.displayException(e);
  }
}

Fixed version (ground truth):
private void preview(String uri){
  try {
    if (imageData != null) {
      ByteArrayInputStream bis=new ByteArrayInputStream(Base64.decodeBase64(imageData.getBytes()));
      previewCanvas.loadImage(bis);
    }
 else {
      previewCanvas.loadImage(new URL(uri));
    }
  }
 catch (  Exception e) {
    logger.log(e);
  }
}
Program: 69736
Project: 69736
Buggy source:
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(removeQuote(uriEditor.getText().trim()));
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
 else     if (selectedType == URI_TYPE) {
      ImageDescriptor.createFromURL(url).createImage();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}

Fixed version (ground truth):
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(removeQuote(uriEditor.getText().trim()));
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}
Program: 69737
Project: 69737
Buggy source:
/** 
 * Remove the quote if the string enclosed width quote .
 * @param string
 * @return string
 */
public String removeQuote(String string){
  if (string != null && string.trim().length() >= 2 && string.trim().startsWith("String_Node_Str") && string.trim().endsWith("String_Node_Str")) {
    return string.trim().substring(1,string.trim().length() - 1);
  }
  return string.trim();
}

Fixed version (ground truth):
/** 
 * Remove the quote if the string enclosed width quote .
 * @param string
 * @return string
 */
private String removeQuote(String string){
  if (string != null && string.trim().length() >= 2 && string.trim().startsWith("String_Node_Str") && string.trim().endsWith("String_Node_Str")) {
    return string.trim().substring(1,string.trim().length() - 1);
  }
  return string.trim();
}
Program: 69738
Project: 69738
Buggy source:
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,java.util.Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}

Fixed version (ground truth):
private void retrySetDateParamValue(ParameterName paramName,int paramIndex,Date paramValue,int parameterType) throws DataException {
switch (parameterType) {
case Types.CHAR:
{
      Date sqlDate=new Date(paramValue.getTime());
      String s=sqlDate.toString();
      setString(paramName,paramIndex,s);
      return;
    }
case Types.TIME:
{
    Time timeValue=new Time(paramValue.getTime());
    setTime(paramName,paramIndex,timeValue);
    return;
  }
case Types.TIMESTAMP:
{
  Timestamp ts=new Timestamp(paramValue.getTime());
  setTimestamp(paramName,paramIndex,ts);
  return;
}
default :
conversionError(paramName,paramIndex,paramValue,parameterType,null);
return;
}
}
Program: 69740
Project: 69740
Buggy source:
/** 
 * compile the expression from a script tree
 * @param expression
 * @param context
 * @param tree
 * @param columnExprList
 * @throws BirtException
 */
private void CompiledExprFromTree(String expression,Context context,ScriptOrFnNode tree,List columnExprList) throws BirtException {
  if (tree.getFirstChild() == tree.getLastChild()) {
    if (tree.getFirstChild().getType() == Token.FUNCTION) {
      int index=getFunctionIndex(tree.getFirstChild().getString(),tree);
      compileFunctionNode(tree.getFunctionNode(index),tree,columnExprList);
    }
 else {
      if (tree.getFirstChild().getType() != Token.EXPR_RESULT && tree.getFirstChild().getType() != Token.EXPR_VOID && tree.getFirstChild().getType() != Token.BLOCK) {
        throw new CoreException(pluginId,ResourceConstants.INVALID_EXPRESSION);
      }
      Node exprNode=tree.getFirstChild();
      processChild(exprNode,tree,columnExprList);
    }
  }
 else {
    compileComplexExpr(tree,tree,columnExprList);
  }
}

Fixed version (ground truth):
/** 
 * compile the expression from a script tree
 * @param expression
 * @param context
 * @param tree
 * @param columnExprList
 * @throws BirtException
 */
private void CompiledExprFromTree(String expression,Context context,ScriptOrFnNode tree,List columnExprList) throws BirtException {
  if (tree.getFirstChild() == tree.getLastChild()) {
    if (tree.getFirstChild().getType() == Token.FUNCTION) {
      int index=getFunctionIndex(tree.getFirstChild().getString(),tree);
      compileFunctionNode(tree.getFunctionNode(index),tree,columnExprList);
    }
 else {
      if (tree.getFirstChild().getType() != Token.EXPR_RESULT && tree.getFirstChild().getType() != Token.EXPR_VOID && tree.getFirstChild().getType() != Token.BLOCK && tree.getFirstChild().getType() != Token.SCRIPT) {
        throw new CoreException(pluginId,ResourceConstants.INVALID_EXPRESSION);
      }
      Node exprNode=tree.getFirstChild();
      processChild(exprNode,tree,columnExprList);
    }
  }
 else {
    compileComplexExpr(tree,tree,columnExprList);
  }
}
Program: 69741
Project: 69741
Buggy source:
protected CubeCursor getCubeCursor(){
  if (cubeCursor != null) {
    return cubeCursor;
  }
 else   if (parentExecutor instanceof BaseCrosstabExecutor) {
    return ((BaseCrosstabExecutor)parentExecutor).getCubeCursor();
  }
  return null;
}

Fixed version (ground truth):
protected CubeCursor getCubeCursor(){
  if (cubeCursor != null) {
    return cubeCursor;
  }
 else   if (parentExecutor instanceof BaseCrosstabExecutor && !(this instanceof CrosstabReportItemExecutor)) {
    return ((BaseCrosstabExecutor)parentExecutor).getCubeCursor();
  }
  return null;
}
Program: 69742
Project: 69742
Buggy source:
protected ICubeResultSet getCubeResultSet(){
  if (cubeRset != null) {
    return cubeRset;
  }
 else   if (parentExecutor instanceof BaseCrosstabExecutor) {
    return ((BaseCrosstabExecutor)parentExecutor).getCubeResultSet();
  }
  return null;
}

Fixed version (ground truth):
protected ICubeResultSet getCubeResultSet(){
  if (cubeRset != null) {
    return cubeRset;
  }
 else   if (parentExecutor instanceof BaseCrosstabExecutor && !(this instanceof CrosstabReportItemExecutor)) {
    return ((BaseCrosstabExecutor)parentExecutor).getCubeResultSet();
  }
  return null;
}
Program: 69743
Project: 69743
Buggy source:
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(uriEditor.getText().trim());
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}

Fixed version (ground truth):
private void updateButtons(){
  boolean complete=uriEditor.getText() != null && uriEditor.getText().trim().length() > 0;
  URL url=null;
  try {
    url=new URL(removeQuote(uriEditor.getText().trim()));
    if (selectedType == EMBEDDED_TYPE) {
      File file=new File(url.getPath());
      complete=file.exists() && file.isAbsolute();
    }
 else     if (selectedType == URI_TYPE) {
      ImageDescriptor.createFromURL(url).createImage();
    }
  }
 catch (  Exception e) {
    complete=false;
  }
  previewButton.setEnabled(complete);
  getButton(IDialogConstants.OK_ID).setEnabled(complete);
  browseButton.setVisible(embedded.getSelection());
}
Program: 69744
Project: 69744
Buggy source:
/** 
 * Remove the quote if the string enclosed width quote .
 * @param string
 * @return string
 */
public String removeQuote(String string){
  if (string != null && string.length() >= 2 && string.startsWith("String_Node_Str") && string.endsWith("String_Node_Str")) {
    return string.substring(1,string.length() - 1);
  }
  return string;
}

Fixed version (ground truth):
/** 
 * Remove the quote if the string enclosed width quote .
 * @param string
 * @return string
 */
public String removeQuote(String string){
  if (string != null && string.trim().length() >= 2 && string.trim().startsWith("String_Node_Str") && string.trim().endsWith("String_Node_Str")) {
    return string.trim().substring(1,string.trim().length() - 1);
  }
  return string.trim();
}
Program: 69745
Project: 69745
Buggy source:
public ScriptContext(ScriptableObject root){
  try {
    this.context=Context.enter();
    global=new ImporterTopLevel();
    if (root != null) {
      new LazilyLoadedCtor(global,"String_Node_Str","String_Node_Str",false);
      global.exportAsJSClass(3,global,false);
      global.delete("String_Node_Str");
      global.setPrototype(root);
    }
 else {
      global.initStandardObjects(context,true);
    }
    this.scope=global;
    sharedScope=context.newObject(scope);
    sharedScope.setParentScope(scope);
  }
 catch (  Exception ex) {
    Context.exit();
    this.scope=null;
    this.context=null;
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,ex.getMessage());
    }
  }
}

Fixed version (ground truth):
public ScriptContext(ScriptableObject root){
  try {
    this.context=Context.enter();
    global=new ImporterTopLevel();
    if (root != null) {
      new LazilyLoadedCtor(global,"String_Node_Str","String_Node_Str",false);
      global.exportAsJSClass(3,global,false);
      global.delete("String_Node_Str");
      global.setPrototype(root);
    }
 else {
      global.initStandardObjects(context,true);
    }
    if (global.get(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.FUNCITON_BEAN_NAME,global) == org.mozilla.javascript.UniqueTag.NOT_FOUND) {
      IScriptFunctionContext functionContext=new IScriptFunctionContext(){
        public Object findProperty(        String name){
          return propertyMap.get(name);
        }
      }
;
      Object sObj=Context.javaToJS(functionContext,global);
      global.put(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.FUNCITON_BEAN_NAME,global,sObj);
    }
    this.scope=global;
    sharedScope=context.newObject(scope);
    sharedScope.setParentScope(scope);
  }
 catch (  Exception ex) {
    Context.exit();
    this.scope=null;
    this.context=null;
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,ex.getMessage());
    }
  }
}
Program: 69746
Project: 69746
Buggy source:
/** 
 * The Calendar by default will give you an instance of current time. This is however not expected. The method clear() has to be invoked to re-init the Calendar instance.
 * @return
 */
private static Calendar getClearedCalendarInstance(int year,int month,int date){
  Calendar c=Calendar.getInstance();
  c.clear();
  c.set(year,month,date);
  return c;
}

Fixed version (ground truth):
/** 
 * The Calendar by default will give you an instance of current time. This is however not expected. The method clear() has to be invoked to re-init the Calendar instance.
 * @return
 */
private static Calendar getClearedCalendarInstance(int year,int month,int date){
  Calendar c=Calendar.getInstance(timeZone);
  c.clear();
  c.set(year,month,date);
  return c;
}
Program: 69747
Project: 69747
Buggy source:
/** 
 * @param d
 * @return
 */
private static Calendar getCalendar(Date d){
  Calendar c=Calendar.getInstance();
  if (d == null) {
    c.clear();
    c.set(1970,0,1);
  }
 else {
    c.setTime(d);
  }
  return c;
}

Fixed version (ground truth):
/** 
 * @param d
 * @return
 */
private static Calendar getCalendar(Date d){
  Calendar c=Calendar.getInstance(timeZone);
  if (d == null) {
    c.clear();
    c.set(1970,0,1);
  }
 else {
    c.setTime(d);
  }
  return c;
}
Program: 69748
Project: 69748
Buggy source:
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  scriptContext=context;
  if (scriptContext != null) {
    ULocale locale=(ULocale)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE);
    if (defaultLocale != null && !defaultLocale.equals(locale)) {
      abbrMonthFormat=null;
      monthFormat=null;
      abbrWeekFormat=null;
      weekFormat=null;
      defaultLocale=locale;
    }
 else     defaultLocale=locale;
  }
  return this.executor.execute(arguments,context);
}

Fixed version (ground truth):
public Object execute(Object[] arguments,IScriptFunctionContext context) throws BirtException {
  scriptContext=context;
  if (scriptContext != null) {
    ULocale locale=(ULocale)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE);
    if (defaultLocale != locale) {
      abbrMonthFormat=null;
      monthFormat=null;
      abbrWeekFormat=null;
      weekFormat=null;
      defaultLocale=locale;
    }
    timeZone=(TimeZone)scriptContext.findProperty(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.TIMEZONE);
  }
  return this.executor.execute(arguments,context);
}
Program: 69749
Project: 69749
Buggy source:
/** 
 * Returns a timestamp value which is midnight of the current date.
 * @return
 */
private static Date today(){
  Calendar calendar=Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.clear(Calendar.MINUTE);
  calendar.clear(Calendar.SECOND);
  calendar.clear(Calendar.MILLISECOND);
  return calendar.getTime();
}

Fixed version (ground truth):
/** 
 * Returns a timestamp value which is midnight of the current date.
 * @return
 */
private static Date today(){
  Calendar calendar=Calendar.getInstance(timeZone);
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.clear(Calendar.MINUTE);
  calendar.clear(Calendar.SECOND);
  calendar.clear(Calendar.MILLISECOND);
  return calendar.getTime();
}
Program: 69750
Project: 69750
Buggy source:
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer,ClassLoader classLoader,ScriptContext context) throws BirtException {
  Object[] params={new Integer(mode),scope,reader,writer,classLoader};
  logger.entering(DataEngineContext.class.getName(),"String_Node_Str",params);
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.classLoader=classLoader;
  this.mode=mode;
  this.scope=newSubScope(scope,context);
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
  this.scriptContext=context;
  this.currentLocale=ULocale.getDefault();
  this.currentTimeZone=TimeZone.getDefault();
  logger.exiting(DataEngineContext.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param mode
 * @param scope
 * @param reader
 * @param writer
 * @throws BirtException
 */
private DataEngineContext(int mode,Scriptable scope,IDocArchiveReader reader,IDocArchiveWriter writer,ClassLoader classLoader,ScriptContext context) throws BirtException {
  Object[] params={new Integer(mode),scope,reader,writer,classLoader};
  logger.entering(DataEngineContext.class.getName(),"String_Node_Str",params);
  if (!(mode == MODE_GENERATION || mode == MODE_PRESENTATION || mode == DIRECT_PRESENTATION || mode == MODE_UPDATE))   throw new DataException(ResourceConstants.RD_INVALID_MODE);
  if (writer == null && mode == MODE_GENERATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_PRESENTATION)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  if (reader == null && mode == MODE_UPDATE)   throw new DataException(ResourceConstants.RD_INVALID_ARCHIVE);
  this.classLoader=classLoader;
  this.mode=mode;
  this.scope=scope;
  this.reader=reader;
  this.writer=writer;
  this.cacheOption=CACHE_USE_DEFAULT;
  this.scriptContext=context;
  this.currentLocale=ULocale.getDefault();
  this.currentTimeZone=TimeZone.getDefault();
  logger.exiting(DataEngineContext.class.getName(),"String_Node_Str");
}
Program: 69751
Project: 69751
Buggy source:
/** 
 * @param locale The current task's locale
 */
public void setLocale(Locale locale){
  currentLocale=ULocale.forLocale(locale);
  propertyMap.put(org.eclipse.birt.core.script.functionservice.IScriptFunctionContext.LOCALE,currentLocale);
  DataException.setLocale(currentLocale);
}

Fixed version (ground truth):
/** 
 * @param locale The current task's locale
 */
public void setLocale(Locale locale){
  currentLocale=ULocale.forLocale(locale);
  DataException.setLocale(currentLocale);
}
Program: 69752
Project: 69752
Buggy source:
public void setTimeZone(TimeZone timeZone){
  this.timeZone=timeZone;
}

Fixed version (ground truth):
public void setTimeZone(TimeZone timeZone){
  this.timeZone=timeZone;
  this.getScriptContext().setTimeZone(timeZone);
}
Program: 69753
Project: 69753
Buggy source:
/** 
 * @param locale The locale to set.
 */
public void setLocale(Locale locale){
  this.locale=locale;
  if (scriptContext != null) {
    scriptContext.getContext().setLocale(locale);
  }
}

Fixed version (ground truth):
/** 
 * @param locale The locale to set.
 */
public void setLocale(Locale locale){
  this.locale=locale;
  this.getScriptContext().setLocale(locale);
}
Program: 69754
Project: 69754
Buggy source:
/** 
 * @param type: a Data Engine data type
 * @return Data Engine data types compatible with <code>type</code>, including <code>type</code> itself
 * @throws exception if <code>DataType.ANY_TYPE</code>, <code>DataType.UNKNOWN_TYPE</code> or other unsupported int value is passed into
 */
public static int[] getCompatibleDataTypes(int type) throws AdapterException {
switch (type) {
case DataType.BOOLEAN_TYPE:
    return new int[]{DataType.BOOLEAN_TYPE};
case DataType.INTEGER_TYPE:
  return new int[]{DataType.INTEGER_TYPE};
case DataType.DOUBLE_TYPE:
return new int[]{DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.DECIMAL_TYPE:
return new int[]{DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.STRING_TYPE:
return new int[]{DataType.STRING_TYPE,DataType.BOOLEAN_TYPE,DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE,DataType.DATE_TYPE,DataType.BLOB_TYPE,DataType.BINARY_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.DATE_TYPE:
return new int[]{DataType.DATE_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.BLOB_TYPE:
return new int[]{DataType.BLOB_TYPE};
case DataType.BINARY_TYPE:
return new int[]{DataType.BINARY_TYPE};
case DataType.SQL_DATE_TYPE:
return new int[]{DataType.SQL_DATE_TYPE,DataType.DATE_TYPE};
case DataType.SQL_TIME_TYPE:
return new int[]{DataType.SQL_TIME_TYPE};
default :
throw new AdapterException(ResourceConstants.INVALID_DATA_TYPE,type);
}
}

Fixed version (ground truth):
/** 
 * @param type: a Data Engine data type
 * @return Data Engine data types compatible with <code>type</code>, including <code>type</code> itself
 * @throws exception if <code>DataType.ANY_TYPE</code>, <code>DataType.UNKNOWN_TYPE</code> or other unsupported int value is passed into
 */
public static int[] getCompatibleDataTypes(int type) throws AdapterException {
switch (type) {
case DataType.BOOLEAN_TYPE:
    return new int[]{DataType.BOOLEAN_TYPE};
case DataType.INTEGER_TYPE:
  return new int[]{DataType.INTEGER_TYPE};
case DataType.DOUBLE_TYPE:
return new int[]{DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.DECIMAL_TYPE:
return new int[]{DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE};
case DataType.STRING_TYPE:
return new int[]{DataType.STRING_TYPE,DataType.BOOLEAN_TYPE,DataType.DECIMAL_TYPE,DataType.DOUBLE_TYPE,DataType.INTEGER_TYPE,DataType.DATE_TYPE,DataType.BLOB_TYPE,DataType.BINARY_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.DATE_TYPE:
return new int[]{DataType.DATE_TYPE,DataType.SQL_DATE_TYPE,DataType.SQL_TIME_TYPE};
case DataType.BLOB_TYPE:
return new int[]{DataType.BLOB_TYPE};
case DataType.BINARY_TYPE:
return new int[]{DataType.BINARY_TYPE};
case DataType.SQL_DATE_TYPE:
return new int[]{DataType.SQL_DATE_TYPE,DataType.DATE_TYPE};
case DataType.SQL_TIME_TYPE:
return new int[]{DataType.SQL_TIME_TYPE,DataType.DATE_TYPE};
default :
throw new AdapterException(ResourceConstants.INVALID_DATA_TYPE,type);
}
}
Program: 69755
Project: 69755
Buggy source:
private ExpressionButton createExpressionButton(Composite composite,final Text property){
  ExpressionButton exprButton=UIUtil.createExpressionButton(composite,SWT.PUSH);
  if (handle == null) {
    handle=DesignElementFactory.getInstance(getModuleHandle()).newOdaDataSet(null);
  }
  IExpressionHelper helper=new IExpressionHelper(){
    public String getExpression(){
      if (property != null)       return property.getText();
 else       return "String_Node_Str";
    }
    public void setExpression(    String expression){
      if (property != null)       property.setText(expression);
    }
    public void notifyExpressionChangeEvent(    String oldExpression,    String newExpression){
    }
    public IExpressionProvider getExpressionProvider(){
      return new ExpressionProvider(handle);
    }
    public String getExpressionType(){
      return (String)property.getData(DataUIConstants.EXPR_TYPE);
    }
    public void setExpressionType(    String exprType){
      property.setData(DataUIConstants.EXPR_TYPE,exprType);
    }
  }
;
  exprButton.setExpressionHelper(helper);
  buttonList.add(exprButton);
  return exprButton;
}

Fixed version (ground truth):
private void createExpressionButton(Composite composite,final Text property,String propName){
  ExpressionButton exprButton=UIUtil.createExpressionButton(composite,SWT.PUSH);
  if (handle == null) {
    handle=DesignElementFactory.getInstance(getModuleHandle()).newOdaDataSet(null);
  }
  IExpressionHelper helper=new IExpressionHelper(){
    public String getExpression(){
      if (property != null)       return property.getText();
 else       return "String_Node_Str";
    }
    public void setExpression(    String expression){
      if (property != null)       property.setText(expression);
    }
    public void notifyExpressionChangeEvent(    String oldExpression,    String newExpression){
    }
    public IExpressionProvider getExpressionProvider(){
      return new ExpressionProvider(handle);
    }
    public String getExpressionType(){
      return (String)property.getData(DataUIConstants.EXPR_TYPE);
    }
    public void setExpressionType(    String exprType){
      property.setData(DataUIConstants.EXPR_TYPE,exprType);
    }
  }
;
  exprButton.setExpressionHelper(helper);
  Expression expr=handle.getPropertyBindingExpression(propName);
  property.setData(DataUIConstants.EXPR_BUTTON,exprButton);
  property.setText((expr == null || expr.getStringExpression() == null) ? "String_Node_Str" : expr.getStringExpression());
  if (expr != null)   property.setData(DataUIConstants.EXPR_TYPE,expr.getType());
  exprButton=(ExpressionButton)property.getData(DataUIConstants.EXPR_BUTTON);
  if (exprButton != null)   exprButton.refresh();
}
Program: 69756
Project: 69756
Buggy source:
public boolean performOk(){
  for (int i=0; i < bindingName.size(); i++) {
    try {
      String value=null;
      Text propertyText=(Text)propertyTextList.get(i);
      if (propertyText.isDisposed() || propertyText.getText() == null || propertyText.getText().trim().length() == 0)       value=null;
 else       value=propertyText.getText().trim();
      Expression expr=new Expression(value,(String)propertyText.getData(DataUIConstants.EXPR_TYPE));
      if (ds instanceof DataSourceHandle)       ((DataSourceHandle)ds).setPropertyBinding((String)bindingName.get(i),value);
 else       if (ds instanceof DataSetHandle)       ((DataSetHandle)ds).setPropertyBinding((String)bindingName.get(i),expr);
    }
 catch (    SemanticException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  return super.performOk();
}

Fixed version (ground truth):
public boolean performOk(){
  for (int i=0; i < bindingName.size(); i++) {
    try {
      String value=null;
      Text propertyText=(Text)propertyTextList.get(i);
      if (!propertyText.isDisposed() && propertyText.getText() != null && propertyText.getText().trim().length() > 0) {
        value=propertyText.getText().trim();
      }
      Expression expr=new Expression(value,(String)propertyText.getData(DataUIConstants.EXPR_TYPE));
      if (ds instanceof DesignElementHandle) {
        ((DesignElementHandle)ds).setPropertyBinding((String)bindingName.get(i),expr);
      }
    }
 catch (    SemanticException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
  return super.performOk();
}
Program: 69763
Project: 69763
Buggy source:
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  Data newData=new Data(data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(newData);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
  lastData=data;
}

Fixed version (ground truth):
private void addData(SheetData data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getSizeInfo().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getSizeInfo().getEndCoordinate()) - col;
  applyTopBorderStyle(data);
  outputDataIfBufferIsFull();
  updataRowIndex(data,container);
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    BlankData blankData=new BlankData(data);
    addDatatoCache(i,blankData);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
  lastData=data;
}
Program: 69764
Project: 69764
Buggy source:
protected TextArea createTextArea(IAutoTextContent content,FontInfo fontInfo,boolean blankLine){
  TextStyle textStyle=TextAreaLayout.buildTextStyle(content,fontInfo);
  String text=content.getText();
  TextArea area=new TextArea(text,textStyle);
  area.setTextLength(text.length());
  return area;
}

Fixed version (ground truth):
protected TextArea createTextArea(IAutoTextContent content,FontInfo fontInfo,boolean blankLine){
  TextStyle textStyle=TextAreaLayout.buildTextStyle(content,fontInfo);
  String text=content.getText();
  TextArea area=new TextArea(text,textStyle);
  area.setTextLength(text.length());
  area.setAction(content.getHyperlinkAction());
  return area;
}