nus-yam/ex-repair huggingface dataset:
Program: 72652
Project: 72652
Buggy source:
public void partClosed(IWorkbenchPart part){
  if (part instanceof ReportEditorProxy) {
    instance.partClosed(((ReportEditorProxy)part).getEditorPart());
  }
 else {
    instance.partClosed(part);
  }
  if (part == this) {
    SessionHandleAdapter.getInstance().clear(instance.getModel());
  }
}

Fixed version (ground truth):
public void partClosed(IWorkbenchPart part){
  if (part instanceof ReportEditorProxy) {
    instance.partClosed(((ReportEditorProxy)part).getEditorPart());
  }
 else {
    instance.partClosed(part);
  }
  if (part == this) {
    SessionHandleAdapter.getInstance().clear(instance.getModel());
    if (instance.getModel() != null) {
      GlobalActionFactory.removeStackActions(instance.getModel().getCommandStack());
    }
  }
}
Program: 72653
Project: 72653
Buggy source:
public static IEditorPart getActiveEditor(String id){
  IWorkbenchPage tPage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  if (tPage == null)   return null;
  IEditorPart activeEditPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  IEditorReference[] v=tPage.getEditorReferences();
  int i;
  for (i=0; i < v.length; i++) {
    if (v[i].getId().equals(id)) {
      IEditorPart temp=(IEditorPart)v[i].getPart(true);
      if (temp == activeEditPart)       return activeEditPart;
    }
  }
  return null;
}

Fixed version (ground truth):
public static IEditorPart getActiveEditor(String id){
  IWorkbenchPage tPage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  if (tPage == null)   return null;
  IEditorPart activeEditPart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  IEditorReference[] v=tPage.getEditorReferences();
  int i;
  for (i=0; i < v.length; i++) {
    if (v[i].getId().equals(id)) {
      IEditorPart temp=(IEditorPart)v[i].getPart(false);
      if (temp == activeEditPart)       return activeEditPart;
    }
  }
  return null;
}
Program: 72654
Project: 72654
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  cellLeftCursor.dispose();
  Platform.getExtensionRegistry().removeRegistryChangeListener(DNDService.getInstance());
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  ignore.clear();
  if (cellLeftCursor != null) {
    cellLeftCursor.dispose();
  }
  if (cellRightCursor != null) {
    cellRightCursor.dispose();
  }
  Platform.getExtensionRegistry().removeRegistryChangeListener(DNDService.getInstance());
}
Program: 72655
Project: 72655
Buggy source:
/** 
 * Set default element names for preference
 * @param store The preference for store
 */
private void setDefaultElementNamePreference(IPreferences store){
  List tmpList=DEUtil.getMetaDataDictionary().getElements();
  List tmpList2=DEUtil.getMetaDataDictionary().getExtensions();
  tmpList.addAll(tmpList2);
  int i;
  StringBuffer bufferDefaultName=new StringBuffer();
  StringBuffer bufferCustomName=new StringBuffer();
  StringBuffer bufferPreference=new StringBuffer();
  int nameOption;
  IElementDefn elementDefn;
  for (i=0; i < tmpList.size(); i++) {
    elementDefn=(IElementDefn)(tmpList.get(i));
    nameOption=elementDefn.getNameOption();
    if (nameOption == MetaDataConstants.NO_NAME || filteName(elementDefn)) {
      continue;
    }
    nameCount++;
    bufferDefaultName.append(elementDefn.getName());
    bufferDefaultName.append(PREFERENCE_DELIMITER);
    bufferCustomName.append("String_Node_Str");
    bufferCustomName.append(PREFERENCE_DELIMITER);
    appendDefaultPreference(elementDefn.getName(),bufferPreference);
  }
  store.setDefault(DEFAULT_NAME_PREFERENCE,bufferDefaultName.toString());
  store.setDefault(CUSTOM_NAME_PREFERENCE,bufferCustomName.toString());
  store.setDefault(DESCRIPTION_PREFERENCE,bufferPreference.toString());
  initFilterMap(store,ResourceFilter.generateCVSFilter());
  initFilterMap(store,ResourceFilter.generateDotResourceFilter());
  initFilterMap(store,ResourceFilter.generateEmptyFolderFilter());
}

Fixed version (ground truth):
/** 
 * Set default element names for preference
 * @param store The preference for store
 */
