nus-yam/ex-repair huggingface dataset:
Program: 67537
Project: 67537
Buggy source:
protected void update() throws BirtException {
  if (parent != null) {
    if (context.isFixedLayout() && getContentHeight() > specifiedHeight && specifiedHeight > 0) {
      setContentHeight(specifiedHeight);
      setNeedClip(true);
    }
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      int size=children.size();
      if ((aHeight + parent.getAbsoluteBP() > context.getMaxBP()) && (size > 1)) {
        IStyle style=content.getComputedStyle();
        int widow=Math.min(size,PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_WIDOWS)));
        int orphan=Math.min(size,PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_ORPHANS)));
        for (int i=0; i < size; i++) {
          TextLineArea line=(TextLineArea)children.get(i);
          if (i > 0 && i < orphan) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
 else           if (i > size - widow) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
        }
      }
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        parent.autoPageBreak();
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
}

Fixed version (ground truth):
protected void update() throws BirtException {
  if (parent != null) {
    if (context.isFixedLayout() && getContentHeight() > specifiedHeight && specifiedHeight > 0) {
      setContentHeight(specifiedHeight);
      setNeedClip(true);
    }
    if (!isInInlineStacking && context.isAutoPageBreak()) {
      int aHeight=getAllocatedHeight();
      int size=children.size();
      if ((aHeight + parent.getAbsoluteBP() > context.getMaxBP()) && (size > 1)) {
        IStyle style=content.getComputedStyle();
        int widow=Math.min(size,PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_WIDOWS)));
        int orphan=Math.min(size,PropertyUtil.getIntValue(style.getProperty(IStyle.STYLE_ORPHANS)));
        for (int i=0; i < size; i++) {
          TextLineArea line=(TextLineArea)children.get(i);
          if (i > 0 && i < orphan) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
 else           if (i > size - widow) {
            line.setPageBreakBefore(IStyle.AVOID_VALUE);
          }
        }
      }
      while (aHeight + parent.getAbsoluteBP() >= context.getMaxBP()) {
        if (!parent.autoPageBreak()) {
          break;
        }
        aHeight=getAllocatedHeight();
      }
    }
    parent.update(this);
  }
}
Program: 67538
Project: 67538
Buggy source:
public void autoPageBreak() throws BirtException {
  if (parent != null) {
    parent.autoPageBreak();
  }
}

Fixed version (ground truth):
public boolean autoPageBreak() throws BirtException {
  if (context.isFixedLayout() && specifiedHeight + parent.getAbsoluteBP() <= context.getMaxBP()) {
    return false;
  }
  if (parent != null) {
    return parent.autoPageBreak();
  }
  return false;
}
Program: 67539
Project: 67539
Buggy source:
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() - 3000 > context.getMaxBP()) {
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}

Fixed version (ground truth):
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() - 3000 > context.getMaxBP()) {
      if (!parent.autoPageBreak()) {
        return false;
      }
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}
Program: 67540
Project: 67540
Buggy source:
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() > context.getMaxBP()) {
      addLineBreakToExtension();
      parent.autoPageBreak();
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}

Fixed version (ground truth):
protected boolean checkPageBreak() throws BirtException {
  boolean ret=false;
  if (!isInInlineStacking && context.isAutoPageBreak()) {
    int aHeight=getAllocatedHeight();
    while (aHeight + parent.getAbsoluteBP() > context.getMaxBP()) {
      addLineBreakToExtension();
      if (!parent.autoPageBreak()) {
        return false;
      }
      aHeight=getAllocatedHeight();
      ret=true;
    }
  }
  return ret;
}
Program: 67541
Project: 67541
Buggy source:
public void autoPageBreak() throws BirtException {
  int height=context.getMaxBP();
  SplitResult result=split(height,false);
  if (result == SplitResult.BEFORE_AVOID_WITH_NULL || result == SplitResult.SUCCEED_WITH_NULL) {
    result=split(height,true);
  }
  if (result.getResult() != null) {
    page.setBody(result.getResult());
    page.close();
  }
  updateChildrenPosition();
  initialize();
}

