nus-yam/ex-repair huggingface dataset:
Program: 65522
Project: 65522
Buggy source:
public void load(){
  String value=getDescriptorProvider().load().toString();
  boolean stateFlag=((value == null) == text.getEnabled());
  if (stateFlag) {
    text.setEnabled(value != null);
    combo.setEnabled(value != null);
  }
  if (getDescriptorProvider() instanceof UnitPropertyDescriptorProvider) {
    deMeasureValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getMeasureValue();
    if (deMeasureValue == null)     deMeasureValue="String_Node_Str";
    if (!deMeasureValue.equals(text.getText())) {
      text.setText(deMeasureValue);
    }
    String[] items=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitItems();
    combo.setItems(items);
    String deUnitValue;
    try {
      deUnitValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitDisplayName(((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnit());
    }
 catch (    Exception e) {
      ExceptionUtil.handle(e);
      return;
    }
    if (deUnitValue == null)     combo.deselectAll();
 else     if (!deUnitValue.equals(combo.getText())) {
      combo.select(Arrays.asList(items).indexOf(deUnitValue));
    }
  }
}

Fixed version (ground truth):
public void load(){
  String value=getDescriptorProvider().load().toString();
  boolean stateFlag=((value == null) == text.getEnabled());
  if (stateFlag) {
    text.setEnabled(value != null);
    combo.setEnabled(value != null);
  }
  if (getDescriptorProvider() instanceof UnitPropertyDescriptorProvider) {
    deMeasureValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getMeasureValue();
    if (deMeasureValue == null)     deMeasureValue="String_Node_Str";
    if (!deMeasureValue.equals(text.getText())) {
      text.setText(deMeasureValue);
    }
    String[] items=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitItems();
    if (!Arrays.equals(combo.getItems(),items)) {
      combo.setItems(items);
    }
    String deUnitValue;
    try {
      deUnitValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitDisplayName(((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnit());
    }
 catch (    Exception e) {
      ExceptionUtil.handle(e);
      return;
    }
    if (deUnitValue == null)     combo.deselectAll();
 else     if (!deUnitValue.equals(combo.getText())) {
      combo.select(Arrays.asList(items).indexOf(deUnitValue));
    }
  }
}
Program: 65524
Project: 65524
Buggy source:
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  try {
    if (iParamBind.getExpr() instanceof IScriptExpression) {
      ScriptContext evalContext=this.outerScope == null ? context : context.newContext(this.outerScope);
      if (iParamBind.getExpr().getHandle() == null)       iParamBind.getExpr().setHandle(evalContext.compile("String_Node_Str",null,0,((IScriptExpression)iParamBind.getExpr()).getText()));
      evaluateResult=ScriptEvalUtil.evalExpr(iParamBind.getExpr(),evalContext,null,0);
    }
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}

Fixed version (ground truth):
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  try {
    if (iParamBind.getExpr() instanceof IScriptExpression) {
      ScriptContext evalContext=this.outerScope == null ? context : context.newContext(this.outerScope);
      if (iParamBind.getExpr().getHandle() == null)       iParamBind.getExpr().setHandle(evalContext.compile("String_Node_Str",null,0,((IScriptExpression)iParamBind.getExpr()).getText()));
      evaluateResult=ScriptEvalUtil.evalExpr(iParamBind.getExpr(),evalContext,ScriptExpression.defaultID,0);
    }
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}
Program: 65525
Project: 65525
Buggy source:
private void registerOutputParams(IBaseDataSetDesign dataSetDesign,Scriptable scope) throws BirtException {
  String dataSetName=dataSetDesign.getName();
  for (int i=0; i < dataSetDesign.getParameters().size(); i++) {
    if (((IParameterDefinition)dataSetDesign.getParameters().get(i)).isOutputMode()) {
      String paramName=((IParameterDefinition)dataSetDesign.getParameters().get(i)).getName();
      String joinname=JointDataSetParameterUtil.getParameterName(dataSetName,paramName);
      Object value=JavascriptEvalUtil.evaluateRawScript(Context.getCurrentContext(),scope,JointDataSetParameterUtil.buildOutputParamsExpr(paramName),"String_Node_Str",1);
      dataSet.setOutputParameterValue(joinname,value);
    }
  }
}

Fixed version (ground truth):
private void registerOutputParams(IBaseDataSetDesign dataSetDesign,Scriptable scope) throws BirtException {
  String dataSetName=dataSetDesign.getName();
  for (int i=0; i < dataSetDesign.getParameters().size(); i++) {
    if (((IParameterDefinition)dataSetDesign.getParameters().get(i)).isOutputMode()) {
      String paramName=((IParameterDefinition)dataSetDesign.getParameters().get(i)).getName();
      String joinname=JointDataSetParameterUtil.getParameterName(dataSetName,paramName);
      Object value=JavascriptEvalUtil.evaluateRawScript(Context.getCurrentContext(),scope,JointDataSetParameterUtil.buildOutputParamsExpr(paramName),org.eclipse.birt.core.script.ScriptExpression.defaultID,1);
      dataSet.setOutputParameterValue(joinname,value);
    }
  }
}
Program: 65526
Project: 65526
Buggy source:
private int evaluatePeriodsN(String n,Object expression) throws DataException, BirtException {
  int num=0;
  if (n == null || n.trim().equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  try {
    num=Integer.valueOf(n);
  }
 catch (  Exception e) {
    ScriptExpression scriptExpression=null;
    if (expression instanceof Expression) {
      scriptExpression=this.adaptExpression((Expression)expression);
      ;
    }
 else {
      scriptExpression=adaptExpression(n,DesignChoiceConstants.PARAM_TYPE_ANY);
    }
    num=(Integer)ScriptEvalUtil.evalExpr(scriptExpression,this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  return num;
}

Fixed version (ground truth):
private int evaluatePeriodsN(String n,Object expression) throws DataException, BirtException {
  int num=0;
  if (n == null || n.trim().equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  try {
    num=Integer.valueOf(n);
  }
 catch (  Exception e) {
    ScriptExpression scriptExpression=null;
    if (expression instanceof Expression) {
      scriptExpression=this.adaptExpression((Expression)expression);
      ;
    }
 else {
      scriptExpression=adaptExpression(n,DesignChoiceConstants.PARAM_TYPE_ANY);
    }
    num=(Integer)ScriptEvalUtil.evalExpr(scriptExpression,this.context.getDataEngineContext().getScriptContext(),org.eclipse.birt.core.script.ScriptExpression.defaultID,0);
  }
  return num;
}
Program: 65527
Project: 65527
Buggy source:
public ITimeFunction adaptTimeFunction(ComputedColumnHandle handle) throws DataException, BirtException {
  if (handle.getCalculationType() == null || handle.getCalculationType().trim().length() == 0)   return null;
  TimeFunction timeFunction=new TimeFunction();
  Object referenceDate=null;
  if (DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY.equals(handle.getReferenceDateType())) {
    referenceDate=ScriptEvalUtil.evalExpr(new ScriptExpression("String_Node_Str"),this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
 else   if (DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE.equals(handle.getReferenceDateType())) {
    IBaseExpression sciptExpr=this.adaptExpression((Expression)(handle.getReferenceDateValue().getValue()));
    referenceDate=ScriptEvalUtil.evalExpr(sciptExpr,this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  timeFunction.setReferenceDate(new ReferenceDate(DataTypeUtil.toDate(referenceDate)));
  timeFunction.setTimeDimension(handle.getTimeDimension());
  timeFunction.setBaseTimePeriod(populateBaseTimePeriod(handle));
  timeFunction.setRelativeTimePeriod(populateRelativeTimePeriod(handle));
  return timeFunction;
}

Fixed version (ground truth):
public ITimeFunction adaptTimeFunction(ComputedColumnHandle handle) throws DataException, BirtException {
  if (handle.getCalculationType() == null || handle.getCalculationType().trim().length() == 0)   return null;
  TimeFunction timeFunction=new TimeFunction();
  Object referenceDate=null;
  if (DesignChoiceConstants.REFERENCE_DATE_TYPE_TODAY.equals(handle.getReferenceDateType())) {
    referenceDate=ScriptEvalUtil.evalExpr(new ScriptExpression("String_Node_Str"),this.context.getDataEngineContext().getScriptContext(),org.eclipse.birt.core.script.ScriptExpression.defaultID,0);
  }
 else   if (DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE.equals(handle.getReferenceDateType())) {
    IBaseExpression sciptExpr=this.adaptExpression((Expression)(handle.getReferenceDateValue().getValue()));
    referenceDate=ScriptEvalUtil.evalExpr(sciptExpr,this.context.getDataEngineContext().getScriptContext(),org.eclipse.birt.core.script.ScriptExpression.defaultID,0);
  }
  timeFunction.setReferenceDate(new ReferenceDate(DataTypeUtil.toDate(referenceDate)));
  timeFunction.setTimeDimension(handle.getTimeDimension());
  timeFunction.setBaseTimePeriod(populateBaseTimePeriod(handle));
  timeFunction.setRelativeTimePeriod(populateRelativeTimePeriod(handle));
  return timeFunction;
}
Program: 65528
Project: 65528
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    if (!"String_Node_Str".equalsIgnoreCase(foreign.getComputedStyle().getDisplay())) {
      adjustInline();
      inlineBrother=false;
    }
 else {
      context.endInline();
    }
    HTML2Content.html2Content(foreign);
    context.startCell();
    int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
    width=Math.min(width,context.getCurrentWidth());
    wordWriter.startTable(foreign.getComputedStyle(),width,inForeign);
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setIsAfterTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    if (!"String_Node_Str".equalsIgnoreCase(foreign.getComputedStyle().getDisplay())) {
      adjustInline();
      inlineBrother=false;
    }
 else {
      context.endInline();
    }
    HTML2Content.html2Content(foreign);
    context.startCell();
    int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
    width=Math.min(width,context.getCurrentWidth());
    wordWriter.startTable(foreign.getComputedStyle(),width,inForeign);
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
    writeBookmark(foreign);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setIsAfterTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}
Program: 65530
Project: 65530
Buggy source:
private void setGroupToc(IGroupContent group){
  if (group != null) {
    InstanceID groupId=group.getInstanceID();
    if (!groupIdList.contains(groupId)) {
      groupIdList.add(groupId);
      Object groupToc=group.getTOC();
      if (groupToc != null) {
        tableTocs.add(new TocInfo(groupToc.toString(),tocLevel));
      }
    }
    increaseTOCLevel(group);
  }
}

Fixed version (ground truth):
private void setGroupToc(IGroupContent group){
  if (group != null) {
    InstanceID groupId=group.getInstanceID();
    if (!groupIdList.contains(groupId)) {
      groupIdList.add(groupId);
      Object groupToc=group.getTOC();
      if (groupToc != null && !hasTocOutputed(group)) {
        tableTocs.add(new TocInfo(groupToc.toString(),tocLevel));
      }
    }
    increaseTOCLevel(group);
  }
}
Program: 65531
Project: 65531
Buggy source:
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isAfterTable()) {
    wordWriter.insertHiddenParagraph();
    context.setIsAfterTable(false);
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth(),reportDpi);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.startTable(table.getComputedStyle(),getTableWidth(cols));
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null && !hasTocOutputed(table)) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isAfterTable()) {
    wordWriter.insertHiddenParagraph();
    context.setIsAfterTable(false);
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth(),reportDpi);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.startTable(table.getComputedStyle(),getTableWidth(cols));
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}
Program: 65532
Project: 65532
Buggy source:
public void startList(IListContent list){
  adjustInline();
  styles.push(list.getComputedStyle());
  writeBookmark(list);
  Object listToc=list.getTOC();
  if (listToc != null) {
    tableTocs.add(new TocInfo(listToc.toString(),tocLevel));
  }
  increaseTOCLevel(list);
  if (context.isAfterTable()) {
    wordWriter.insertHiddenParagraph();
    context.setIsAfterTable(false);
  }
  int width=WordUtil.convertTo(list.getWidth(),context.getCurrentWidth(),reportDpi);
  width=Math.min(width,context.getCurrentWidth());
  wordWriter.startTable(list.getComputedStyle(),width);
}

Fixed version (ground truth):
public void startList(IListContent list){
  adjustInline();
  styles.push(list.getComputedStyle());
  writeBookmark(list);
  Object listToc=list.getTOC();
  if (listToc != null && !hasTocOutputed(list)) {
    tableTocs.add(new TocInfo(listToc.toString(),tocLevel));
  }
  increaseTOCLevel(list);
  if (context.isAfterTable()) {
    wordWriter.insertHiddenParagraph();
    context.setIsAfterTable(false);
  }
  int width=WordUtil.convertTo(list.getWidth(),context.getCurrentWidth(),reportDpi);
  width=Math.min(width,context.getCurrentWidth());
  wordWriter.startTable(list.getComputedStyle(),width);
}
Program: 65533
Project: 65533
Buggy source:
public static String createTempRootDir(String tempDir) throws DataException {
  String rootDirStr=null;
  File tempDtEDir=null;
  tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1.intValue());
  cacheCounter1.add(1);
  int x=0;
  while (FileSecurity.fileExist(tempDtEDir)) {
    x++;
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1.intValue()+ "String_Node_Str"+ x);
  }
  FileSecurity.fileMakeDirs(tempDtEDir);
  FileSecurity.fileDeleteOnExit(tempDtEDir);
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}

Fixed version (ground truth):
public static String createTempRootDir(String tempDir) throws DataException {
  String rootDirStr=null;
  File tempDtEDir=null;
  tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1.intValue());
  cacheCounter1.add(1);
  int x=0;
  while (FileSecurity.fileExist(tempDtEDir)) {
    x++;
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1.intValue()+ "String_Node_Str"+ x);
  }
  FileSecurity.fileMakeDirs(tempDtEDir);
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}
Program: 65534
Project: 65534
Buggy source:
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
  String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
  cacheCounter2.add(1);
  sessionFile=new File(sessionTempDir);
  int i=0;
  String tempDir=sessionTempDir;
  while (FileSecurity.fileExist(sessionFile)) {
    i++;
    sessionTempDir=tempDir + "String_Node_Str" + i;
    sessionFile=new File(sessionTempDir);
    if (i > MAX_DIR_CREATION_ATTEMPT) {
      throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
    }
  }
  if (!FileSecurity.fileMakeDirs(sessionFile)) {
    throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
  }
  FileSecurity.fileDeleteOnExit(sessionFile);
  return getCanonicalPath(sessionFile);
}

Fixed version (ground truth):
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
  String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
  cacheCounter2.add(1);
  sessionFile=new File(sessionTempDir);
  int i=0;
  String tempDir=sessionTempDir;
  while (FileSecurity.fileExist(sessionFile)) {
    i++;
    sessionTempDir=tempDir + "String_Node_Str" + i;
    sessionFile=new File(sessionTempDir);
    if (i > MAX_DIR_CREATION_ATTEMPT) {
      throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
    }
  }
  if (!FileSecurity.fileMakeDirs(sessionFile)) {
    throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
  }
  return getCanonicalPath(sessionFile);
}
Program: 65535
Project: 65535
Buggy source:
private void createCacheOutputStream() throws FileNotFoundException, DataException {
  File tmpDir=new File(session.getTempDir());
  if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
    FileSecurity.fileMakeDirs(tmpDir);
  }
  metaOutputStream=new BufferedOutputStream(FileSecurity.createFileOutputStream(ResultSetCacheUtil.getMetaFile(session.getTempDir(),queryResults.getID())),1024);
  rowOutputStream=new DataOutputStream(new BufferedOutputStream(FileSecurity.createFileOutputStream(ResultSetCacheUtil.getDataFile(session.getTempDir(),queryResults.getID())),1024));
  File file=ResultSetCacheUtil.getDataFile(session.getTempDir(),queryResults.getID());
  FileSecurity.fileDeleteOnExit(file);
  file=ResultSetCacheUtil.getMetaFile(session.getTempDir(),queryResults.getID());
  FileSecurity.fileDeleteOnExit(file);
}