private void setDefaultElementNamePreference(IPreferences store){
  List tmpList=DEUtil.getMetaDataDictionary().getElements();
  List tmpList2=DEUtil.getMetaDataDictionary().getExtensions();
  tmpList.addAll(tmpList2);
  int i;
  StringBuffer bufferDefaultName=new StringBuffer();
  StringBuffer bufferCustomName=new StringBuffer();
  StringBuffer bufferPreference=new StringBuffer();
  int nameOption;
  IElementDefn elementDefn;
  for (i=0; i < tmpList.size(); i++) {
    elementDefn=(IElementDefn)(tmpList.get(i));
    nameOption=elementDefn.getNameOption();
    if (nameOption == MetaDataConstants.NO_NAME || filteName(elementDefn)) {
      continue;
    }
    bufferDefaultName.append(elementDefn.getName());
    bufferDefaultName.append(PREFERENCE_DELIMITER);
    bufferCustomName.append("String_Node_Str");
    bufferCustomName.append(PREFERENCE_DELIMITER);
    appendDefaultPreference(elementDefn.getName(),bufferPreference);
  }
  store.setDefault(DEFAULT_NAME_PREFERENCE,bufferDefaultName.toString());
  store.setDefault(CUSTOM_NAME_PREFERENCE,bufferCustomName.toString());
  store.setDefault(DESCRIPTION_PREFERENCE,bufferPreference.toString());
  initFilterMap(store,ResourceFilter.generateCVSFilter());
  initFilterMap(store,ResourceFilter.generateDotResourceFilter());
  initFilterMap(store,ResourceFilter.generateEmptyFolderFilter());
}
Program: 72656
Project: 72656
Buggy source:
public ArchiveFile getArchive(){
  return archive;
}

Fixed version (ground truth):
public IArchiveFile getArchive(){
  return archive;
}
Program: 72657
Project: 72657
Buggy source:
public ArchiveWriter(ArchiveFile archive) throws IOException {
  this.archive=archive;
  shareArchive=true;
  streams=new HashSet();
}

Fixed version (ground truth):
public ArchiveWriter(IArchiveFile archive) throws IOException {
  this.archive=archive;
  shareArchive=true;
  streams=new HashSet();
}
Program: 72658
Project: 72658
Buggy source:
public ArchiveFile getArchive(){
  return archive;
}

Fixed version (ground truth):
public IArchiveFile getArchive(){
  return archive;
}
Program: 72659
Project: 72659
Buggy source:
/** 
 * Gets a named property
 */
public Object get(String name,Scriptable start){
  logger.entering(JSRowObject.class.getName(),"String_Node_Str",name);
  if (name.equals(DATA_SET)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str");
    return dataSet.getJSDataSetObject();
  }
 else   if (name.equals(COLUMN_MD)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",getColumnMetadataScriptable());
    return getColumnMetadataScriptable();
  }
 else   if (name.equals(ROW_POSITION)) {
    try {
      return new Integer(dataSet.getCurrentRowIndex());
    }
 catch (    DataException e) {
      logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    }
  }
  try {
    Object value=dataSet.getDataRow().getColumnValue(name);
    return JavascriptEvalUtil.convertToJavascriptValue(value,dataSet.getSharedScope());
  }
 catch (  BirtException e) {
    logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    return new DataExceptionMocker(e);
  }
}

Fixed version (ground truth):
/** 
 * Gets a named property
 */
public Object get(String name,Scriptable start){
  logger.entering(JSRowObject.class.getName(),"String_Node_Str",name);
  if (name.equals(DATA_SET)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str");
    return dataSet.getJSDataSetObject();
  }
 else   if (name.equals(COLUMN_MD)) {
    if (logger.isLoggable(Level.FINER))     logger.exiting(JSRowObject.class.getName(),"String_Node_Str",getColumnMetadataScriptable());
    return getColumnMetadataScriptable();
  }
 else   if (name.equals(ROW_POSITION)) {
    try {
      return new Integer(dataSet.getCurrentRowIndex());
    }
 catch (    DataException e) {
      logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    }
  }
  try {
    if (dataSet.getCurrentRow() == null)     return null;
    Object value=dataSet.getDataRow().getColumnValue(name);
    return JavascriptEvalUtil.convertToJavascriptValue(value,dataSet.getSharedScope());
  }
 catch (  BirtException e) {
    logger.logp(Level.FINER,JSColumnDefn.class.getName(),"String_Node_Str",e.getMessage(),e);
    return new DataExceptionMocker(e);
  }
}
Program: 72660
Project: 72660
Buggy source:
/** 
 * Fixes a PNG problem related to transparency. See http://homepage.ntlworld.com/bobosola/ for detail.
 */