Fixed version (ground truth):
public boolean autoPageBreak() throws BirtException {
  int height=context.getMaxBP();
  SplitResult result=split(height,false);
  if (result == SplitResult.BEFORE_AVOID_WITH_NULL || result == SplitResult.SUCCEED_WITH_NULL) {
    result=split(height,true);
  }
  if (result.getResult() != null) {
    page.setBody(result.getResult());
    page.close();
  }
  updateChildrenPosition();
  initialize();
  return true;
}
Program: 67543
Project: 67543
Buggy source:
public String getLabel(){
  return defaultValue;
}

Fixed version (ground truth):
public String getLabel(){
  return defaultValue.toString();
}
Program: 67544
Project: 67544
Buggy source:
public Object getValue(){
  return value == null ? defaultValue : value;
}

Fixed version (ground truth):
public Object getValue(){
  return defaultValue;
}
Program: 67546
Project: 67546
Buggy source:
private void checkParam(final String defaultValue,final Object value,List list){
  if (!performed) {
    boolean contains=false;
    for (int i=0; i < list.size(); i++) {
      try {
        if (((IParameterSelectionChoice)(list.get(i))).getValue().toString().equals(defaultValue) || ((IParameterSelectionChoice)(list.get(i))).getValue().toString().equals(DEUtil.removeQuote(defaultValue))) {
          contains=true;
          break;
        }
      }
 catch (      Exception e) {
      }
    }
    if (!contains && defaultValue != null) {
      IParameterSelectionChoice choice=new IParameterSelectionChoice(){
        public String getLabel(){
          return defaultValue;
        }
        public Object getValue(){
          return value == null ? defaultValue : value;
        }
      }
;
      list.add(choice);
    }
  }
}

Fixed version (ground truth):
private void checkParam(final Object defaultValue,List list){
  if (!performed) {
    boolean contains=false;
    for (int i=0; i < list.size(); i++) {
      try {
        Object obj=((IParameterSelectionChoice)(list.get(i))).getValue();
        if (obj == null) {
          continue;
        }
        if (obj.equals(defaultValue)) {
          contains=true;
          break;
        }
      }
 catch (      Exception e) {
      }
    }
    if (!contains && defaultValue != null) {
      IParameterSelectionChoice choice=new IParameterSelectionChoice(){
        public String getLabel(){
          return defaultValue.toString();
        }
        public Object getValue(){
          return defaultValue;
        }
      }
;
      list.add(choice);
    }
  }
}
Program: 67547
Project: 67547
Buggy source:
private void cascadingParamValueChanged(CascadingParameterGroup group,ListingParameter listParam){
  clearPostParamList(group,listParam);
  if (postParamLists.containsKey(listParam) && paramValues.containsKey(listParam.getHandle().getName())) {
    Object value=paramValues.get(listParam.getHandle().getName());
    listParam.setSelectionValue(value);
    ListingParameter postParam=(ListingParameter)group.getPostParameter(listParam);
    Control control=postParamLists.get(listParam);
    setControlItems(control,new String[0]);
    for (Iterator iterator=postParam.getValueList().iterator(); iterator.hasNext(); ) {
      IParameterSelectionChoice choice=(IParameterSelectionChoice)iterator.next();
      String label=(choice.getLabel() == null ? String.valueOf(choice.getValue()) : choice.getLabel());
      if (label != null) {
        addControlItem(control,label);
        control.setData(label,choice.getValue());
      }
    }
  }
}

Fixed version (ground truth):
private void cascadingParamValueChanged(CascadingParameterGroup group,ListingParameter listParam){
  clearPostParamList(group,listParam);
  if (postParamLists.containsKey(listParam) && paramValues.containsKey(listParam.getHandle().getName())) {
    Object value=paramValues.get(listParam.getHandle().getName());
    listParam.setSelectionValue(value);
    ListingParameter postParam=(ListingParameter)group.getPostParameter(listParam);
    if (postParam == null) {
      return;
    }
    Control control=postParamLists.get(listParam);
    setControlItems(control,new String[0]);
    for (Iterator iterator=postParam.getValueList().iterator(); iterator.hasNext(); ) {
      IParameterSelectionChoice choice=(IParameterSelectionChoice)iterator.next();
      if (choice.getValue() == null) {
        continue;
      }
      String label=(choice.getLabel() == null ? String.valueOf(choice.getValue()) : choice.getLabel());
      if (label != null) {
        addControlItem(control,label);
        control.setData(label,choice.getValue());
      }
    }
    processPostParator(postParam,control);
    cascadingParamValueChanged(group,postParam);
  }
}
Program: 67548
Project: 67548
Buggy source:
public List getDefaultValues(){
  return handle.getDefaultValueList();
}