Fixed version (ground truth):
private void createCacheOutputStream() throws FileNotFoundException, DataException {
  File tmpDir=new File(session.getTempDir());
  if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
    FileSecurity.fileMakeDirs(tmpDir);
  }
  metaOutputStream=new BufferedOutputStream(FileSecurity.createFileOutputStream(ResultSetCacheUtil.getMetaFile(session.getTempDir(),queryResults.getID())),1024);
  rowOutputStream=new DataOutputStream(new BufferedOutputStream(FileSecurity.createFileOutputStream(ResultSetCacheUtil.getDataFile(session.getTempDir(),queryResults.getID())),1024));
  File file=ResultSetCacheUtil.getDataFile(session.getTempDir(),queryResults.getID());
  file=ResultSetCacheUtil.getMetaFile(session.getTempDir(),queryResults.getID());
}
Program: 65537
Project: 65537
Buggy source:
/** 
 */
public void clearTmpFile(){
  if (objectFile != null) {
    FileSecurity.fileDeleteOnExit(objectFile);
    objectFile=null;
  }
  if (oatFile != null) {
    FileSecurity.fileDeleteOnExit(oatFile);
    oatFile=null;
  }
  if (dataFile != null) {
    FileSecurity.fileDeleteOnExit(dataFile);
    dataFile=null;
  }
}