protected void fixTransparentPNG(){
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Fixes a PNG problem related to transparency. See http://homepage.ntlworld.com/bobosola/ for detail.
 */
protected void fixTransparentPNG(){
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
  writer.writeCode("String_Node_Str");
}
Program: 72661
Project: 72661
Buggy source:
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  IReportContent report=tableContent.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  captionLabel.getStyle().setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  ICellContent cell=report.createCellContent();
  cell.setColSpan(tableContent.getColumnCount());
  cell.setRowSpan(1);
  cell.setColumn(0);
  captionLabel.setParent(cell);
  cell.getChildren().add(captionLabel);
  IRowContent row=report.createRowContent();
  row.getChildren().add(cell);
  cell.setParent(row);
  ITableBandContent band=report.createTableBandContent();
  band.getChildren().add(row);
  row.setParent(band);
  band.setParent(tableContent);
  PDFTableRegionLM regionLM=getTableRegionLayout();
  regionLM.initialize(band);
  regionLM.layout();
  TableArea tableRegion=(TableArea)content.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea,false,false);
      repeatRowCount++;
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}

Fixed version (ground truth):
protected void addCaption(String caption){
  if (caption == null || "String_Node_Str".equals(caption)) {
    return;
  }
  IReportContent report=tableContent.getReportContent();
  ILabelContent captionLabel=report.createLabelContent();
  captionLabel.setText(caption);
  captionLabel.getStyle().setProperty(IStyle.STYLE_TEXT_ALIGN,IStyle.CENTER_VALUE);
  ICellContent cell=report.createCellContent();
  cell.setColSpan(tableContent.getColumnCount());
  cell.setRowSpan(1);
  cell.setColumn(0);
  captionLabel.setParent(cell);
  cell.getChildren().add(captionLabel);
  IRowContent row=report.createRowContent();
  row.getChildren().add(cell);
  cell.getStyle().setProperty(IStyle.STYLE_BORDER_TOP_STYLE,IStyle.HIDDEN_VALUE);
  cell.getStyle().setProperty(IStyle.STYLE_BORDER_BOTTOM_STYLE,IStyle.HIDDEN_VALUE);
  cell.getStyle().setProperty(IStyle.STYLE_BORDER_LEFT_STYLE,IStyle.HIDDEN_VALUE);
  cell.getStyle().setProperty(IStyle.STYLE_BORDER_RIGHT_STYLE,IStyle.HIDDEN_VALUE);
  cell.setParent(row);
  ITableBandContent band=report.createTableBandContent();
  band.getChildren().add(row);
  row.setParent(band);
  band.setParent(tableContent);
  PDFTableRegionLM regionLM=getTableRegionLayout();
  regionLM.initialize(band);
  regionLM.layout();
  TableArea tableRegion=(TableArea)content.getExtension(IContent.LAYOUT_EXTENSION);
  if (tableRegion != null && tableRegion.getHeight() < getCurrentMaxContentHeight()) {
    Iterator iter=tableRegion.getChildren();
    while (iter.hasNext()) {
      RowArea rowArea=(RowArea)iter.next();
      addArea(rowArea,false,false);
      repeatRowCount++;
    }
  }
  content.setExtension(IContent.LAYOUT_EXTENSION,null);
}
Program: 72665
Project: 72665
Buggy source:
protected IStyle getElementStyle(IContent content){
  IStyle style=isEmbeddable ? content.getStyle() : content.getInlineStyle();
  if (style == null || style.isEmpty()) {
    return null;
  }
  return style;
}

Fixed version (ground truth):
protected IStyle getElementStyle(IContent content){
  IStyle style=content.getInlineStyle();
  if (style == null || style.isEmpty()) {
    return null;
  }
  return style;
}
Program: 72666
Project: 72666
Buggy source:
public HTMLEmitter(HTMLReportEmitter reportEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  this.reportEmitter=reportEmitter;
  this.writer=writer;
  this.isEmbeddable=isEmbeddable;
  this.layoutPreference=layoutPreference;
}

Fixed version (ground truth):
public HTMLEmitter(HTMLReportEmitter reportEmitter,HTMLWriter writer,String layoutPreference){
  this.reportEmitter=reportEmitter;
  this.writer=writer;
  this.layoutPreference=layoutPreference;
}
Program: 72667
Project: 72667
Buggy source:
public HTMLPerformanceOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  super(reportEmitter,writer,isEmbeddable,layoutPreference);
}

Fixed version (ground truth):
public HTMLPerformanceOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,String layoutPreference){
  super(reportEmitter,writer,layoutPreference);
}
Program: 72668
Project: 72668
Buggy source:
/** 
 * Build the style of column
 */
public void buildColumnStyle(IColumn column,StringBuffer styleBuffer){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,column.getWidth());
  IStyle style=column.getStyle();
  CSSValue display=style.getProperty(IStyle.STYLE_DISPLAY);
  if (IStyle.NONE_VALUE == display) {
    styleBuffer.append("String_Node_Str");
  }
  String value=style.getVerticalAlign();
  if (null != value) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(value);
    styleBuffer.append("String_Node_Str");
  }
  if (!isEmbeddable) {
    style=column.getInlineStyle();
    if (style == null) {
      return;
    }
  }
  if (style.isEmpty()) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}