Fixed version (ground truth):
public List getDefaultValues(){
  IGetParameterDefinitionTask task=engineTask.getEngine().createGetParameterDefinitionTask(engineTask.getReportRunnable());
  Object obj=task.getDefaultValue(handle.getName());
  List retValue=new ArrayList();
  if (obj == null) {
    return retValue;
  }
  if (obj instanceof Object[]) {
    Object[] objs=(Object[])obj;
    for (int i=0; i < objs.length; i++) {
      retValue.add(objs[i]);
    }
  }
 else   if (obj instanceof Collection) {
    Collection collection=(Collection)obj;
    Iterator itor=collection.iterator();
    while (itor.hasNext()) {
      retValue.add(itor.next());
    }
  }
 else {
    retValue.add(obj);
  }
  return retValue;
}
Program: 67549
Project: 67549
Buggy source:
/** 
 * Gets default value.
 * @return default value
 */
public String getDefaultValue(){
  return handle.getDefaultValue();
}

Fixed version (ground truth):
/** 
 * Gets default value.
 * @return default value
 */
public String getDefaultValue(){
  IGetParameterDefinitionTask task=engineTask.getEngine().createGetParameterDefinitionTask(engineTask.getReportRunnable());
  Object obj=task.getDefaultValue(handle.getName());
  if (obj == null) {
    return null;
  }
  if (obj instanceof Object[]) {
    Object[] objs=(Object[])obj;
    if (objs.length > 0) {
      return objs[0].toString();
    }
 else {
      return null;
    }
  }
  return obj.toString();
}
Program: 67550
Project: 67550
Buggy source:
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    Object paramObj=paramBindingIt.next();
    if (paramObj instanceof ParamBindingHandle) {
      ParamBindingHandle paramBinding=(ParamBindingHandle)paramObj;
      if (paramBinding.getExpression() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
 else     if (paramObj instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle paramBinding=(OdaDataSetParameterHandle)paramObj;
      if (paramBinding.getDefaultValue() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getDefaultValue());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
  }
  return parameterBindings;
}

Fixed version (ground truth):
/** 
 * @param paramBindingIt
 * @return
 */
private List convertParamterBindings(Iterator paramBindingIt){
  if (paramBindingIt == null)   return null;
  List parameterBindings=new ArrayList();
  while (paramBindingIt.hasNext()) {
    Object paramObj=paramBindingIt.next();
    if (paramObj instanceof ParamBindingHandle) {
      ParamBindingHandle paramBinding=(ParamBindingHandle)paramObj;
      if (paramBinding.getExpression() != null) {
        ScriptExpression paramValueExpr=new ScriptExpression(paramBinding.getExpression());
        InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getParamName(),paramValueExpr);
        parameterBindings.add(inputParamBinding);
      }
    }
 else     if (paramObj instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle paramBinding=(OdaDataSetParameterHandle)paramObj;
      ExpressionHandle handle=paramBinding.getExpressionProperty(DataSetParameter.DEFAULT_VALUE_MEMBER);
      InputParameterBinding inputParamBinding=new InputParameterBinding(paramBinding.getName(),this.session.getModelAdaptor().adaptExpression((Expression)handle.getValue()));
      parameterBindings.add(inputParamBinding);
    }
  }
  return parameterBindings;
}
Program: 67552
Project: 67552
Buggy source:
private void setCollate(boolean collate){
  if (collate) {
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setCollate(boolean collate){
  if (collate) {
    out.println("String_Node_Str");
    out.println("String_Node_Str");
    out.println("String_Node_Str");
  }
}
Program: 67553
Project: 67553
Buggy source:
protected static void normalize(Table table,TableContent tableContent,TableState tableState){
  ReportContent report=(ReportContent)tableContent.getReportContent();
  for (int i=0; i < table.getRowCount(); i++) {
    Row row=table.getRow(i);
    RowContent rowContent=(RowContent)row.getContent();
    Collection children=rowContent.getChildren();
    children.clear();
    for (int j=0; j < table.getColCount(); j++) {
      Cell cell=row.getCell(j);
      CellContent cellContent=null;
      int status=cell.getStatus();
      if (status == Cell.CELL_EMPTY || status == Cell.CELL_SPANED) {
        cellContent=(CellContent)report.createCellContent();
        cellContent.setRowSpan(1);
        cellContent.setColSpan(1);
        cellContent.setColumn(j);
      }
 else       if (status == Cell.CELL_USED) {
        cellContent=((InternalCellContent)cell.getContent()).cell;
        cellContent.setColSpan(cell.getColSpan());
        cellContent.setRowSpan(cell.getRowSpan());
        cellContent.setColumn(j);
      }
      children.add(cellContent);
      cellContent.setParent(rowContent);
    }
  }
  for (int i=0; i < table.getColCount(); i++) {
    Column column=new Column(report);
    column.setWidth(tableState.getColumnWidth(i));
    tableContent.addColumn(column);
  }
}

Fixed version (ground truth):
protected static void normalize(Table table,TableContent tableContent,TableState tableState){
  ReportContent report=(ReportContent)tableContent.getReportContent();
  for (int i=0; i < table.getRowCount(); i++) {
    Row row=table.getRow(i);
    RowContent rowContent=(RowContent)row.getContent();
    Collection children=rowContent.getChildren();
    children.clear();
    for (int j=0; j < table.getColCount(); j++) {
      Cell cell=row.getCell(j);
      CellContent cellContent=null;
      int status=cell.getStatus();
      if (status == Cell.CELL_EMPTY || status == Cell.CELL_SPANED) {
        cellContent=(CellContent)report.createCellContent();
        cellContent.setRowSpan(1);
        cellContent.setColSpan(1);
        cellContent.setColumn(j);
      }
 else       if (status == Cell.CELL_USED) {
        cellContent=((InternalCellContent)cell.getContent()).cell;
        cellContent.setColSpan(cell.getColSpan());
        cellContent.setRowSpan(cell.getRowSpan());
        cellContent.setColumn(j);
      }
      children.add(cellContent);
      cellContent.setParent(rowContent);
    }
  }
}
Program: 67554
Project: 67554
Buggy source:
public TableState(Element element,Map<Element,StyleProperties> cssStyles,IContent parent,ActionContent action){
  super(element,cssStyles,action);
  content=(TableContent)parent.getReportContent().createTableContent();
  setParent(parent);
  content.setWidth(PropertyUtil.getDimensionAttribute(element,PROPERTY_WIDTH));
  HTML2Content.handleStyle(element,cssStyles,content);
  processCellStyle(element,cssStyles);
  columnWidth=new ArrayList();
}

Fixed version (ground truth):
public TableState(Element element,Map<Element,StyleProperties> cssStyles,IContent parent,ActionContent action){
  super(element,cssStyles,action);
  content=(TableContent)parent.getReportContent().createTableContent();
  table=(TableContent)content;
  setParent(parent);
  content.setWidth(PropertyUtil.getDimensionAttribute(element,PROPERTY_WIDTH));
  HTML2Content.handleStyle(element,cssStyles,content);
  processCellStyle(element,cssStyles);
}
Program: 67555
Project: 67555
Buggy source:
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  if (CubeHandleUtil.defineCube(this.dataEngine,cubeHandle,this.sessionContext.getAppContext()))   return;
  Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
  Iterator itr=involvedDataSets.iterator();
  while (itr.hasNext()) {
    DataSetHandle dsHandle=(DataSetHandle)itr.next();
    BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
    BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
    if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)     this.defineDataSource(baseDataSource);
    if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null)     this.defineDataSet(baseDataSet);
  }
  if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
    this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
  }
}