Fixed version (ground truth):
/** 
 */
public void clearTmpFile(){
  if (objectFile != null) {
    objectFile=null;
  }
  if (oatFile != null) {
    oatFile=null;
  }
  if (dataFile != null) {
    dataFile=null;
  }
}
Program: 65538
Project: 65538
Buggy source:
/** 
 * @throws IOException
 */
private void createRandomAccessFile() throws IOException {
  File parent=file.getParentFile();
  if (!FileSecurity.fileExist(parent)) {
    FileSecurity.fileMakeDirs(parent);
  }
  delegate=FileSecurity.createRandomAccessFile(file,mode);
  file.deleteOnExit();
  if (memoryDelegate != null || length > 0) {
    delegate.write(memoryDelegate,0,length);
    delegate.seek(pointer);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
private void createRandomAccessFile() throws IOException {
  File parent=file.getParentFile();
  if (!FileSecurity.fileExist(parent)) {
    FileSecurity.fileMakeDirs(parent);
  }
  delegate=FileSecurity.createRandomAccessFile(file,mode);
  if (memoryDelegate != null || length > 0) {
    delegate.write(memoryDelegate,0,length);
    delegate.seek(pointer);
  }
}
Program: 65539
Project: 65539
Buggy source:
private void writeHeaderFooter() throws IOException, BirtException {
  IStyle style=previousPage.getStyle();
  String backgroundHeight=style.getBackgroundHeight();
  String backgroundWidth=style.getBackgroundWidth();
  if (previousPage.getPageHeader() != null || backgroundHeight != null || backgroundWidth != null) {
    SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
    wordWriter.startHeader(!master.isShowHeaderOnFirst() && previousPage.getPageNumber() == 1,headerHeight,contentWidth);
    if (backgroundHeight != null || backgroundWidth != null) {
      String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
      wordWriter.drawDocumentBackgroundImage(backgroundImageUrl,backgroundHeight,backgroundWidth,WordUtil.twipToPt(topMargin),WordUtil.twipToPt(leftMargin),WordUtil.twipToPt(pageHeight),WordUtil.twipToPt(pageWidth));
    }
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    wordWriter.startFooter(footerHeight,contentWidth);
    contentVisitor.visitChildren(previousPage.getPageFooter(),null);
    wordWriter.endFooter();
  }
}

Fixed version (ground truth):
private void writeHeaderFooter() throws IOException, BirtException {
  IStyle style=previousPage.getStyle();
  String backgroundHeight=style.getBackgroundHeight();
  String backgroundWidth=style.getBackgroundWidth();
  SimpleMasterPageDesign master=(SimpleMasterPageDesign)previousPage.getGenerateBy();
  if (previousPage.getPageHeader() != null || backgroundHeight != null || backgroundWidth != null) {
    wordWriter.startHeader(!master.isShowHeaderOnFirst() && previousPage.getPageNumber() == 1,headerHeight,contentWidth);
    if (backgroundHeight != null || backgroundWidth != null) {
      String backgroundImageUrl=EmitterUtil.getBackgroundImageUrl(style,reportContent.getDesign().getReportDesign(),reportContext.getAppContext());
      wordWriter.drawDocumentBackgroundImage(backgroundImageUrl,backgroundHeight,backgroundWidth,WordUtil.twipToPt(topMargin),WordUtil.twipToPt(leftMargin),WordUtil.twipToPt(pageHeight),WordUtil.twipToPt(pageWidth));
    }
    contentVisitor.visitChildren(previousPage.getPageHeader(),null);
    wordWriter.endHeader();
  }
  if (previousPage.getPageFooter() != null) {
    if (!master.isShowFooterOnLast() && previousPage.getPageNumber() == reportContent.getTotalPage()) {
      IContent footer=previousPage.getPageFooter();
      ILabelContent emptyContent=footer.getReportContent().createLabelContent();
      emptyContent.setText(this.EMPTY_FOOTER);
      wordWriter.startFooter(footerHeight,contentWidth);
      contentVisitor.visit(emptyContent,null);
      wordWriter.endFooter();
    }
 else {
      wordWriter.startFooter(footerHeight,contentWidth);
      contentVisitor.visitChildren(previousPage.getPageFooter(),null);
      wordWriter.endFooter();
    }
  }
}
Program: 65540
Project: 65540
Buggy source:
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
private void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  boolean recalculate=false;
  if (!aggrMeasureFilters.isEmpty()) {
    AggrMeasureFilterHelper filter=new AggrMeasureFilterHelper(cube,resultSet);
    filter.setQueryExecutor(cubeQueryExecutor);
    filter.setBindingValueFetcher(fetcher);
    cubePosFilters=filter.getCubePosFilters(aggrMeasureFilters);
    if (cubePosFilters == null) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
      }
      return;
    }
    recalculate=true;
  }
  if (!aggrFilterHelpers.isEmpty()) {
    AggregationFilterHelper filterHelper=new AggregationFilterHelper(cube,aggrFilterHelpers,fetcher);
    List newFilters=filterHelper.generateLevelFilters(aggregations,resultSet);
    if (newFilters == null) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
        recalculate=false;
      }
    }
 else {
      levelFilters.addAll(newFilters);
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].close();
        resultSet[i]=null;
      }
      recalculate=true;
    }
  }
  if (recalculate) {
    IAggregationResultSet[] temp=onePassExecute(aggregations,stopSign);
    System.arraycopy(temp,0,resultSet,0,resultSet.length);
  }
}