Fixed version (ground truth):
/** 
 * Build the style of column
 */
public void buildColumnStyle(IColumn column,StringBuffer styleBuffer){
  buildSize(styleBuffer,HTMLTags.ATTR_WIDTH,column.getWidth());
  IStyle style=column.getStyle();
  CSSValue display=style.getProperty(IStyle.STYLE_DISPLAY);
  if (IStyle.NONE_VALUE == display) {
    styleBuffer.append("String_Node_Str");
  }
  String value=style.getVerticalAlign();
  if (null != value) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(value);
    styleBuffer.append("String_Node_Str");
  }
  style=column.getInlineStyle();
  if (style == null || style.isEmpty()) {
    return;
  }
  AttributeBuilder.buildFont(styleBuffer,style);
  AttributeBuilder.buildBox(styleBuffer,style);
  AttributeBuilder.buildBackground(styleBuffer,style,reportEmitter);
  AttributeBuilder.buildText(styleBuffer,style);
  AttributeBuilder.buildVisual(styleBuffer,style);
  AttributeBuilder.buildTextDecoration(styleBuffer,style);
}
Program: 72669
Project: 72669
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (isEmbeddable) {
    return;
  }
  if (styleName != null && outputtedStyles.contains(styleName)) {
    classBuffer.append(styleName);
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (styleName != null && outputtedStyles.contains(styleName)) {
    classBuffer.append(styleName);
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 72671
Project: 72671
Buggy source:
public HTMLVisionOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,boolean isEmbeddable,String layoutPreference){
  super(reportEmitter,writer,isEmbeddable,layoutPreference);
}

Fixed version (ground truth):
public HTMLVisionOptimize(HTMLReportEmitter reportEmitter,HTMLWriter writer,String layoutPreference){
  super(reportEmitter,writer,layoutPreference);
}
Program: 72674
Project: 72674
Buggy source:
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}

Fixed version (ground truth):
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
  if (px <= 0) {
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}
Program: 72675
Project: 72675
Buggy source:
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}

Fixed version (ground truth):
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}
Program: 72676
Project: 72676
Buggy source:
/** 
 * Gets the height
 * @return
 */
public int getHeight(){
  DimensionHandle handle=getRowHandle().getHeight();
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    px=DEFAULT_HEIGHT;
  }
  return px;
}

Fixed version (ground truth):
/** 
 * Gets the height
 * @return
 */
public int getHeight(){
  DimensionHandle handle=getRowHandle().getHeight();
  int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
  if (px <= 0) {
    px=DEFAULT_HEIGHT;
  }
  return px;
}
Program: 72677
Project: 72677
Buggy source:
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
  if (px <= 0) {
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}

Fixed version (ground truth):
/** 
 * Gets the width
 * @return the width
 */
public int getWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(handle.getUnits())) {
    Object obj=getTableParent();
    if (obj instanceof GridHandle) {
      obj=HandleAdapterFactory.getInstance().getGridHandleAdapter(obj);
    }
 else {
      obj=HandleAdapterFactory.getInstance().getTableHandleAdapter(obj);
    }
    if (obj instanceof TableHandleAdapter) {
      int containerWidth=((TableHandleAdapter)obj).getClientAreaSize().width;
      return (int)(handle.getMeasure() * containerWidth / 100);
    }
  }
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
    return adapter.getDefaultWidth(getColumnNumber());
  }
  return px;
}
Program: 72678
Project: 72678
Buggy source:
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}

Fixed version (ground truth):
/** 
 * Returns the raw column with, if it's a fix value, covert it to Pixel unit, if it's a relative value or none, retain it.
 * @return The raw width
 */
public String getRawWidth(){
  DimensionHandle handle=getColumnHandle().getWidth();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    return "String_Node_Str";
  }
 else   if (unit.equals(DesignChoiceConstants.UNITS_PERCENTAGE)) {
    return String.valueOf(handle.getMeasure()) + unit;
  }
 else {
    int px=(int)DEUtil.convertoToPixel(handle);
    if (px <= 0) {
      TableHandleAdapter adapter=HandleAdapterFactory.getInstance().getTableHandleAdapter(getTableParent());
      return String.valueOf(adapter.getDefaultWidth(getColumnNumber()));
    }
    return String.valueOf(px);
  }
}
Program: 72679
Project: 72679
Buggy source:
/** 
 * Gets the height
 * @return
 */
public int getHeight(){
  DimensionHandle handle=getRowHandle().getHeight();
  int px=(int)(DEUtil.convertoToPixel(handle) + 0.5);
  if (px <= 0) {
    px=DEFAULT_HEIGHT;
  }
  return px;
}

Fixed version (ground truth):
/** 
 * Gets the height
 * @return
 */