Fixed version (ground truth):
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  if (CubeHandleUtil.defineCube(this.dataEngine,cubeHandle,this.sessionContext.getAppContext()))   return;
  Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
  Iterator itr=involvedDataSets.iterator();
  while (itr.hasNext()) {
    DataSetHandle dsHandle=(DataSetHandle)itr.next();
    BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
    BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
    if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)     this.defineDataSource(baseDataSource);
    if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
      DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
    }
  }
  if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
    this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
  }
}
Program: 67557
Project: 67557
Buggy source:
public void dataEngineShutdown(){
  if (session.getNamingRelation() == null) {
    return;
  }
  final int mode=session.getEngineContext().getMode();
  if (mode == DataEngineContext.MODE_GENERATION || mode == DataEngineContext.MODE_UPDATE) {
    try {
      saveNamingRelation(session.getNamingRelation());
    }
 catch (    DataException e1) {
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void dataEngineShutdown(){
  if (session.getNamingRelation() == null) {
    return;
  }
  if (session.getEngineContext().getDocWriter() != null) {
    try {
      saveNamingRelation(session.getNamingRelation());
    }
 catch (    DataException e1) {
      e1.printStackTrace();
    }
  }
}
Program: 67558
Project: 67558
Buggy source:
double roundValue(double value){
  if (roundPrecision >= 0) {
    BigDecimal bd=BigDecimal.valueOf(value);
    int scale=bd.scale();
    if (scale > roundPrecision) {
      bd=bd.setScale(roundPrecision,roundingMode);
      return bd.doubleValue();
    }
  }
  return value;
}

Fixed version (ground truth):
double roundValue(double value){
  if (roundPrecision >= 0) {
    BigDecimal bd=BigDecimal.valueOf(value);
    int scale=bd.scale();
    try {
      if (scale > roundPrecision) {
        bd=bd.setScale(roundPrecision,roundingMode);
        return bd.doubleValue();
      }
    }
 catch (    ArithmeticException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
      return value;
    }
  }
  return value;
}
Program: 67559
Project: 67559
Buggy source:
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  setPaperSize(paperSize);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  FileUtil.load("String_Node_Str",out);
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution,boolean gray) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  setPaperSize(paperSize);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(gray);
  FileUtil.load("String_Node_Str",out);
}
Program: 67560
Project: 67560
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean gray=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_GRAY,false);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,gray);
}
Program: 67561
Project: 67561
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer(null,null,null,1,false);
  writer.startPage(pageWidth,pageHeight);
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  cells[0]=new CellArea(10,10,40,40);
  cells[1]=new CellArea(50,10,40,40);
  cells[2]=new CellArea(90,10,40,40);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[2].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[3]=new CellArea(10,50,40,80);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,6);
  cells[3].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[4]=new CellArea(50,50,40,40);
  cells[5]=new CellArea(90,50,40,40);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[5].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  cells[6]=null;
  cells[7]=new CellArea(50,90,40,40);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,4);
  cells[7].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8]=new CellArea(90,90,40,40);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,2);
  cells[8].defineBorder(BorderInfo.BOTTOM_BORDER,Color.blue);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,6);
  cells[8].defineBorder(BorderInfo.RIGHT_BORDER,Color.orange);
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("String_Node_Str"));
  writer=new PostscriptWriter(bufferedOutputStream,"String_Node_Str");
  writer.startRenderer(null,null,null,1,false,600,false);
  writer.startPage(pageWidth,pageHeight);
  testBorderDraw();
  writer.endPage();
  writer.stopRenderer();
}
Program: 67562
Project: 67562
Buggy source:
private String getPaperSize(String paperSize){
  int width=595;
  int height=842;
  if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=792;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=1008;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=419;
    height=595;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=595;
    height=842;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=842;
    height=1191;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=499;
    height=709;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=729;
    height=1032;
  }
  return width + "String_Node_Str" + height;
}