Fixed version (ground truth):
/** 
 * @param aggregations
 * @param resultSet
 * @param stopSign
 * @throws IOException
 * @throws DataException
 * @throws BirtException
 */
public void applyAggrFilters(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,StopSign stopSign) throws IOException, DataException, BirtException {
  boolean recalculate=false;
  if (!aggrMeasureFilters.isEmpty()) {
    AggrMeasureFilterHelper filter=new AggrMeasureFilterHelper(cube,resultSet);
    filter.setQueryExecutor(cubeQueryExecutor);
    filter.setBindingValueFetcher(fetcher);
    cubePosFilters=filter.getCubePosFilters(aggrMeasureFilters);
    if (cubePosFilters == null) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
      }
      return;
    }
    recalculate=true;
  }
  if (!aggrFilterHelpers.isEmpty()) {
    AggregationFilterHelper filterHelper=new AggregationFilterHelper(cube,aggrFilterHelpers,fetcher);
    List newFilters=filterHelper.generateLevelFilters(aggregations,resultSet);
    if (newFilters == null) {
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].clear();
        recalculate=false;
      }
    }
 else {
      levelFilters.addAll(newFilters);
      for (int i=0; i < resultSet.length; i++) {
        resultSet[i].close();
        resultSet[i]=null;
      }
      recalculate=true;
    }
  }
  if (recalculate) {
    IAggregationResultSet[] temp=onePassExecute(aggregations,stopSign);
    System.arraycopy(temp,0,resultSet,0,temp.length);
  }
}
Program: 65543
Project: 65543
Buggy source:
/** 
 * @param outResults
 * @param defn
 * @param session
 * @param scope
 * @param context
 * @throws DataException 
 */