public int getHeight(){
  DimensionHandle handle=getRowHandle().getHeight();
  int px=(int)DEUtil.convertoToPixel(handle);
  if (px <= 0) {
    px=DEFAULT_HEIGHT;
  }
  return px;
}
Program: 72680
Project: 72680
Buggy source:
private void loadDteMetaInfo(IDocArchiveReader reader) throws IOException {
  ArrayList result=DteMetaInfoIOUtil.loadAllDteMetaInfo(reader);
  if (result != null) {
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < result.size(); i++) {
      String[] rsetRelation=(String[])result.get(i);
      String pRsetId=rsetRelation[0];
      String rowId=rsetRelation[1];
      String queryId=rsetRelation[2];
      String rsetId=rsetRelation[3];
      buffer.setLength(0);
      buffer.append(pRsetId);
      buffer.append("String_Node_Str");
      buffer.append(rowId);
      buffer.append("String_Node_Str");
      buffer.append(queryId);
      rsetRelations.put(buffer.toString(),rsetId);
    }
  }
}

Fixed version (ground truth):
private void loadDteMetaInfo(IDocArchiveReader reader) throws IOException {
  ArrayList result=DteMetaInfoIOUtil.loadAllDteMetaInfo(reader);
  if (result != null) {
    for (int i=0; i < result.size(); i++) {
      String[] rsetRelation=(String[])result.get(i);
      String pRsetId=rsetRelation[0];
      String rowId=rsetRelation[1];
      String queryId=rsetRelation[2];
      String rsetId=rsetRelation[3];
      addResultSetRelation(pRsetId,rowId,queryId,rsetId);
    }
  }
}
Program: 72681
Project: 72681
Buggy source:
protected String getResultID(String pRsetId,String rowId,String queryId){
  keyBuffer.setLength(0);
  keyBuffer.append(pRsetId);
  keyBuffer.append("String_Node_Str");
  keyBuffer.append(rowId);
  keyBuffer.append("String_Node_Str");
  keyBuffer.append(queryId);
  String rsetId=(String)rsetRelations.get(keyBuffer.toString());
  if (rsetId == null) {
    if (pRsetId != null) {
      int charAt=pRsetId.indexOf("String_Node_Str");
      if (charAt != -1) {
        String rootId=pRsetId.substring(0,charAt);
        keyBuffer.setLength(0);
        keyBuffer.append(rootId);
        keyBuffer.append("String_Node_Str");
        keyBuffer.append(rowId);
        keyBuffer.append("String_Node_Str");
        keyBuffer.append(queryId);
        rsetId=(String)rsetRelations.get(keyBuffer.toString());
      }
    }
  }
  return rsetId;
}

Fixed version (ground truth):
protected String getResultID(String pRsetId,String rowId,String queryId){
  int intRowId=Integer.parseInt(rowId);
  String resultSetId=findResultSetId(pRsetId,intRowId,queryId);
  if (resultSetId == null) {
    if (pRsetId != null) {
      int charAt=pRsetId.indexOf("String_Node_Str");
      if (charAt != -1) {
        String rootId=pRsetId.substring(0,charAt);
        resultSetId=findResultSetId(rootId,intRowId,queryId);
      }
    }
  }
  return resultSetId;
}
Program: 72682
Project: 72682
Buggy source:
public DerbyClassLoader(){
  super(new URL[0],DerbyClassLoader.class.getClassLoader());
  Bundle derbyBundle=Platform.getBundle("String_Node_Str");
  if (derbyBundle == null) {
    logger.severe("String_Node_Str");
  }
 else {
    URL fileURL=derbyBundle.getEntry("String_Node_Str");
    if (fileURL == null) {
      logger.severe("String_Node_Str");
    }
 else {
      addURL(fileURL);
      isGood=true;
    }
  }
}

Fixed version (ground truth):
public DerbyClassLoader(){
  super(new URL[0],DerbyClassLoader.class.getClassLoader());
  Bundle derbyBundle=Platform.getBundle("String_Node_Str");
  if (derbyBundle == null) {
    logger.severe("String_Node_Str");
  }
 else {
    URL fileURL=derbyBundle.getEntry("String_Node_Str");
    try {
      fileURL=FileLocator.toFileURL(fileURL);
      if (fileURL == null) {
        logger.severe("String_Node_Str");
      }
 else {
        addURL(fileURL);
        isGood=true;
      }
    }
 catch (    IOException e) {
      logger.severe("String_Node_Str");
    }
  }
}
Program: 72683
Project: 72683
Buggy source:
/** 
 * @param figure
 * @param g
 * @param side
 * @param style
 * @param width the border width array, arranged by {top, bottom, left, right};
 * @param color
 * @param insets
 */