Fixed version (ground truth):
private int[] getPaperSize(String paperSize){
  int width=595;
  int height=842;
  if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=792;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=612;
    height=1008;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=419;
    height=595;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=595;
    height=842;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=842;
    height=1191;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=499;
    height=709;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(paperSize)) {
    width=729;
    height=1032;
  }
  return new int[]{width,height};
}
Program: 67563
Project: 67563
Buggy source:
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution,boolean gray) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  setPaperSize(paperSize);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(gray);
  FileUtil.load("String_Node_Str",out);
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution,boolean gray,int scale) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  int width=pageSize[0];
  int height=pageSize[1];
  setPaperSize(paperSize,width,height);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(gray);
  FileUtil.load("String_Node_Str",out);
  setScale(height,scale);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 67564
Project: 67564
Buggy source:
private void setPaperSize(String paperSize){
  if (paperSize != null) {
    out.println("String_Node_Str" + paperSize);
    out.println("String_Node_Str" + getPaperSize(paperSize) + "String_Node_Str");
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setPaperSize(String paperSize,int width,int height){
  if (paperSize != null) {
    out.println("String_Node_Str" + paperSize);
    out.println("String_Node_Str" + width + "String_Node_Str"+ height+ "String_Node_Str");
    out.println("String_Node_Str");
  }
}
Program: 67565
Project: 67565
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean gray=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_GRAY,false);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,gray);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  boolean gray=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_GRAY,false);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,gray,scale);
}
Program: 67566
Project: 67566
Buggy source:
private void setupRenderOptions(){
  IRenderOption renderOptions=service.getRenderOption();
  Object textWrapping=renderOptions.getOption(IExcelRenderOption.WRAPPING_TEXT);
  if (textWrapping != null && textWrapping instanceof Boolean) {
    context.setWrappingText((Boolean)textWrapping);
  }
 else {
    context.setWrappingText((Boolean)true);
  }
  Object officeVersion=renderOptions.getOption(IExcelRenderOption.OFFICE_VERSION);
  if (officeVersion != null && officeVersion instanceof String) {
    if (officeVersion.equals("String_Node_Str")) {
      context.setOfficeVersion("String_Node_Str");
    }
  }
 else {
    context.setOfficeVersion("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setupRenderOptions(){
  IRenderOption renderOptions=service.getRenderOption();
  Object textWrapping=renderOptions.getOption(IExcelRenderOption.WRAPPING_TEXT);
  if (textWrapping != null && textWrapping instanceof Boolean) {
    context.setWrappingText((Boolean)textWrapping);
  }
 else {
    context.setWrappingText((Boolean)true);
  }
  Object officeVersion=renderOptions.getOption(IExcelRenderOption.OFFICE_VERSION);
  if (officeVersion != null && officeVersion instanceof String) {
    if (officeVersion.equals("String_Node_Str")) {
      context.setOfficeVersion("String_Node_Str");
    }
  }
 else {
    context.setOfficeVersion("String_Node_Str");
  }
  Object hideGridlines=renderOptions.getOption(IExcelRenderOption.HIDE_GRIDLINES);
  if (hideGridlines != null && hideGridlines instanceof Boolean) {
    context.setHideGridlines((Boolean)hideGridlines);
  }
 else {
    context.setHideGridlines((Boolean)false);
  }
}
Program: 67567
Project: 67567
Buggy source:
private void declareWorkSheetOptions(String orientation,int pageWidth,int pageHeight){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.openTag("String_Node_Str");
  if (orientation != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",orientation);
    writer.closeTag("String_Node_Str");
  }
  if (pageHeader != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageHeader);
    writer.closeTag("String_Node_Str");
  }
  if (pageFooter != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageFooter);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  int index=ExcelUtil.getPageSizeIndex(pageWidth / 1000,pageHeight / 1000);
  writer.text(String.valueOf(index));
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
private void declareWorkSheetOptions(String orientation,int pageWidth,int pageHeight){
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str");
  if (context.getHideGridlines()) {
    writer.openTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
  writer.openTag("String_Node_Str");
  if (orientation != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",orientation);
    writer.closeTag("String_Node_Str");
  }
  if (pageHeader != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageHeader);
    writer.closeTag("String_Node_Str");
  }
  if (pageFooter != null) {
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str",pageFooter);
    writer.closeTag("String_Node_Str");
  }
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  int index=ExcelUtil.getPageSizeIndex(pageWidth / 1000,pageHeight / 1000);
  writer.text(String.valueOf(index));
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 67569
Project: 67569
Buggy source:
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  setPaperSize(paperSize);
  setPaperTray(paperTray);
  setDuplex(duplex);
  FileUtil.load("String_Node_Str",out);
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,String duplex,int copies,boolean collate,int resolution) throws IOException {
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  setPaperSize(paperSize);
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  FileUtil.load("String_Node_Str",out);
}
Program: 67570
Project: 67570
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  String duplex=renderOption.getStringOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  int resolution=renderOption.getIntOption(IPostscriptRenderOption.OPTION_RESOLUTION,0);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution);
}
Program: 67571
Project: 67571
Buggy source:
/** 
 * Creates the composite, for displaying the list of available db objects
 * @param parent
 */