public CubeQueryExecutor(IBaseQueryResults outResults,ICubeQueryDefinition defn,DataEngineSession session,Scriptable scope,DataEngineContext context) throws DataException {
  this.defn=defn;
  this.scope=scope;
  this.context=context;
  this.session=session;
  DataEngineThreadLocal.getInstance().getPathManager().setTempPath(session.getTempDir());
  this.outResults=outResults;
  this.dimensionFilterEvalHelpers=new ArrayList<IJSFilterHelper>();
  this.dimensionSimpleFilter=new ArrayList<SimpleLevelFilter>();
  this.aggrMeasureFilterEvalHelpers=new ArrayList<IAggrMeasureFilterEvalHelper>();
  this.advancedFacttableBasedFilterEvalHelper=new ArrayList<IJSFacttableFilterEvalHelper>();
  if (!(context.getMode() == DataEngineContext.MODE_PRESENTATION && defn.getQueryResultsID() != null)) {
    populateFilterHelpers();
  }
}

Fixed version (ground truth):
/** 
 * @param outResults
 * @param defn
 * @param session
 * @param scope
 * @param context
 * @throws DataException 
 */
public CubeQueryExecutor(IBaseQueryResults outResults,ICubeQueryDefinition defn,DataEngineSession session,Scriptable scope,DataEngineContext context) throws DataException {
  this.defn=defn;
  this.scope=scope;
  this.context=context;
  this.session=session;
  DataEngineThreadLocal.getInstance().getPathManager().setTempPath(session.getTempDir());
  this.outResults=outResults;
  this.dimensionFilterEvalHelpers=new ArrayList<IJSFilterHelper>();
  this.dimensionSimpleFilter=new ArrayList<SimpleLevelFilter>();
  this.aggrMeasureFilterEvalHelpers=new ArrayList<IAggrMeasureFilterEvalHelper>();
  this.aggrFilterEvalHelpersOnCubeOperator=new ArrayList<IAggrMeasureFilterEvalHelper>();
  this.advancedFacttableBasedFilterEvalHelper=new ArrayList<IJSFacttableFilterEvalHelper>();
  if (!(context.getMode() == DataEngineContext.MODE_PRESENTATION && defn.getQueryResultsID() != null)) {
    populateFilterHelpers();
  }
}
Program: 65546
Project: 65546
Buggy source:
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=applyNoAggrUpdateFilters(getNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters()),executor,rs,view.getCube(),fetcher,false);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  validateLimitSetting(view,rs);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    File tmpDir=new File(executor.getSession().getTempDir());
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=applyFilterOnOperation(view,executor.getSession().getStopSign(),executor,aggrDefns,rs);
  rs=applyNoAggrUpdateFilters(getNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters()),executor,rs,view.getCube(),fetcher,false);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  validateLimitSetting(view,rs);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    File tmpDir=new File(executor.getSession().getTempDir());
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}
Program: 65547
Project: 65547
Buggy source:
protected void loadReportVariable(){
  PageHintReader hintsReader=null;
  try {
    hintsReader=new PageHintReader(reportDocReader);
    Collection<PageVariable> vars=hintsReader.getPageVariables();
    if (vars != null) {
      executionContext.addPageVariables(vars);
    }
  }
 catch (  IOException ex) {
    executionContext.addException(new EngineException(MessageConstants.PAGE_HINT_LOADING_ERROR,ex));
  }
 finally {
    if (hintsReader != null) {
      hintsReader.close();
    }
  }
}

