nus-yam/ex-repair huggingface dataset:
Program: 78027
Project: 78027
Buggy source:
/** 
 * Adds drop support to viewer.Must set viewer before execution.
 */
public void addDropSupportToViewer(){
  final StyledText text=viewer.getTextWidget();
  DropTarget dropTarget=new DropTarget(text,DND.DROP_COPY | DND.DROP_DEFAULT);
  dropTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
  dropTarget.addDropListener(new DropTargetAdapter(){
    public void dragEnter(    DropTargetEvent event){
      text.setFocus();
      if (event.detail == DND.DROP_DEFAULT)       event.detail=DND.DROP_COPY;
      if (event.detail != DND.DROP_COPY)       event.detail=DND.DROP_NONE;
    }
    public void dragOver(    DropTargetEvent event){
      event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_INSERT_BEFORE;
    }
    public void dragOperationChanged(    DropTargetEvent event){
      dragEnter(event);
    }
    public void drop(    DropTargetEvent event){
      if (event.data instanceof String)       insertText((String)event.data);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Adds drop support to viewer.Must set viewer before execution.
 */
public void addDropSupportToViewer(){
  final StyledText text=viewer.getTextWidget();
  DropTarget dropTarget=new DropTarget(text,DND.DROP_COPY | DND.DROP_DEFAULT);
  dropTarget.setTransfer(new Transfer[]{TextTransfer.getInstance()});
  dropTarget.addDropListener(new DropTargetAdapter(){
    public void dragEnter(    DropTargetEvent event){
      text.setFocus();
      if (event.detail == DND.DROP_DEFAULT)       event.detail=DND.DROP_COPY;
      if (event.detail != DND.DROP_COPY)       event.detail=DND.DROP_NONE;
    }
    public void dragOver(    DropTargetEvent event){
      event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_SELECT;
    }
    public void dragOperationChanged(    DropTargetEvent event){
      dragEnter(event);
    }
    public void drop(    DropTargetEvent event){
      if (event.data instanceof String)       insertText((String)event.data);
    }
  }
);
}
Program: 78028
Project: 78028
Buggy source:
public void dragOver(DropTargetEvent event){
  event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_INSERT_BEFORE;
}

Fixed version (ground truth):
public void dragOver(DropTargetEvent event){
  event.feedback=DND.FEEDBACK_SCROLL | DND.FEEDBACK_SELECT;
}
Program: 78029
Project: 78029
Buggy source:
/** 
 * Constructs a new model exception.
 * @param pluginId Returns the unique identifier of the plug-in associated with this exception
 * @param errorCode used to retrieve a piece of externalized message displayed to end user.
 * @param cause the nested exception
 * @param args string arguments used to format error messages
 */
public ExtendedElementException(DesignElement element,String pluginId,String errorCode,Object[] args,Throwable cause){
  super(pluginId,errorCode,args,cause);
  this.element=element;
}

Fixed version (ground truth):
/** 
 * Constructs a new model exception.
 * @param element The element with semantic error.
 * @param pluginId Returns the unique identifier of the plug-in associated with this exception
 * @param errorCode used to retrieve a piece of externalized message displayed to end user.
 * @param cause the nested exception
 * @param args string arguments used to format error messages
 */
public ExtendedElementException(DesignElement element,String pluginId,String errorCode,Object[] args,Throwable cause){
  super(pluginId,errorCode,args,cause);
  this.element=element;
}
Program: 78030
Project: 78030
Buggy source:
/** 
 * Returns extended element exception properties.
 * @param propName property name of extended element exception.
 * @return
 */
public Object getProperty(String propName){
  return properties.get(propName);
}

Fixed version (ground truth):
/** 
 * Returns extended element exception properties.
 * @param propName property name of extended element exception.
 * @return value of extended element exception.
 */
public Object getProperty(String propName){
  return properties.get(propName);
}
Program: 78031
Project: 78031
Buggy source:
/** 
 * Returns localized message.
 */
public String getLocalizedMessage(){
}

Fixed version (ground truth):
/** 
 * Returns localized message.
 * @return localized message.
 */
public String getLocalizedMessage(){
}
Program: 78032
Project: 78032
Buggy source:
public Dimension getPreferredSize(int wHint,int hHint){
  return CONTROL_SIZE;
}

Fixed version (ground truth):
public Dimension getPreferredSize(int wHint,int hHint){
  Dimension dimension=new Dimension(0,CONTROL_SIZE.height);
  List list=getChildren();
  for (int i=0; i < list.size(); i++) {
    Figure figure=(Figure)list.get(i);
    dimension.width=dimension.width + figure.getSize().width;
  }
  return dimension;
}
Program: 78033
Project: 78033
Buggy source:
/** 
 * @param owner
 */
public ListControlDisplayNameFigure(ListBandEditPart owner){
  super();
  this.owner=owner;
  setBounds(new Rectangle(35,0,50,19));
  setBorder(new MarginBorder(8,0,0,0));
}

Fixed version (ground truth):
/** 
 * @param owner
 */
public ListControlDisplayNameFigure(ListBandEditPart owner){
  super();
  this.owner=owner;
  text=(((ListBandProxy)owner.getModel()).getDisplayName());
  Font font=getFont();
  if (font == null) {
    GC gc=new GC(new Shell());
    font=gc.getFont();
  }
  int width=FigureUtilities.getTextWidth(text,font);
  setBounds(new Rectangle(35,0,width + DISPLAY_MARGIN.right,19));
  setBorder(new MarginBorder(8,0,0,0));
}
Program: 78034
Project: 78034
Buggy source:
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,RDSaveUtil saveUtil,List manualBindingExprs,Map autoBindingExprs){
  this.odiResult=ri;
  this.scope=scope;
  this.saveUtil=saveUtil;
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
}

Fixed version (ground truth):
/** 
 * @param ri
 * @param scope
 * @param saveUtil
 * @param serviceForResultSet
 */
BindingColumnsEvalUtil(IResultIterator ri,Scriptable scope,RDSaveUtil saveUtil,List manualBindingExprs,Map autoBindingExprs){
  this.odiResult=ri;
  this.scope=scope;
  this.saveUtil=saveUtil;
  try {
    this.isBasedOnRD=ExprMetaUtil.isBasedOnRD(ri.getResultClass());
    if (this.isBasedOnRD == true)     this.evalHelper=new EvalHelper(ri);
  }
 catch (  DataException e) {
  }
  this.initBindingColumns(manualBindingExprs,autoBindingExprs);
}
Program: 78035
Project: 78035
Buggy source:
/** 
 * @param baseExpr
 * @param exprType
 * @param valueMap
 * @throws DataException
 */
private void evaluateValue(BindingColumn bindingColumn,Map valueMap,int exprType) throws DataException {
  Object exprValue;
  try {
    if (exprType == MANUAL_BINDING)     exprValue=ExprEvaluateUtil.evaluateExpression(bindingColumn.baseExpr,odiResult,scope);
 else     exprValue=ExprEvaluateUtil.evaluateRawExpression(bindingColumn.baseExpr,scope);
  }
 catch (  BirtException e) {
    exprValue=e;
  }
  valueMap.put(bindingColumn.columnName,exprValue);
  if (exprValue instanceof BirtException == false)   saveUtil.doSaveExpr(bindingColumn.columnName,exprValue);
}

Fixed version (ground truth):
/** 
 * @param baseExpr
 * @param exprType
 * @param valueMap
 * @throws DataException
 */
private void evaluateValue(BindingColumn bindingColumn,Map valueMap,int exprType) throws DataException {
  Object exprValue=null;
  try {
    boolean getValue=false;
    if (isBasedOnRD == true) {
      String columnName=bindingColumn.columnName;
      if (evalHelper.contains(columnName)) {
        getValue=true;
        exprValue=evalHelper.getValue(columnName);
      }
    }
    if (getValue == false) {
      if (exprType == MANUAL_BINDING)       exprValue=ExprEvaluateUtil.evaluateExpression(bindingColumn.baseExpr,odiResult,scope);
 else       exprValue=ExprEvaluateUtil.evaluateRawExpression(bindingColumn.baseExpr,scope);
    }
  }
 catch (  BirtException e) {
    exprValue=e;
  }
  valueMap.put(bindingColumn.columnName,exprValue);
  if (exprValue instanceof BirtException == false)   saveUtil.doSaveExpr(bindingColumn.columnName,exprValue);
}
Program: 78036
Project: 78036
Buggy source:
/** 
 * @param inExprMetas
 * @return
 */
public static ExprMetaInfo[] buildExprDataMetaInfo(ExprMetaInfo[] inExprMetas){
  ExprMetaInfo[] exprMetas=null;
  if (isBasedOnSecondRD(inExprMetas) == false) {
    exprMetas=new ExprMetaInfo[inExprMetas.length + 2];
    System.arraycopy(inExprMetas,0,exprMetas,0,inExprMetas.length);
    ExprMetaInfo[] tempExprMetaInfo=getAssistExprMetaInfo();
    System.arraycopy(tempExprMetaInfo,0,exprMetas,inExprMetas.length,tempExprMetaInfo.length);
  }
 else {
    exprMetas=inExprMetas;
  }
  return exprMetas;
}

Fixed version (ground truth):
/** 
 * @param inExprMetas
 * @return
 */
public static ExprMetaInfo[] buildExprDataMetaInfo(ExprMetaInfo[] inExprMetas){
  ExprMetaInfo[] exprMetas=null;
  if (isBasedOnRD(inExprMetas) == false) {
    exprMetas=new ExprMetaInfo[inExprMetas.length + 2];
    System.arraycopy(inExprMetas,0,exprMetas,0,inExprMetas.length);
    ExprMetaInfo[] tempExprMetaInfo=getAssistExprMetaInfo();
    System.arraycopy(tempExprMetaInfo,0,exprMetas,inExprMetas.length,tempExprMetaInfo.length);
  }
 else {
    exprMetas=inExprMetas;
  }
  return exprMetas;
}
Program: 78037
Project: 78037
Buggy source:
/** 
 * @return
 */
private static ExprMetaInfo[] getAssistExprMetaInfo(){
  final String FILTER_NAME="String_Node_Str";
  ExprMetaInfo[] exprMetas=new ExprMetaInfo[2];
  exprMetas[0]=new ExprMetaInfo();
  exprMetas[0].setName(POS_NAME);
  exprMetas[0].setGroupLevel(0);
  exprMetas[0].setDataType(DataType.INTEGER_TYPE);
  exprMetas[0].setType(ExprMetaInfo.SCRIPT_EXPRESSION);
  exprMetas[0].setJSText("String_Node_Str");
  exprMetas[1]=new ExprMetaInfo();
  exprMetas[1].setName(FILTER_NAME);
  exprMetas[1].setGroupLevel(0);
  exprMetas[1].setType(ExprMetaInfo.SCRIPT_EXPRESSION);
  exprMetas[1].setDataType(DataType.BOOLEAN_TYPE);
  exprMetas[1].setJSText(null);
  return exprMetas;
}

Fixed version (ground truth):
/** 
 * @return
 */
private static ExprMetaInfo[] getAssistExprMetaInfo(){
  ExprMetaInfo[] exprMetas=new ExprMetaInfo[2];
  exprMetas[0]=new ExprMetaInfo();
  exprMetas[0].setName(POS_NAME);
  exprMetas[0].setGroupLevel(0);
  exprMetas[0].setDataType(DataType.INTEGER_TYPE);
  exprMetas[0].setType(ExprMetaInfo.SCRIPT_EXPRESSION);
  exprMetas[0].setJSText("String_Node_Str");
  exprMetas[1]=new ExprMetaInfo();
  exprMetas[1].setName(FILTER_NAME);
  exprMetas[1].setGroupLevel(0);
  exprMetas[1].setType(ExprMetaInfo.SCRIPT_EXPRESSION);
  exprMetas[1].setDataType(DataType.BOOLEAN_TYPE);
  exprMetas[1].setJSText(null);
  return exprMetas;
}
Program: 78038
Project: 78038
Buggy source:
public URL findResource(ModuleHandle moduleHandle,String fileName,int type){
  if (fileName == null)   return null;
  try {
    File f=new File(fileName);
    if (f.isAbsolute())     return f.exists() && f.isFile() ? f.getCanonicalFile().toURL() : null;
    String resourcePath=moduleHandle.getModule().getSession().getBirtResourcePath();
    if (resourcePath != null) {
      f=new File(resourcePath,fileName);
      if (f.exists() && f.isFile())       return f.getCanonicalFile().toURL();
    }
    if (moduleHandle == null)     return null;
    URL systemId=moduleHandle.getModule().getSystemId();
    if (systemId == null)     return null;
    if (URIUtil.FILE_SCHEMA.equalsIgnoreCase(systemId.getProtocol()))     return tryFileSearch(systemId,fileName);
 else     return new URL(systemId,URIUtil.convertFileNameToURLString(fileName));
  }
 catch (  MalformedURLException e) {
  }
catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
public URL findResource(ModuleHandle moduleHandle,String fileName,int type){
  if (fileName == null)   return null;
  try {
    File f=new File(fileName);
    if (f.isAbsolute())     return f.exists() && f.isFile() ? f.getCanonicalFile().toURL() : null;
    try {
      URL objURI=new URL(fileName);
      if (URIUtil.FILE_SCHEMA.equalsIgnoreCase(objURI.getProtocol())) {
        f=new File(objURI.getPath());
        if (f.isAbsolute())         return f.exists() && f.isFile() ? f.getCanonicalFile().toURL() : null;
      }
    }
 catch (    MalformedURLException e) {
    }
    String resourcePath=moduleHandle.getModule().getSession().getBirtResourcePath();
    if (resourcePath != null) {
      f=new File(resourcePath,fileName);
      if (f.exists() && f.isFile())       return f.getCanonicalFile().toURL();
    }
    if (moduleHandle == null)     return null;
    URL systemId=moduleHandle.getModule().getSystemId();
    if (systemId == null)     return null;
    if (URIUtil.FILE_SCHEMA.equalsIgnoreCase(systemId.getProtocol()))     return tryFileSearch(systemId,fileName);
    return new URL(systemId,URIUtil.convertFileNameToURLString(fileName));
  }
 catch (  MalformedURLException e) {
  }
catch (  IOException e) {
  }
  return null;
}
Program: 78039
Project: 78039
Buggy source:
/** 
 * Creates bound columns for report item.
 * @param element the report item
 * @param module the root of the report item
 */
private void dealReportItem(ReportItem element,Module module){
  dealStyle(element,module);
  String value=(String)element.getLocalProperty(module,ReportItem.TOC_PROP);
  if (value != null)   handleBoundsForValue(element,module,value);
  value=(String)element.getLocalProperty(module,ReportItem.BOOKMARK_PROP);
  if (value != null)   handleBoundsForValue(element,module,value);
  value=(String)element.getLocalProperty(module,ReportItem.ON_CREATE_METHOD);
  if (value != null)   handleBoundsForValue(element,module,value);
  List paramBindings=(List)element.getLocalProperty(module,ReportItem.PARAM_BINDINGS_PROP);
  if (paramBindings != null && paramBindings.size() > 0) {
    for (int i=0; i < paramBindings.size(); i++) {
      ParamBinding paramValue=(ParamBinding)paramBindings.get(i);
      handleBoundsForParamBinding(element,module,paramValue.getExpression());
    }
  }
  List hideRules=(List)element.getLocalProperty(module,ReportItem.VISIBILITY_PROP);
  if (hideRules != null && hideRules.size() > 0) {
    for (int i=0; i < hideRules.size(); i++) {
      HideRule paramValue=(HideRule)hideRules.get(i);
      handleBoundsForValue(element,module,paramValue.getExpression());
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates bound columns for report item.
 * @param element the report item
 * @param module the root of the report item
 */
protected void dealReportItem(ReportItem element,Module module){
  dealStyle(element,module);
  String value=(String)element.getLocalProperty(module,ReportItem.TOC_PROP);
  if (value != null)   handleBoundsForValue(element,module,value);
  value=(String)element.getLocalProperty(module,ReportItem.BOOKMARK_PROP);
  if (value != null)   handleBoundsForValue(element,module,value);
  value=(String)element.getLocalProperty(module,ReportItem.ON_CREATE_METHOD);
  if (value != null)   handleBoundsForValue(element,module,value);
  List paramBindings=(List)element.getLocalProperty(module,ReportItem.PARAM_BINDINGS_PROP);
  if (paramBindings != null && paramBindings.size() > 0) {
    for (int i=0; i < paramBindings.size(); i++) {
      ParamBinding paramValue=(ParamBinding)paramBindings.get(i);
      handleBoundsForParamBinding(element,module,paramValue.getExpression());
    }
  }
  List hideRules=(List)element.getLocalProperty(module,ReportItem.VISIBILITY_PROP);
  if (hideRules != null && hideRules.size() > 0) {
    for (int i=0; i < hideRules.size(); i++) {
      HideRule paramValue=(HideRule)hideRules.get(i);
      handleBoundsForValue(element,module,paramValue.getExpression());
    }
  }
}
Program: 78040
Project: 78040
Buggy source:
/** 
 * Creates bound columns for extended item.
 * @param element the extended item
 * @param module the root of the report item
 */
protected void dealExtendedItem(ExtendedItem element,Module module){
  dealReportItem(element,module);
  List values=(List)element.getLocalProperty(module,ExtendedItem.FILTER_PROP);
  if (!(values == null || values.size() < 1)) {
    for (int i=0; i < values.size(); i++) {
      FilterCondition struct=(FilterCondition)values.get(i);
      handleBoundsForValue(element,module,struct.getExpr());
      handleBoundsForValue(element,module,struct.getValue1());
      handleBoundsForValue(element,module,struct.getValue2());
    }
  }
  Object reportItem=element.getExtendedElement();
  if (reportItem != null && reportItem instanceof ICompatibleReportItem) {
    List jsExprs=((ICompatibleReportItem)reportItem).getRowExpressions();
    Map updatedExprs=DataBoundColumnUtil.handleJavaExpression(jsExprs,element,module);
    ((ICompatibleReportItem)reportItem).updateRowExpressions(updatedExprs);
  }
}

Fixed version (ground truth):
/** 
 * Creates bound columns for extended item.
 * @param element the extended item
 * @param module the root of the report item
 */
protected void dealExtendedItem(ExtendedItem element,Module module){
  dealReportItem(element,module);
  List values=(List)element.getLocalProperty(module,ExtendedItem.FILTER_PROP);
  if (!(values == null || values.size() < 1)) {
    for (int i=0; i < values.size(); i++) {
      FilterCondition struct=(FilterCondition)values.get(i);
      handleBoundsForValue(element,module,struct.getExpr());
      handleBoundsForValue(element,module,struct.getValue1());
      handleBoundsForValue(element,module,struct.getValue2());
    }
  }
  Object reportItem=element.getExtendedElement();
  if (reportItem != null && reportItem instanceof ICompatibleReportItem) {
    List jsExprs=((ICompatibleReportItem)reportItem).getRowExpressions();
    for (int i=0; i < jsExprs.size(); i++)     handleBoundsForValue(element,module,(String)jsExprs.get(i));
    Map updatedExprs=DataBoundColumnUtil.handleJavaExpression(jsExprs,element,module);
    ((ICompatibleReportItem)reportItem).updateRowExpressions(updatedExprs);
  }
}
Program: 78041
Project: 78041
Buggy source:
/** 
 * @param expr
 * @param odiResult
 * @param scope
 * @return
 * @throws DataException
 */
public static Object evaluateCompiledExpression(CompiledExpression expr,IResultIterator odiResult,Scriptable scope) throws DataException {
  if (expr instanceof ColumnReferenceExpression) {
    ColumnReferenceExpression colref=(ColumnReferenceExpression)expr;
    if (colref.isIndexed()) {
      int idx=colref.getColumnindex();
      if (idx == 0)       return new Integer(odiResult.getCurrentResultIndex());
 else       if (odiResult.getCurrentResult() != null)       return odiResult.getCurrentResult().getFieldValue(idx);
 else       return null;
    }
 else {
      String name=colref.getColumnName();
      if (JSRowObject.ROW_POSITION.equals(name))       return new Integer(odiResult.getCurrentResultIndex());
 else       if (odiResult.getCurrentResult() != null)       return odiResult.getCurrentResult().getFieldValue(name);
 else       return null;
    }
  }
 else {
    Context cx=Context.enter();
    try {
      return expr.evaluate(cx,scope);
    }
  finally {
      Context.exit();
    }
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param odiResult
 * @param scope
 * @return
 * @throws DataException
 */
private static Object evaluateCompiledExpression(CompiledExpression expr,int index,IResultObject roObject,Scriptable scope) throws DataException {
  if (expr instanceof ColumnReferenceExpression) {
    ColumnReferenceExpression colref=(ColumnReferenceExpression)expr;
    if (colref.isIndexed()) {
      int idx=colref.getColumnindex();
      if (idx == 0)       return new Integer(index);
 else       if (roObject != null)       return roObject.getFieldValue(idx);
 else       return null;
    }
 else {
      String name=colref.getColumnName();
      if (JSRowObject.ROW_POSITION.equals(name))       return new Integer(index);
 else       if (roObject != null)       return roObject.getFieldValue(name);
 else       return null;
    }
  }
 else {
    Context cx=Context.enter();
    try {
      return expr.evaluate(cx,scope);
    }
  finally {
      Context.exit();
    }
  }
}
Program: 78042
Project: 78042
Buggy source:
/** 
 * @param rsObject
 * @param index
 * @param name
 * @return value
 * @throws DataException 
 */
public Object getValue(IResultObject rsObject,int index,String name) throws DataException {
  Object value=null;
  if (name.startsWith("String_Node_Str")) {
    try {
      value=rsObject.getFieldValue(name);
    }
 catch (    DataException e) {
    }
  }
 else {
    IBaseExpression dataExpr=this.exprManager.getExpr(name);
    try {
      value=evaluateValue(dataExpr,-1,rsObject,this.scope);
      value=JavascriptEvalUtil.convertJavascriptValue(value);
    }
 catch (    BirtException e) {
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * @param rsObject
 * @param index
 * @param name
 * @return value
 * @throws DataException 
 */
public Object getValue(IResultObject rsObject,int index,String name) throws DataException {
  Object value=null;
  if (name.startsWith("String_Node_Str")) {
    try {
      value=rsObject.getFieldValue(name);
    }
 catch (    DataException e) {
    }
  }
 else {
    IBaseExpression dataExpr=this.exprManager.getExpr(name);
    try {
      value=ExprEvaluateUtil.evaluateValue(dataExpr,-1,rsObject,this.scope);
      value=JavascriptEvalUtil.convertJavascriptValue(value);
    }
 catch (    BirtException e) {
    }
  }
  return value;
}
Program: 78043
Project: 78043
Buggy source:
public Object get(String name,Scriptable start){
  if ("String_Node_Str".equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getJSRowObject();
 else     return null;
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if ("String_Node_Str".equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        return null;
      }
      value=evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    valueCacheMap.put(name,value);
    return value;
  }
}

Fixed version (ground truth):
public Object get(String name,Scriptable start){
  if ("String_Node_Str".equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getJSRowObject();
 else     return null;
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if ("String_Node_Str".equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      value=ExprEvaluateUtil.evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    valueCacheMap.put(name,value);
    return value;
  }
}
Program: 78044
Project: 78044
Buggy source:
public void validate() throws ExtendedElementException {
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public List validate(){
  return null;
}
Program: 78045
Project: 78045
Buggy source:
/** 
 * Translates <code>SAXException</code>.
 * @param e a SAX exception to translate
 */
private void translate(SAXException e){
  type=DesignFileException.DESIGN_EXCEPTION_INVALID_XML;
  exceptionName=e.getClass().getName();
  message=e.getMessage();
  description.append("String_Node_Str");
  description.append(e.getClass().getName());
  description.append("String_Node_Str");
  description.append("String_Node_Str");
  description.append(e.getMessage());
  description.append("String_Node_Str");
  if (e.getCause() != null && e.getCause() instanceof RuntimeException) {
    translateRuntimeException((RuntimeException)e.getCause());
  }
}

Fixed version (ground truth):
/** 
 * Translates the <code>ExtendedElementException</code> to printable string.
 * @param e the runtime exception
 */
private void translate(ExtendedElementException e){
}
Program: 78046
Project: 78046
Buggy source:
/** 
 * The default constructor.
 */
public ErrorDetail(){
}

Fixed version (ground truth):
/** 
 * Constructs the error detail with a given exception.
 * @param e the exception types that can be translated are <code>XMLParserException</code>, <code>DesignParserException</code>, <code>SemanticException</code> , <code>SAXException</code>.
 */
public ErrorDetail(Exception e){
}
Program: 78049
Project: 78049
Buggy source:
/** 
 * Add jarPage and driverPage
 * @param tabFolder parent Composite
 */
private void addTabPages(TabFolder tabFolder){
  addJarPage(tabFolder);
  addDriverPage(tabFolder);
}

Fixed version (ground truth):
/** 
 * Add jarPage and driverPage
 * @param tabFolder parent Composite
 */
private void addTabPages(TabFolder tabFolder){
  localizeButtonWidth();
  addJarPage(tabFolder);
  addDriverPage(tabFolder);
}
Program: 78050
Project: 78050
Buggy source:
/** 
 * copy resource to the platform.  If the resources is a folder, make the same folder into the platform and copy all resources into the dest folder.
 * @param resourcePath resource path.
 * @param platform platform folder
 */
private void copyResources(String resourcePath,String platform){
  Set paths=context.getResourcePaths(resourcePath);
  for (Iterator it=paths.iterator(); it.hasNext(); ) {
    String path=(String)it.next();
    File newFile=new File(platform,path.substring(RESOURCE_BASE.length()));
    if (path.endsWith("String_Node_Str")) {
      newFile.mkdir();
      copyResources(path,platform);
    }
 else {
      try {
        if (newFile.createNewFile()) {
          InputStream is=context.getResourceAsStream(path);
          OutputStream os=new FileOutputStream(newFile);
          byte[] buffer=new byte[8192];
          int bytesRead=is.read(buffer);
          while (bytesRead != -1) {
            os.write(buffer,0,bytesRead);
            bytesRead=is.read(buffer);
          }
          is.close();
          os.close();
        }
      }
 catch (      IOException e) {
        log.log(Level.WARNING,"String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * copy resource to the platform.  If the resources is a folder, make the same folder into the platform and copy all resources into the dest folder.
 * @param resourcePath resource path.
 * @param platform platform folder
 */
private void copyResources(String resourcePath,String platform){
  Set paths=context.getResourcePaths(resourcePath);
  if (paths != null) {
    for (Iterator it=paths.iterator(); it.hasNext(); ) {
      String path=(String)it.next();
      File newFile=new File(platform,path.substring(RESOURCE_BASE.length()));
      if (path.endsWith("String_Node_Str")) {
        newFile.mkdir();
        copyResources(path,platform);
      }
 else {
        try {
          if (newFile.createNewFile()) {
            InputStream is=context.getResourceAsStream(path);
            OutputStream os=new FileOutputStream(newFile);
            byte[] buffer=new byte[8192];
            int bytesRead=is.read(buffer);
            while (bytesRead != -1) {
              os.write(buffer,0,bytesRead);
              bytesRead=is.read(buffer);
            }
            is.close();
            os.close();
          }
        }
 catch (        IOException e) {
          log.log(Level.WARNING,"String_Node_Str",e);
        }
      }
    }
  }
}
Program: 78052
Project: 78052
Buggy source:
protected IViewerReportDesignHandle getDesignHandle(HttpServletRequest request){
  IViewerReportDesignHandle design=null;
  IReportRunnable reportRunnable=null;
  IReportDocument reportDocumentInstance=ReportEngineService.getInstance().openReportDocument(this.reportDesignName,this.reportDocumentName);
  if (reportDocumentInstance != null) {
    reportRunnable=reportDocumentInstance.getReportRunnable();
    if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath())) {
      this.parameterMap=reportDocumentInstance.getParameterValues();
    }
    reportDocumentInstance.close();
  }
  if (reportRunnable == null) {
    try {
      reportRunnable=ReportEngineService.getInstance().openReportDesign(this.reportDesignName);
    }
 catch (    EngineException e) {
      e.printStackTrace();
    }
  }
  if (reportRunnable != null) {
    design=new BirtViewerReportDesignHandle(IViewerReportDesignHandle.RPT_RUNNABLE_OBJECT,reportRunnable);
  }
 else {
    design=new BirtViewerReportDesignHandle(null,reportDesignName);
  }
  return design;
}

Fixed version (ground truth):
protected IViewerReportDesignHandle getDesignHandle(HttpServletRequest request){
  IViewerReportDesignHandle design=null;
  IReportRunnable reportRunnable=null;
  IReportDocument reportDocumentInstance=ReportEngineService.getInstance().openReportDocument(this.reportDesignName,this.reportDocumentName);
  if (reportDocumentInstance != null) {
    reportRunnable=reportDocumentInstance.getReportRunnable();
    if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath())) {
      this.parameterMap=reportDocumentInstance.getParameterValues();
    }
    reportDocumentInstance.close();
  }
  if (reportRunnable == null) {
    try {
      reportRunnable=ReportEngineService.getInstance().openReportDesign(this.reportDesignName);
    }
 catch (    EngineException e) {
      this.exception=e;
    }
  }
  if (reportRunnable != null) {
    design=new BirtViewerReportDesignHandle(IViewerReportDesignHandle.RPT_RUNNABLE_OBJECT,reportRunnable);
  }
 else {
    design=new BirtViewerReportDesignHandle(null,reportDesignName);
  }
  return design;
}
Program: 78053
Project: 78053
Buggy source:
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  if (isDesigner) {
    this.parseConfigVars(request);
  }
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  Collection parameterList=this.getReportService().getParameterDefinitions(reportDesignHandle,options,false);
  this.parameters=(HashMap)getParsedParameters(reportDesignHandle,parameterList,request,options);
  this.missingParameter=validateParameters(parameterList,this.parameters);
}

Fixed version (ground truth):
protected void __initParameters(HttpServletRequest request) throws Exception {
  this.reportDesignHandle=getDesignHandle(request);
  InputOptions options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,request);
  options.setOption(InputOptions.OPT_LOCALE,locale);
  options.setOption(InputOptions.OPT_RTL,new Boolean(rtl));
  this.parameterList=this.getReportService().getParameterDefinitions(reportDesignHandle,options,false);
  if (isDesigner) {
    this.parseConfigVars(request);
  }
  this.parameters=(HashMap)getParsedParameters(reportDesignHandle,parameterList,request,options);
  this.missingParameter=validateParameters(parameterList,this.parameters);
}
Program: 78054
Project: 78054
Buggy source:
/** 
 * parse paramenters from config file.
 * @param request
 * @return
 */
protected void parseConfigVars(HttpServletRequest request){
  String reportConfigName=this.reportDesignName.replaceFirst(IBirtConstants.SUFFIX_DESIGN_FILE,IBirtConstants.SUFFIX_DESIGN_CONFIG);
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.getDefault());
  ReportDesignHandle handle=null;
  try {
    this.configMap=new HashMap();
    handle=sessionHandle.openDesign(reportConfigName);
    if (handle != null) {
      Iterator configVars=handle.configVariablesIterator();
      while (configVars != null && configVars.hasNext()) {
        ConfigVariableHandle configVar=(ConfigVariableHandle)configVars.next();
        if (configVar != null && configVar.getName() != null) {
          String paramName=getParameterName(configVar.getName());
          if (paramName != null && paramName.length() > 0) {
            this.configMap.put(paramName,configVar.getValue());
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
    try {
      if (handle != null)       handle.close();
    }
 catch (    Exception err) {
    }
  }
}

Fixed version (ground truth):
/** 
 * parse paramenters from config file.
 * @param request
 * @return
 */
protected void parseConfigVars(HttpServletRequest request){
  String reportConfigName=this.reportDesignName.replaceFirst(IBirtConstants.SUFFIX_DESIGN_FILE,IBirtConstants.SUFFIX_DESIGN_CONFIG);
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.getDefault());
  ReportDesignHandle handle=null;
  try {
    this.configMap=new HashMap();
    handle=sessionHandle.openDesign(reportConfigName);
    if (handle != null) {
      Iterator paramIr=null;
      if (parameterList != null)       paramIr=parameterList.iterator();
      Iterator configVars=handle.configVariablesIterator();
      while (configVars != null && configVars.hasNext()) {
        ConfigVariableHandle configVar=(ConfigVariableHandle)configVars.next();
        if (configVar != null && configVar.getName() != null) {
          String paramName=getParameterName(configVar.getName());
          Object paramValue=configVar.getValue();
          while (paramIr != null && paramName != null && paramValue != null && paramIr.hasNext()) {
            ParameterDefinition parameterObj=(ParameterDefinition)paramIr.next();
            if (paramName.equals(parameterObj.getName())) {
              ReportParameterConverter converter=new ReportParameterConverter(parameterObj.getPattern(),ULocale.US);
              paramValue=converter.parse(paramValue.toString(),parameterObj.getDataType());
              break;
            }
          }
          if (paramName != null && paramName.length() > 0 && paramValue != null) {
            this.configMap.put(paramName,paramValue);
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
    try {
      if (handle != null)       handle.close();
    }
 catch (    Exception err) {
    }
  }
}
Program: 78055
Project: 78055
Buggy source:
/** 
 * get parameter object.
 * @param request
 * @param parameterObj
 * @exception Throwable
 * @return
 */
protected Object getParamValueObject(HttpServletRequest request,ParameterDefinition parameterObj) throws ReportServiceException {
  String paramName=parameterObj.getName();
  String format=parameterObj.getDisplayFormat();
  Object paramValueObj=super.getParamValueObject(request,parameterObj);
  if (paramValueObj != null)   return paramValueObj;
  if (ParameterAccessor.isDesigner(request) && this.configMap != null && this.configMap.containsKey(paramName)) {
    paramValueObj=this.configMap.get(paramName);
  }
 else   if (this.parameterMap != null && this.parameterMap.containsKey(paramName)) {
    paramValueObj=this.parameterMap.get(paramName);
  }
  if (paramValueObj != null) {
    ReportParameterConverter cfgConverter=new ReportParameterConverter(format,Locale.US);
    return cfgConverter.parse(paramValueObj.toString(),parameterObj.getDataType());
  }
 else {
    return super.getParamValueObject(request,parameterObj);
  }
}

Fixed version (ground truth):
/** 
 * get parameter object.
 * @param request
 * @param parameterObj
 * @exception Throwable
 * @return
 */
protected Object getParamValueObject(HttpServletRequest request,ParameterDefinition parameterObj) throws ReportServiceException {
  String paramName=parameterObj.getName();
  Object paramValueObj=super.getParamValueObject(request,parameterObj);
  if (paramValueObj != null)   return paramValueObj;
  if (ParameterAccessor.isDesigner(request) && this.configMap != null && this.configMap.containsKey(paramName)) {
    paramValueObj=this.configMap.get(paramName);
  }
 else   if (this.parameterMap != null && this.parameterMap.containsKey(paramName)) {
    paramValueObj=this.parameterMap.get(paramName);
  }
  return paramValueObj;
}
Program: 78056
Project: 78056
Buggy source:
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters) throws ReportServiceException {
  IReportRunnable runnable;
  String reportDesignName=design.getFileName();
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  try {
    runnable=ReportEngineService.getInstance().openReportDesign(reportDesignName);
  }
 catch (  EngineException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute("String_Node_Str");
  Map parsedParams=attrBean.getParameters();
  parsedParams.putAll(this.getParsedParameters(design,runOptions,parameters));
  try {
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,(HashMap)parsedParams);
  }
 catch (  RemoteException e) {
    e.printStackTrace();
    throw new ReportServiceException(e.getLocalizedMessage());
  }
  return outputDocName;
}

Fixed version (ground truth):
public String runReport(IViewerReportDesignHandle design,String outputDocName,InputOptions runOptions,Map parameters) throws ReportServiceException {
  IReportRunnable runnable;
  HttpServletRequest request=(HttpServletRequest)runOptions.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)runOptions.getOption(InputOptions.OPT_LOCALE);
  ViewerAttributeBean attrBean=(ViewerAttributeBean)request.getAttribute("String_Node_Str");
  Map parsedParams=attrBean.getParameters();
  if (parameters != null) {
    parsedParams.putAll(parameters);
  }
  runnable=(IReportRunnable)design.getDesignObject();
  try {
    ReportEngineService.getInstance().runReport(request,runnable,outputDocName,locale,(HashMap)parsedParams);
  }
 catch (  RemoteException e) {
    e.printStackTrace();
    throw new ReportServiceException(e.getLocalizedMessage());
  }
  return outputDocName;
}
Program: 78057
Project: 78057
Buggy source:
public void runAndRenderReport(IViewerReportDesignHandle design,String outputDocName,InputOptions options,Map parameters,OutputStream out,List activeIds) throws ReportServiceException {
  String reportDesignName=design.getFileName();
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  Boolean isMasterPageContent=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  Boolean svgFlag=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  String format=(String)options.getOption(InputOptions.OPT_RENDER_FORMAT);
  Boolean isRtl=(Boolean)options.getOption(InputOptions.OPT_RTL);
  try {
    IReportRunnable runnable=ReportEngineService.getInstance().openReportDesign(reportDesignName);
    Map parsedParams=getParsedParameters(design,options,parameters);
    ReportEngineService.getInstance().runAndRenderReport(request,runnable,out,format,locale,isRtl.booleanValue(),parsedParams,isMasterPageContent.booleanValue(),svgFlag.booleanValue());
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
catch (  EngineException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void runAndRenderReport(IViewerReportDesignHandle design,String outputDocName,InputOptions options,Map parameters,OutputStream out,List activeIds) throws ReportServiceException {
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  Boolean isMasterPageContent=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  Boolean svgFlag=(Boolean)options.getOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT);
  String format=(String)options.getOption(InputOptions.OPT_RENDER_FORMAT);
  Boolean isRtl=(Boolean)options.getOption(InputOptions.OPT_RTL);
  try {
    IReportRunnable runnable=(IReportRunnable)design.getDesignObject();
    ReportEngineService.getInstance().runAndRenderReport(request,runnable,out,format,locale,isRtl.booleanValue(),parameters,isMasterPageContent.booleanValue(),svgFlag.booleanValue());
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage());
  }
}
Program: 78059
Project: 78059
Buggy source:
/** 
 * Init the bean.
 * @param request
 * @throws Exception
 */
protected void __init(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.isGetImageOperator(request)) {
    return;
  }
  this.category="String_Node_Str";
  this.masterPageContent=ParameterAccessor.isMasterPageContent(request);
  this.isDesigner=ParameterAccessor.isDesigner(request);
  this.bookmark=ParameterAccessor.getBookmark(request);
  this.reportPage=String.valueOf(ParameterAccessor.getPage(request));
  this.reportDocumentName=ParameterAccessor.getReportDocument(request);
  this.reportDesignName=ParameterAccessor.getReport(request);
  this.format=ParameterAccessor.getFormat(request);
  processReport(request);
  String title=null;
  if (title == null || title.trim().length() <= 0) {
    title=BirtResources.getString("String_Node_Str");
  }
  this.reportTitle=ParameterAccessor.htmlEncode(title);
  this.__initParameters(request);
}

Fixed version (ground truth):
/** 
 * Init the bean.
 * @param request
 * @throws Exception
 */
protected void __init(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.isGetImageOperator(request)) {
    return;
  }
  this.category="String_Node_Str";
  this.masterPageContent=ParameterAccessor.isMasterPageContent(request);
  this.isDesigner=ParameterAccessor.isDesigner(request);
  this.bookmark=ParameterAccessor.getBookmark(request);
  this.reportPage=String.valueOf(ParameterAccessor.getPage(request));
  this.reportDocumentName=ParameterAccessor.getReportDocument(request);
  this.reportDesignName=ParameterAccessor.getReport(request);
  this.format=ParameterAccessor.getFormat(request);
  this.maxRows=ParameterAccessor.getMaxRows(request);
  ReportEngineService.getInstance().setMaxRows(this.maxRows);
  processReport(request);
  String title=null;
  if (title == null || title.trim().length() <= 0) {
    title=BirtResources.getString("String_Node_Str");
  }
  this.reportTitle=ParameterAccessor.htmlEncode(title);
  this.__initParameters(request);
}
Program: 78060
Project: 78060
Buggy source:
/** 
 * Render image.
 * @param imageId
 * @param outputStream
 * @throws EngineException
 */
public void renderImage(String imageId,OutputStream outputStream) throws RemoteException {
  assert(this.imageHandler != null);
  try {
    this.imageHandler.getImage(outputStream,this.imageDirectory,imageId);
  }
 catch (  EngineException e) {
    AxisFault fault=new AxisFault();
    fault.setFaultCode(new QName("String_Node_Str"));
    fault.setFaultString(e.getLocalizedMessage());
    throw fault;
  }
}

Fixed version (ground truth):
/** 
 * Render image.
 * @param imageId
 * @param outputStream
 * @throws EngineException
 */
public void renderImage(String imageId,OutputStream outputStream) throws RemoteException {
  assert(this.imageHandler != null);
  try {
    this.imageHandler.getImage(outputStream,this.imageDirectory,imageId);
  }
 catch (  EngineException e) {
    AxisFault fault=new AxisFault(e.getLocalizedMessage());
    fault.setFaultCode(new QName("String_Node_Str"));
    fault.setFaultString(e.getLocalizedMessage());
    throw fault;
  }
}
Program: 78061
Project: 78061
Buggy source:
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param config Servlet configuration
 */
public synchronized static void initParameters(ServletConfig config){
  ServletContext context=config.getServletContext();
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=context.getRealPath("String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  isWorkingFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_WORKING_FOLDER_ACCESS_ONLY)).booleanValue();
  clearDocuments();
}

Fixed version (ground truth):
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param config Servlet configuration
 */
public synchronized static void initParameters(ServletConfig config){
  ServletContext context=config.getServletContext();
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=context.getRealPath("String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  isWorkingFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_WORKING_FOLDER_ACCESS_ONLY)).booleanValue();
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  clearDocuments();
}