protected void drawBorder(IFigure figure,Graphics g,int side,int style,int[] width,String color,Insets insets){
  Rectangle r=figure.getBounds().getCopy().crop(DEFAULT_CROP).crop(insets);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(ColorUtil.parseColor(color)));
    if (style == -2) {
      BorderUtil.drawDoubleLine(g,side,width,r);
    }
 else {
      BorderUtil.drawSingleLine(g,side,style,width,r);
    }
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}

Fixed version (ground truth):
/** 
 * @param figure
 * @param g
 * @param side
 * @param style
 * @param width the border width array, arranged by {top, bottom, left, right};
 * @param color
 * @param insets
 */
protected void drawBorder(IFigure figure,Graphics g,int side,int style,int[] width,String color,Insets insets){
  Rectangle r=figure.getBounds().getCopy().crop(DEFAULT_CROP).crop(insets);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(ColorUtil.parseColor(color)));
    BorderUtil.drawBorderLine(g,side,style,width,r);
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}
Program: 72684
Project: 72684
Buggy source:
/** 
 * @param figure
 * @param g
 * @param side
 * @param style
 * @param width the border width array, arranged by {top, bottom, left, right};
 * @param color
 * @param insets
 */
protected void drawBorder(IFigure figure,Graphics g,int side,int style,int[] width,int color,Insets insets){
  Rectangle r=figure.getBounds().getCopy().crop(insets);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(color));
    if (style == -2) {
      BorderUtil.drawDoubleLine(g,side,width,r);
    }
 else {
      BorderUtil.drawSingleLine(g,side,style,width,r);
    }
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}

Fixed version (ground truth):
/** 
 * @param figure
 * @param g
 * @param side
 * @param style
 * @param width the border width array, arranged by {top, bottom, left, right};
 * @param color
 * @param insets
 */
protected void drawBorder(IFigure figure,Graphics g,int side,int style,int[] width,int color,Insets insets){
  Rectangle r=figure.getBounds().getCopy().crop(insets);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(color));
    BorderUtil.drawBorderLine(g,side,style,width,r);
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}
Program: 72685
Project: 72685
Buggy source:
/** 
 * Draw border of the section
 * @param figure
 * @param g
 * @param in
 * @param side
 * @param style
 * @param width
 * @param color
 */
private void drawBorder(IFigure figure,Graphics g,Insets in,int side,int style,int[] width,int color){
  Rectangle r=figure.getBounds().getCropped(in);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(color));
    if (style == -2) {
      BorderUtil.drawDoubleLine(g,side,width,r);
    }
 else {
      BorderUtil.drawSingleLine(g,side,style,width,r);
    }
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}

Fixed version (ground truth):
/** 
 * Draw border of the section
 * @param figure
 * @param g
 * @param in
 * @param side
 * @param style
 * @param width
 * @param color
 */
private void drawBorder(IFigure figure,Graphics g,Insets in,int side,int style,int[] width,int color){
  Rectangle r=figure.getBounds().getCropped(in);
  if (style != 0) {
    g.setForegroundColor(ColorManager.getColor(color));
    BorderUtil.drawBorderLine(g,side,style,width,r);
  }
 else {
    g.setForegroundColor(ReportColorConstants.ShadowLineColor);
    BorderUtil.drawDefaultLine(g,side,r);
  }
  g.restoreState();
}
Program: 72690
Project: 72690
Buggy source:
public Object visitGridItem(GridItemDesign grid,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(grid,value);
  parentNode=currentNode;
  int count=grid.getRowCount();
  for (int i=0; i < count; i++) {
    RowDesign row=grid.getRow(i);
    row.accept(this,null);
  }
  parentNode=parent;
  return Boolean.TRUE;
}

Fixed version (ground truth):
public Object visitGridItem(GridItemDesign grid,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(grid,value);
  parentNode=currentNode;
  currentNode.breakAfter=true;
  int count=grid.getRowCount();
  for (int i=0; i < count; i++) {
    RowDesign row=grid.getRow(i);
    row.accept(this,null);
  }
  parentNode=parent;
  return Boolean.TRUE;
}
Program: 72691
Project: 72691
Buggy source:
public Object visitListing(ListingDesign listing,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(listing,Boolean.TRUE);
  parentNode=currentNode;
  BandDesign header=listing.getHeader();
  if (header != null) {
    header.accept(this,null);
  }
  int groupCount=listing.getGroupCount();
  if (groupCount > 0) {
    processGroup(listing,0,header != null);
    processGroup(listing,0,false);
  }
 else {
    processDetail(listing,header != null);
    processDetail(listing,false);
  }
  BandDesign footer=listing.getFooter();
  if (footer != null) {
    footer.accept(this,Boolean.TRUE);
  }
  parentNode=parent;
  return Boolean.TRUE;
}