private Control createDBMetaDataSelectionComposite(Composite parent){
  boolean supportsSchema=JdbcMetaDataProvider.getInstance().isSupportSchema();
  boolean supportsProcedure=JdbcMetaDataProvider.getInstance().isSupportProcedure();
  Composite tablescomposite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  tablescomposite.setLayout(layout);
  GridData data=new GridData(GridData.FILL_VERTICAL);
  data.grabExcessVerticalSpace=true;
  tablescomposite.setLayoutData(data);
  Label dataSourceLabel=new Label(tablescomposite,SWT.LEFT);
  dataSourceLabel.setText(JdbcPlugin.getResourceString("String_Node_Str"));
  GridData labelData=new GridData();
  dataSourceLabel.setLayoutData(labelData);
  availableDbObjectsTree=new Tree(tablescomposite,SWT.BORDER | SWT.MULTI);
  GridData treeData=new GridData(GridData.FILL_BOTH);
  treeData.minimumHeight=150;
  availableDbObjectsTree.setLayoutData(treeData);
  availableDbObjectsTree.addMenuDetectListener(new MenuDetectListener(){
    public void menuDetected(    MenuDetectEvent e){
      if (availableDbObjectsTree.getSelectionCount() > 0) {
        TreeItem item=availableDbObjectsTree.getSelection()[0];
        if (item.getParentItem() != null) {
          treeMenu.setLocation(e.x,e.y);
          return;
        }
      }
      e.doit=false;
    }
  }
);
  availableDbObjectsTree.addMouseListener(new MouseAdapter(){
    public void mouseDoubleClick(    MouseEvent e){
      insertTreeItemText();
    }
  }
);
  createObjectTreeMenu();
  createSchemaFilterComposite(supportsSchema,supportsProcedure,tablescomposite);
  createSQLOptionGroup(tablescomposite);
  addDragSupportToTree();
  addFetchDbObjectListener(metadataBidiFormatStr);
  return tablescomposite;
}