Fixed version (ground truth):
protected void loadReportVariable(){
  PageHintReader hintsReader=null;
  try {
    hintsReader=new PageHintReader(reportDocReader);
    Collection<PageVariable> vars=hintsReader.getPageVariables();
    if (vars != null && !vars.isEmpty()) {
      executionContext.addPageVariables(vars);
    }
    IPageHint pageHint=hintsReader.getPageHint(1);
    if (pageHint != null) {
      Collection<PageVariable> pageVariables=pageHint.getPageVariables();
      if (pageVariables != null && !pageVariables.isEmpty()) {
        executionContext.addPageVariables(pageVariables);
      }
    }
  }
 catch (  IOException ex) {
    executionContext.addException(new EngineException(MessageConstants.PAGE_HINT_LOADING_ERROR,ex));
  }
 finally {
    if (hintsReader != null) {
      hintsReader.close();
    }
  }
}
Program: 65548
Project: 65548
Buggy source:
protected void writeToc(IContent content,boolean middleInline){
  if (content != null) {
    Object tocObj=content.getTOC();
    if (tocObj != null) {
      String toc=tocObj.toString();
      toc=toc.trim();
      if (!"String_Node_Str".equals(toc)) {
        wordWriter.writeTOC(toc,tocLevel,middleInline);
      }
    }
  }
}