Fixed version (ground truth):
public Object visitListing(ListingDesign listing,Object value){
  PolicyNode parent=parentNode;
  visitReportItem(listing,Boolean.TRUE);
  parentNode=currentNode;
  currentNode.breakAfter=true;
  BandDesign header=listing.getHeader();
  if (header != null) {
    header.accept(this,null);
  }
  int groupCount=listing.getGroupCount();
  if (groupCount > 0) {
    processGroup(listing,0,header != null);
    processGroup(listing,0,false);
  }
 else {
    processDetail(listing,header != null);
    processDetail(listing,false);
  }
  BandDesign footer=listing.getFooter();
  if (footer != null) {
    footer.accept(this,Boolean.TRUE);
  }
  parentNode=parent;
  return Boolean.TRUE;
}
Program: 72692
Project: 72692
Buggy source:
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (isEmbeddable) {
    return;
  }
  if (styleName != null && outputtedStyles.contains(styleName)) {
    classBuffer.append(styleName);
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        SharedStyleHandle style=handle.getStyle();
        if (style != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + style.getName());
          }
 else {
            classBuffer.append(style.getName());
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>'class'</code> property and stores the style to styleMap object.
 * @param styleName the style name
 */
protected void setStyleName(String styleName,IContent content){
  StringBuffer classBuffer=new StringBuffer();
  if (isEmbeddable) {
    return;
  }
  if (styleName != null && outputtedStyles.contains(styleName)) {
    classBuffer.append(styleName);
  }
  if (hasCsslinks) {
    Object genBy=content.getGenerateBy();
    if (genBy instanceof StyledElementDesign) {
      DesignElementHandle handle=((StyledElementDesign)genBy).getHandle();
      if (handle != null) {
        String name=handle.getStringProperty(ReportItemHandle.STYLE_PROP);
        if (name != null) {
          if (classBuffer.length() != 0) {
            classBuffer.append("String_Node_Str" + name);
          }
 else {
            classBuffer.append(name);
          }
        }
      }
    }
  }
  if (classBuffer.length() != 0) {
    writer.attribute(HTMLTags.ATTR_CLASS,classBuffer.toString());
  }
}
Program: 72696
Project: 72696
Buggy source:
/** 
 * Create HTML render option.
 * @param svgFlag
 * @param servletPath
 * @param request
 * @return HTML render option from the given arguments
 */
private HTMLRenderOption createHTMLRenderOption(boolean svgFlag,String servletPath,HttpServletRequest request){
  String baseURL=null;
  boolean isDesigner=ParameterAccessor.isDesigner(request);
  if (!isDesigner)   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null) {
    if (ParameterAccessor.isOpenAsAttachment(request) || !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase(ParameterAccessor.getFormat(request))) {
      baseURL=request.getScheme() + "String_Node_Str" + request.getServerName()+ "String_Node_Str"+ request.getServerPort();
    }
 else {
      baseURL="String_Node_Str";
    }
  }
  baseURL+=request.getContextPath();
  HTMLRenderOption renderOption=new HTMLRenderOption();
  renderOption.setImageDirectory(ParameterAccessor.getImageTempFolder(request));
  renderOption.setBaseImageURL(baseURL + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setEnableAgentStyleEngine(ParameterAccessor.isAgentStyle(request));
  renderOption.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderOption;
}

Fixed version (ground truth):
/** 
 * Create HTML render option.
 * @param svgFlag
 * @param servletPath
 * @param request
 * @return HTML render option from the given arguments
 */
private HTMLRenderOption createHTMLRenderOption(boolean svgFlag,String servletPath,HttpServletRequest request){
  String baseURL=null;
  if (!ParameterAccessor.isDesigner())   baseURL=ParameterAccessor.getBaseURL();
  if (baseURL == null) {
    if (ParameterAccessor.isOpenAsAttachment(request) || !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase(ParameterAccessor.getFormat(request))) {
      baseURL=request.getScheme() + "String_Node_Str" + request.getServerName()+ "String_Node_Str"+ request.getServerPort();
    }
 else {
      baseURL="String_Node_Str";
    }
  }
  baseURL+=request.getContextPath();
  HTMLRenderOption renderOption=new HTMLRenderOption();
  renderOption.setImageDirectory(ParameterAccessor.getImageTempFolder(request));
  renderOption.setBaseImageURL(baseURL + imageBaseUrl);
  if (servletPath != null && servletPath.length() > 0) {
    renderOption.setBaseURL(baseURL + servletPath);
  }
 else {
    renderOption.setBaseURL(baseURL + IBirtConstants.SERVLET_PATH_RUN);
  }
  renderOption.setEnableAgentStyleEngine(ParameterAccessor.isAgentStyle(request));
  renderOption.setSupportedImageFormats(svgFlag ? "String_Node_Str" : "String_Node_Str");
  return renderOption;
}
Program: 72700
Project: 72700
Buggy source:
/** 
 * Returns appcontext
 * @param request
 * @return
 */
public static Map getAppContext(HttpServletRequest request){
  HashMap context=new HashMap();
  Boolean isDesigner=Boolean.valueOf(ParameterAccessor.isDesigner(request));
  context.put("String_Node_Str",isDesigner);
  context.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,request);
  context.put(EngineConstants.APPCONTEXT_CHART_RESOLUTION,ParameterAccessor.getDpi(request));
  int maxCubeRowLevels=ParameterAccessor.getMaxCubeRowLevels(request);
  if (maxCubeRowLevels >= 0)   context.put(DataEngine.CUBECUSROR_FETCH_LIMIT_ON_ROW_EDGE,new Integer(maxCubeRowLevels));
  int maxCubeColumnLevels=ParameterAccessor.getMaxCubeColumnLevels(request);
  if (maxCubeColumnLevels >= 0)   context.put(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_COLUMN_EDGE,new Integer(maxCubeColumnLevels));
  int cubeMemorySize=ParameterAccessor.getCubeMemorySize(request);
  if (cubeMemorySize >= 0)   context.put(DataEngine.IN_MEMORY_CUBE_SIZE,new Integer(cubeMemorySize));
  context.put(IBirtConstants.APPCONTEXT_BIRT_RESOURCE_PATH,ParameterAccessor.getResourceFolder(request));
  ParameterAccessor.pushAppContext(context,request);
  if (isDesigner.booleanValue()) {
    String appContextName=ParameterAccessor.getAppContextName(request);
    getAppContextFromExtension(appContextName,context);
  }
  return context;
}