Fixed version (ground truth):
/** 
 * Creates the composite, for displaying the list of available db objects
 * @param parent
 */
private Control createDBMetaDataSelectionComposite(Composite parent){
  sComposite=new ScrolledComposite(parent,SWT.H_SCROLL | SWT.V_SCROLL);
  sComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  sComposite.setExpandHorizontal(true);
  sComposite.setExpandVertical(true);
  sComposite.addControlListener(new ControlAdapter(){
    public void controlResized(    ControlEvent e){
      computeSize();
    }
  }
);
  boolean supportsSchema=JdbcMetaDataProvider.getInstance().isSupportSchema();
  boolean supportsProcedure=JdbcMetaDataProvider.getInstance().isSupportProcedure();
  tablescomposite=new Composite(sComposite,SWT.NONE);
  tablescomposite.setLayout(new GridLayout());
  GridData data=new GridData(GridData.FILL_BOTH);
  data.grabExcessVerticalSpace=true;
  tablescomposite.setLayoutData(data);
  createDBObjectTree(tablescomposite);
  createSchemaFilterComposite(supportsSchema,supportsProcedure,tablescomposite);
  createSQLOptionGroup(tablescomposite);
  addDragSupportToTree();
  addFetchDbObjectListener(metadataBidiFormatStr);
  sComposite.setContent(tablescomposite);
  return tablescomposite;
}
Program: 67572
Project: 67572
Buggy source:
private void setDuplex(String duplex){
  if (duplex != null && !"String_Node_Str".equalsIgnoreCase(duplex)) {
    String duplexValue=duplex;
    if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
    out.println("String_Node_Str" + duplexValue);
    out.println("String_Node_Str");
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setDuplex(String duplex){
  if (duplex != null && !"String_Node_Str".equalsIgnoreCase(duplex)) {
    String duplexValue=duplex;
    String tumbleValue="String_Node_Str";
    if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
    }
 else     if ("String_Node_Str".equalsIgnoreCase(duplex)) {
      duplexValue="String_Node_Str";
      duplexValue="String_Node_Str";
    }
    out.println("String_Node_Str" + duplexValue);
    out.println("String_Node_Str" + tumbleValue + "String_Node_Str");
    out.println("String_Node_Str");
  }
}
Program: 67573
Project: 67573
Buggy source:
public void drop(DropTargetEvent event){
  String bindingName=(String)event.data;
  if (Platform.OS_MACOSX.equals(Platform.getOS())) {
    ExpressionCodec expCodec=ChartModelHelper.instance().createExpressionCodec();
    expCodec.setBindingName(bindingName,btnBuilder.isCube());
    if (!DataDefinitionTextManager.getInstance().isValidExpression(txtDataDefn,expCodec.getExpression())) {
      return;
    }
  }
  btnBuilder.setBindingName(bindingName,true);
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  String bindingName=(String)event.data;
  if (!Platform.OS_WIN32.equals(Platform.getOS())) {
    ExpressionCodec expCodec=ChartModelHelper.instance().createExpressionCodec();
    expCodec.setBindingName(bindingName,btnBuilder.isCube());
    if (!DataDefinitionTextManager.getInstance().isValidExpression(txtDataDefn,expCodec.getExpression())) {
      return;
    }
  }
  btnBuilder.setBindingName(bindingName,true);
}
Program: 67574
Project: 67574
Buggy source:
public void dragEnter(DropTargetEvent event){
  event.detail=DND.DROP_COPY;
  if (!Platform.OS_MACOSX.equals(Platform.getOS())) {
    Object object=null;
    Transfer[] transferAgents=((DropTarget)event.widget).getTransfer();
    for (int i=0; i < transferAgents.length; i++) {
      Transfer transfer=transferAgents[i];
      if (transfer != null && transfer instanceof SimpleTextTransfer) {
        object=SimpleTextTransfer.getInstance().nativeToJava(event.currentDataType);
        break;
      }
    }
    if (object != null) {
      ExpressionCodec expCodec=ChartModelHelper.instance().createExpressionCodec();
      expCodec.setBindingName(object.toString(),btnBuilder.isCube());
      if (!DataDefinitionTextManager.getInstance().isValidExpression(txtDataDefn,expCodec.getExpression())) {
        event.detail=DND.DROP_NONE;
      }
    }
  }
}

Fixed version (ground truth):
public void dragEnter(DropTargetEvent event){
  event.detail=DND.DROP_COPY;
  if (Platform.OS_WIN32.equals(Platform.getOS())) {
    Object object=null;
    Transfer[] transferAgents=((DropTarget)event.widget).getTransfer();
    for (int i=0; i < transferAgents.length; i++) {
      Transfer transfer=transferAgents[i];
      if (transfer != null && transfer instanceof SimpleTextTransfer) {
        object=SimpleTextTransfer.getInstance().nativeToJava(event.currentDataType);
        break;
      }
    }
    if (object != null) {
      ExpressionCodec expCodec=ChartModelHelper.instance().createExpressionCodec();
      expCodec.setBindingName(object.toString(),btnBuilder.isCube());
      if (!DataDefinitionTextManager.getInstance().isValidExpression(txtDataDefn,expCodec.getExpression())) {
        event.detail=DND.DROP_NONE;
      }
    }
  }
}