Fixed version (ground truth):
protected void writeToc(IContent content,boolean middleInline){
  if (content != null) {
    Object tocObj=content.getTOC();
    if (tocObj != null) {
      String toc=tocObj.toString();
      String rgbcolor=content.getStyle().getBackgroundColor();
      String color=EmitterUtil.parseColor(rgbcolor);
      toc=toc.trim();
      if (!"String_Node_Str".equals(toc)) {
        wordWriter.writeTOC(toc,color,tocLevel,middleInline);
      }
    }
  }
}
Program: 65549
Project: 65549
Buggy source:
void writeTOC(String toc,int tocLevel,boolean middleInline);

Fixed version (ground truth):
void writeTOC(String toc,String color,int tocLevel,boolean middleInline);
Program: 65550
Project: 65550
Buggy source:
public void writeTOC(String tocText,int level,boolean middleInline){
  if (!middleInline) {
    writer.openTag("String_Node_Str");
  }
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",bookmarkId);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str" + tocText);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",bookmarkId++);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.closeTag("String_Node_Str");
  writeField(true);
  writeTocText(tocText,level);
  writeField(false);
  if (!middleInline) {
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeTOC(String tocText,String color,int level,boolean middleInline){
  if (!middleInline) {
    writer.openTag("String_Node_Str");
  }
  if (color != null || !color.isEmpty()) {
    writer.openTag("String_Node_Str");
    writer.openTag("String_Node_Str");
    writer.attribute("String_Node_Str","String_Node_Str");
    writer.attribute("String_Node_Str","String_Node_Str");
    writer.attribute("String_Node_Str",color);
    writer.closeTag("String_Node_Str");
    writer.openTag("String_Node_Str");
    writer.openTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
 else {
    writer.openTag("String_Node_Str");
    writer.openTag("String_Node_Str");
    writer.openTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
    writer.closeTag("String_Node_Str");
  }
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",bookmarkId);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.attribute("String_Node_Str","String_Node_Str" + tocText);
  writer.closeTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  writer.attribute("String_Node_Str",bookmarkId++);
  writer.attribute("String_Node_Str","String_Node_Str");
  writer.closeTag("String_Node_Str");
  writeField(true);
  writeTocText(tocText,level);
  writeField(false);
  if (!middleInline) {
    writer.closeTag("String_Node_Str");
  }
}
Program: 65551
Project: 65551
Buggy source:
private static boolean isStandAloneQuery(ICubeQueryDefinition cubeQuery,DataEngineContext context){
  if (cubeQuery.getQueryResultsID() != null && context.getMode() == DataEngineContext.MODE_PRESENTATION) {
    List filters=cubeQuery.getFilters();
    if (filters != null && filters.size() > 0) {
      for (int i=0; i < filters.size(); i++) {
        IFilterDefinition def=(IFilterDefinition)filters.get(i);
        if (!def.updateAggregation())         return false;
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isStandAloneQuery(ICubeQueryDefinition cubeQuery,DataEngineContext context){
  if (cubeQuery.getQueryResultsID() != null && context.getMode() == DataEngineContext.MODE_PRESENTATION) {
    return true;
  }
  return false;
}
Program: 65552
Project: 65552
Buggy source:
/** 
 * Get result set column name collection from column binding map
 * @param cacheRequestMap
 * @return
 * @throws DataException
 */
public static Set getRsColumnRequestMap(List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=new HashSet();
  if (cacheRequestMap != null) {
    Iterator<IBinding> iter=cacheRequestMap.iterator();
    List<String> dataSetColumnList=null;
    while (iter.hasNext()) {
      IBinding binding=iter.next();
      dataSetColumnList=null;
      if (binding != null) {
        if (binding.getExpression() != null)         dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(binding.getExpression());
 else         dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(getArgumentExpression(binding));
      }
      if (dataSetColumnList != null) {
        resultSetNameSet.addAll(dataSetColumnList);
      }
    }
  }
  return resultSetNameSet;
}

Fixed version (ground truth):
/** 
 * Get result set column name collection from column binding map
 * @param cacheRequestMap
 * @return
 * @throws DataException
 */
public static Set getRsColumnRequestMap(List<IBinding> cacheRequestMap) throws DataException {
  Set resultSetNameSet=new HashSet();
  if (cacheRequestMap != null) {
    Iterator<IBinding> iter=cacheRequestMap.iterator();
    List<String> dataSetColumnList=null;
    while (iter.hasNext()) {
      IBinding binding=iter.next();
      dataSetColumnList=null;
      if (binding != null) {
        if (binding.getExpression() != null) {
          dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(binding.getExpression());
          if (binding.getExpression() instanceof IPushedDownExpression) {
            dataSetColumnList.addAll(ExpressionCompilerUtil.extractDataSetColumnExpression(((IPushedDownExpression)binding.getExpression()).getOriginalExpression()));
          }
        }
 else         dataSetColumnList=ExpressionCompilerUtil.extractDataSetColumnExpression(getArgumentExpression(binding));
      }
      if (dataSetColumnList != null) {
        resultSetNameSet.addAll(dataSetColumnList);
      }
    }
  }
  return resultSetNameSet;
}
Program: 65553
Project: 65553
Buggy source:
private void initParameters(){
  if (allParameters == null) {
    allParameters=new ArrayList();
    IReportRunnable runnable;
    try {
      runnable=engine.openReportDesign(reportDesignFile);
      List list=runnable.getDesignHandle().getRoot().getParametersAndParameterGroups();
      initAllParameters(allParameters,list);
    }
 catch (    EngineException e) {
    }
  }
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
 else     if (str.startsWith(ATTR_MULPARAMRTER + "String_Node_Str")) {
      addMulitipleParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}

Fixed version (ground truth):
private void initParameters(){
  if (getFileName().endsWith("String_Node_Str" + RPTDOC_SUFFIX) || getFileName().endsWith("String_Node_Str" + RPTDOC_SUFFIXA)) {
    return;
  }
  if (allParameters == null) {
    allParameters=new ArrayList();
    IReportRunnable runnable;
    try {
      runnable=engine.openReportDesign(reportDesignFile);
      List list=runnable.getDesignHandle().getRoot().getParametersAndParameterGroups();
      initAllParameters(allParameters,list);
    }
 catch (    EngineException e) {
    }
  }
  Properties propertys=System.getProperties();
  Iterator itor=propertys.keySet().iterator();
  while (itor.hasNext()) {
    String str=(String)itor.next();
    if (str.startsWith(ATTR_PARAMRTER)) {
      addParameter(paramValues,str,propertys.getProperty(str));
    }
 else     if (str.startsWith(ATTR_MULPARAMRTER + "String_Node_Str")) {
      addMulitipleParameter(paramValues,str,propertys.getProperty(str));
    }
  }
}
Program: 65554
Project: 65554
Buggy source:
protected void dropSource(Object source) throws SemanticException {
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    for (int i=0; i < array.length; i++) {
      dropSource(array[i]);
    }
  }
 else   if (source instanceof StructuredSelection) {
    dropSource(((StructuredSelection)source).toArray());
  }
 else   if (source instanceof DesignElementHandle) {
    dropSourceElementHandle((DesignElementHandle)source);
  }
 else   if (source instanceof EmbeddedImageHandle) {
    dropEmbeddedImageHandle((EmbeddedImageHandle)(source));
  }
 else   if (source instanceof SlotHandle) {
    dropSourceSlotHandle((SlotHandle)source);
  }
 else   if (source instanceof CssStyleSheetHandle) {
    dropCssStyleHandle((CssStyleSheetHandle)source);
  }
}

Fixed version (ground truth):
protected void dropSource(Object source) throws SemanticException {
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    for (int i=0; i < array.length; i++) {
      dropSource(array[i]);
    }
  }
 else   if (source instanceof StructuredSelection) {
    dropSource(((StructuredSelection)source).toArray());
  }
 else   if (source instanceof DesignElementHandle) {
    dropSourceElementHandle((DesignElementHandle)source);
  }
 else   if (source instanceof EmbeddedImageHandle) {
    dropEmbeddedImageHandle((EmbeddedImageHandle)(source));
  }
 else   if (source instanceof SlotHandle) {
    dropSourceSlotHandle((SlotHandle)source);
  }
 else   if (source instanceof CssStyleSheetHandle) {
    dropCssStyleHandle((CssStyleSheetHandle)source);
  }
 else   if (source instanceof ScriptObjectNode) {
    ((ScriptObjectNode)source).reset();
  }
}
Program: 65557
Project: 65557
Buggy source:
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null || !getCurrentPageInstance().getId().equals(XMLSourcePage_ID)) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage || outlinePage.getCurrentPage() == null) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  if (outlinePage.getSite() != null) {
    outlinePage.getSite().getActionBars().updateActionBars();
  }
  return true;
}

Fixed version (ground truth):
public boolean reloadOutlinePage(){
  if (!getActivePageInstance().getId().equals(XMLSourcePage_ID) || outlinePage == null || !getCurrentPageInstance().getId().equals(XMLSourcePage_ID)) {
    return false;
  }
  if (outlinePage.getCurrentPage() instanceof DesignerOutlinePage || outlinePage.getCurrentPage() == null || outlinePage.getCurrentPage() instanceof EmptyPage) {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(IContentOutlinePage.class));
  }
 else {
    outlinePage.setActivePage((IPageBookViewPage)getActivePageInstance().getAdapter(ContentOutlinePage.class));
  }
  if (outlinePage.getSite() != null) {
    outlinePage.getSite().getActionBars().updateActionBars();
  }
  return true;
}