Fixed version (ground truth):
/** 
 * Returns appcontext
 * @param request
 * @return
 */
public static Map getAppContext(HttpServletRequest request){
  HashMap context=new HashMap();
  Boolean isDesigner=Boolean.valueOf(ParameterAccessor.isDesigner());
  context.put("String_Node_Str",isDesigner);
  context.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,request);
  context.put(EngineConstants.APPCONTEXT_CHART_RESOLUTION,ParameterAccessor.getDpi(request));
  int maxCubeRowLevels=ParameterAccessor.getMaxCubeRowLevels(request);
  if (maxCubeRowLevels >= 0)   context.put(DataEngine.CUBECUSROR_FETCH_LIMIT_ON_ROW_EDGE,new Integer(maxCubeRowLevels));
  int maxCubeColumnLevels=ParameterAccessor.getMaxCubeColumnLevels(request);
  if (maxCubeColumnLevels >= 0)   context.put(DataEngine.CUBECURSOR_FETCH_LIMIT_ON_COLUMN_EDGE,new Integer(maxCubeColumnLevels));
  int cubeMemorySize=ParameterAccessor.getCubeMemorySize(request);
  if (cubeMemorySize >= 0)   context.put(DataEngine.IN_MEMORY_CUBE_SIZE,new Integer(cubeMemorySize));
  context.put(IBirtConstants.APPCONTEXT_BIRT_RESOURCE_PATH,ParameterAccessor.getResourceFolder(request));
  ParameterAccessor.pushAppContext(context,request);
  if (isDesigner.booleanValue()) {
    String appContextName=ParameterAccessor.getAppContextName(request);
    getAppContextFromExtension(appContextName,context);
  }
  return context;
}
Program: 72701
Project: 72701
Buggy source:
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   setNativeType(modelParam.getNativeDataType().intValue());
  if (modelParam instanceof OdaDataSetParameterHandle) {
    setNativeName(((OdaDataSetParameterHandle)modelParam).getNativeName());
  }
  setType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  if (modelParam instanceof OdaDataSetParameterHandle && ((OdaDataSetParameterHandle)modelParam).getParamName() != null) {
    setDefaultInputValue(ExpressionUtil.createJSParameterExpression(((OdaDataSetParameterHandle)modelParam).getParamName()));
  }
 else   setDefaultInputValue(modelParam.getDefaultValue());
}

Fixed version (ground truth):
public ParameterAdapter(DataSetParameterHandle modelParam){
  setName(modelParam.getName());
  if (modelParam.getPosition() != null)   setPosition(modelParam.getPosition().intValue());
  if (modelParam.getNativeDataType() != null)   setNativeType(modelParam.getNativeDataType().intValue());
  if (modelParam instanceof OdaDataSetParameterHandle) {
    setNativeName(((OdaDataSetParameterHandle)modelParam).getNativeName());
  }
  setType(org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelParam.getDataType()));
  setInputMode(modelParam.isInput());
  setOutputMode(modelParam.isOutput());
  setNullable(modelParam.allowNull());
  setInputOptional(modelParam.isOptional());
  setDefaultInputValue(modelParam.getDefaultValue());
}