nus-yam/ex-repair huggingface dataset:
Program: 65461
Project: 65461
Buggy source:
public boolean canLeave(){
  if (propertyPage instanceof DataSetEditorPage) {
    boolean okToLeave=((DataSetEditorPage)propertyPage).okToLeave();
    if (okToLeave) {
      try {
        DataSetDesign requestDesign=null;
        DesignSessionResponse response=null;
        if (dataSetSession != null) {
          requestDesign=dataSetSession.getRequest().getDataSetDesign();
          response=dataSetSession.flush().getResponse();
        }
 else         response=((DataSetEditorPage)propertyPage).collectPageResponse();
        DTPUtil.getInstance().updateDataSetHandle(response,requestDesign,(OdaDataSetHandle)((DataSetEditor)getContainer()).getModel(),false);
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return true;
  }
  if (propertyPage instanceof DataSourceEditorPage) {
    if (propertyPage.okToLeave()) {
      try {
        DataSourceDesign requestDesign=null;
        if (this.dataSourceSession != null)         requestDesign=this.dataSourceSession.getRequest().getDataSourceDesign();
        DTPUtil.getInstance().updateDataSourceHandle(((DataSourceEditorPage)propertyPage).getEditSessionResponse().getResponse(),requestDesign,(OdaDataSourceHandle)(getContainer()).getModel());
        ((DataSourceEditor)this.getContainer()).updateDesignSession();
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return propertyPage.okToLeave();
  }
  return super.canLeave();
}

Fixed version (ground truth):
public boolean canLeave(){
  if (propertyPage instanceof DataSetEditorPage) {
    try {
      DataSetDesign requestDesign=null;
      DesignSessionResponse response=null;
      if (dataSetSession != null) {
        requestDesign=dataSetSession.getRequest().getDataSetDesign();
        response=dataSetSession.flush().getResponse();
      }
 else       response=((DataSetEditorPage)propertyPage).collectPageResponse();
      DTPUtil.getInstance().updateDataSetHandle(response,requestDesign,(OdaDataSetHandle)((DataSetEditor)getContainer()).getModel(),false);
    }
 catch (    OdaException e) {
      ExceptionHandler.handle(e);
    }
    return true;
  }
  if (propertyPage instanceof DataSourceEditorPage) {
    if (propertyPage.okToLeave()) {
      try {
        DataSourceDesign requestDesign=null;
        if (this.dataSourceSession != null)         requestDesign=this.dataSourceSession.getRequest().getDataSourceDesign();
        DTPUtil.getInstance().updateDataSourceHandle(((DataSourceEditorPage)propertyPage).getEditSessionResponse().getResponse(),requestDesign,(OdaDataSourceHandle)(getContainer()).getModel());
        ((DataSourceEditor)this.getContainer()).updateDesignSession();
      }
 catch (      OdaException e) {
        ExceptionHandler.handle(e);
      }
    }
    return propertyPage.okToLeave();
  }
  return super.canLeave();
}
Program: 65462
Project: 65462
Buggy source:
/** 
 * @param ise
 * @return
 */
private static IScriptExpression constructValidScriptExpression(IScriptExpression ise){
  return ise != null && ise.getText() != null && ise.getText().trim().length() > 0 ? ise : new ScriptExpression("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param ise
 * @return
 */
private static IScriptExpression constructValidScriptExpression(IScriptExpression ise){
  if (ise != null && BaseExpression.constantId.equals(ise.getScriptId()))   return ise;
  return ise != null && ise.getText() != null && ise.getText().trim().length() > 0 ? ise : new ScriptExpression("String_Node_Str");
}
Program: 65463
Project: 65463
Buggy source:
/** 
 * compares two row indexes, actually compares two rows pointed by the two row indexes
 */
public int compare(Object obj1,Object obj2){
  IResultObject row1=(IResultObject)obj1;
  IResultObject row2=(IResultObject)obj2;
  for (int i=0; i < sortKeyIndexes.length; i++) {
    int colIndex=sortKeyIndexes[i];
    String colName=sortKeyColumns[i];
    try {
      Object colObj1=null;
      Object colObj2=null;
      if (eventHandler != null) {
        colObj1=eventHandler.getValue(row1,colIndex,colName);
        colObj2=eventHandler.getValue(row2,colIndex,colName);
      }
 else {
        colObj1=row1.getFieldValue(colIndex);
        colObj2=row2.getFieldValue(colIndex);
      }
      int result=ScriptEvalUtil.compare(colObj1,colObj2,comparators[i]);
      if (result != 0) {
        return sortAscending[i] ? result : -result;
      }
    }
 catch (    DataException e) {
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * compares two row indexes, actually compares two rows pointed by the two row indexes
 */
public int compare(Object obj1,Object obj2){
  IResultObject row1=(IResultObject)obj1;
  IResultObject row2=(IResultObject)obj2;
  for (int i=0; i < sortKeyIndexes.length; i++) {
    int colIndex=sortKeyIndexes[i];
    String colName=sortKeyColumns[i];
    try {
      Object colObj1=null;
      Object colObj2=null;
      if (eventHandler != null) {
        colObj1=eventHandler.getValue(row1,colIndex,colName);
        colObj2=eventHandler.getValue(row2,colIndex,colName);
      }
 else {
        colObj1=row1.getFieldValue(colIndex);
        colObj2=row2.getFieldValue(colIndex);
      }
      int result=ScriptEvalUtil.compare(colObj1,colObj2,comparators[i]);
      if (result != 0) {
        if (sortAscending[i] == SortSpec.SORT_DISABLE) {
          return 0;
        }
        return sortAscending[i] == SortSpec.SORT_ASC ? result : -result;
      }
    }
 catch (    DataException e) {
    }
  }
  return 0;
}
Program: 65465
Project: 65465
Buggy source:
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  boolean[] ascending=new boolean[fieldCount];
  CompareHints[] comparator=new CompareHints[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=true;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending,comparator);
}

Fixed version (ground truth):
/** 
 * @param rsMeta
 * @return
 */
private static SortSpec getSortSpec(IResultClass rsMeta){
  int fieldCount=rsMeta.getFieldCount();
  int[] sortKeyIndexs=new int[fieldCount];
  String[] sortKeyNames=new String[fieldCount];
  int[] ascending=new int[fieldCount];
  CompareHints[] comparator=new CompareHints[fieldCount];
  for (int i=0; i < fieldCount; i++) {
    sortKeyIndexs[i]=i + 1;
    ascending[i]=SortSpec.SORT_ASC;
  }
  return new SortSpec(sortKeyIndexs,sortKeyNames,ascending,comparator);
}
Program: 65466
Project: 65466
Buggy source:
void setSortAscending(boolean[] sortAscending){
  this.sortAscending=sortAscending;
}

Fixed version (ground truth):
void setSortAscending(int[] sortAscending){
  this.sortAscending=sortAscending;
}
Program: 65467
Project: 65467
Buggy source:
boolean[] getSortAscending(){
  return sortAscending;
}

Fixed version (ground truth):
int[] getSortAscending(){
  return sortAscending;
}
Program: 65468
Project: 65468
Buggy source:
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,boolean[] sortAscending,CompareHints[] comparator){
  this.setSortKeyIndexes(sortKeyIndexes);
  this.setSortKeyColumns(sortKeyColumns);
  this.setSortAscending(sortAscending);
  this.setComparator(comparator);
}

Fixed version (ground truth):
/** 
 * @param sortKeyIndexes
 * @param sortKeyColumns
 * @param sortAscending
 */
public SortSpec(int[] sortKeyIndexes,String[] sortKeyColumns,int[] sortAscending,CompareHints[] comparator){
  this.setSortKeyIndexes(sortKeyIndexes);
  this.setSortKeyColumns(sortKeyColumns);
  this.setSortAscending(sortAscending);
  this.setComparator(comparator);
}
Program: 65471
Project: 65471
Buggy source:
/** 
 * Prepares one expression
 * @param expr
 * @param groupLevel
 * @param cx
 * @param reg
 * @throws DataException 
 */
private void prepareExpression(IBaseExpression expr,int groupLevel,ScriptContext cx,AggregateRegistry reg) throws DataException {
  try {
    ExpressionCompiler compiler=this.expressionCompiler;
    if (expr instanceof IScriptExpression) {
      IScriptExpression baseExpr=((IScriptExpression)expr);
      String exprText=((IScriptExpression)expr).getText();
      CompiledExpression handle=compiler.compile(exprText,reg,session.getEngineContext().getScriptContext());
      expr.setHandle(handle);
    }
 else     if (expr instanceof IConditionalExpression) {
      IConditionalExpression ce=(IConditionalExpression)expr;
      ce=transformConditionalExpression(ce);
      prepareExpression(ce.getExpression(),groupLevel,cx,reg);
      if (ce.getOperand1() != null)       prepareExpression(ce.getOperand1(),groupLevel,cx,reg);
      if (ce.getOperand2() != null)       prepareExpression(ce.getOperand2(),groupLevel,cx,reg);
      expr.setHandle(ce);
    }
 else     if (expr instanceof IExpressionCollection) {
      IExpressionCollection ce=(IExpressionCollection)expr;
      Object[] exprs=ce.getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareExpression((IBaseExpression)exprs[i],groupLevel,cx,reg);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * Prepares one expression
 * @param expr
 * @param groupLevel
 * @param cx
 * @param reg
 * @throws DataException 
 */
private void prepareExpression(IBaseExpression expr,int groupLevel,ScriptContext cx,AggregateRegistry reg) throws DataException {
  try {
    ExpressionCompiler compiler=this.expressionCompiler;
    if (expr instanceof IScriptExpression) {
      IScriptExpression baseExpr=((IScriptExpression)expr);
      String exprText=((IScriptExpression)expr).getText();
      if (BaseExpression.constantId.equals(baseExpr.getScriptId())) {
        baseExpr.setHandle(exprText);
      }
 else {
        CompiledExpression handle=compiler.compile(exprText,reg,session.getEngineContext().getScriptContext());
        expr.setHandle(handle);
      }
    }
 else     if (expr instanceof IConditionalExpression) {
      IConditionalExpression ce=(IConditionalExpression)expr;
      ce=transformConditionalExpression(ce);
      prepareExpression(ce.getExpression(),groupLevel,cx,reg);
      if (ce.getOperand1() != null)       prepareExpression(ce.getOperand1(),groupLevel,cx,reg);
      if (ce.getOperand2() != null)       prepareExpression(ce.getOperand2(),groupLevel,cx,reg);
      expr.setHandle(ce);
    }
 else     if (expr instanceof IExpressionCollection) {
      IExpressionCollection ce=(IExpressionCollection)expr;
      Object[] exprs=ce.getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareExpression((IBaseExpression)exprs[i],groupLevel,cx,reg);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 65474
Project: 65474
Buggy source:
public void close() throws BirtException {
  if (odiResult == null)   return;
  this.resultService.getSession().getEngine().removeListener(listener);
  if (!stopSign.isStopped()) {
    if (this.getRdSaveHelper().needsSaveToDoc()) {
      while (this.next())       ;
      this.getRdSaveHelper().doSaveFinish();
    }
    if (needCache() && !this.isEmpty()) {
      while (this.next())       ;
      closeCacheOutputStream();
    }
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  logger.logp(Level.FINER,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (odiResult == null)   return;
  this.resultService.getSession().getEngine().removeListener(listener);
  if (!stopSign.isStopped()) {
    if (this.getRdSaveHelper().needsSaveToDoc()) {
      while (this.next())       ;
      this.getRdSaveHelper().doSaveFinish();
    }
    if (needCache() && !this.isEmpty()) {
      while (this.next())       ;
      closeCacheOutputStream();
    }
  }
  if (odiResult != null)   odiResult.close();
  QueryPrepareUtil.clear(resultService.getSession());
  odiResult=null;
  resultService=null;
  logger.logp(Level.FINER,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 65475
Project: 65475
Buggy source:
public void close() throws BirtException {
}

Fixed version (ground truth):
public void close() throws BirtException {
  QueryPrepareUtil.clear(session);
}
Program: 65476
Project: 65476
Buggy source:
public DataPresentationEngine(DataEngineFactory factory,ExecutionContext context,IDocArchiveReader reader,boolean needAccessFactTable) throws Exception {
  super(factory,context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_PRESENTATION,null,context.getScriptContext(),context.getApplicationClassLoader());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setAppContext(context.getAppContext());
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setTimeZone(context.getTimeZone());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
  this.needAccessFactTable=needAccessFactTable;
}

Fixed version (ground truth):
public DataPresentationEngine(DataEngineFactory factory,ExecutionContext context,IDocArchiveReader reader,boolean needAccessFactTable) throws Exception {
  super(factory,context);
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_PRESENTATION,context.getDesign(),context.getScriptContext(),context.getApplicationClassLoader());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setAppContext(context.getAppContext());
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setTimeZone(context.getTimeZone());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  loadDteMetaInfo(reader);
  this.needAccessFactTable=needAccessFactTable;
}
Program: 65477
Project: 65477
Buggy source:
public static boolean needOnPageBreak(ReportItemDesign design,ExecutionContext context){
  if (design == null) {
    return false;
  }
  if (design.getOnPageBreak() != null) {
    return true;
  }
  String javaClass=design.getJavaClass();
  if (javaClass == null) {
    return false;
  }
  Object extensionData=design.getExtensionData();
  if (extensionData != null) {
    return (Boolean)extensionData;
  }
  EventHandlerManager eventHandlerManager=context.getEventHandlerManager();
  Class<?> clazz=null;
  boolean result=false;
  try {
    clazz=eventHandlerManager.loadClass(javaClass,context);
    result=(Boolean)design.accept(scriptChecker,clazz);
  }
 catch (  EngineException e) {
    e.printStackTrace();
  }
  design.setExtensionData(result);
  return result;
}

Fixed version (ground truth):
public static boolean needOnPageBreak(ReportItemDesign design,ExecutionContext context){
  if (design == null) {
    return false;
  }
  if (design instanceof ExtendedItemDesign) {
    return false;
  }
  if (design.getOnPageBreak() != null) {
    return true;
  }
  String javaClass=design.getJavaClass();
  if (javaClass == null) {
    return false;
  }
  Object extensionData=design.getExtensionData();
  if (extensionData != null) {
    return (Boolean)extensionData;
  }
  EventHandlerManager eventHandlerManager=context.getEventHandlerManager();
  Class<?> clazz=null;
  boolean result=false;
  try {
    clazz=eventHandlerManager.loadClass(javaClass,context);
    result=(Boolean)design.accept(scriptChecker,clazz);
  }
 catch (  EngineException e) {
    e.printStackTrace();
  }
  design.setExtensionData(result);
  return result;
}
Program: 65481
Project: 65481
Buggy source:
private boolean isEmpty(String str){
  return str == null || str.isEmpty();
}

Fixed version (ground truth):
private boolean isEmpty(String str){
  return str == null || str.length() == 0;
}
Program: 65482
Project: 65482
Buggy source:
/** 
 * Get all accessible bindings from a query definition. If <code>qd</code> is a sub query definition, returns bindings defined onto itself and all not-aggregation bindings from its ancestors. If <code>qd</code> is not a sub query definition, just returns its bindings defined onto itself
 * @param qd
 * @return
 * @throws DataException
 */
public static Map<String,IBinding> getAccessibleBindings(IBaseQueryDefinition qd) throws DataException {
  if (qd == null) {
    return null;
  }
  Map<String,IBinding> result=new HashMap<String,IBinding>(qd.getBindings());
  IBaseQueryDefinition parent=qd.getParentQuery();
  while (parent != null) {
    Map parentBindings=parent.getBindings();
    Map<String,Boolean> aggrInfo=parseAggregations(parentBindings);
    Iterator it=parentBindings.keySet().iterator();
    while (it.hasNext()) {
      String name=(String)it.next();
      if (!aggrInfo.get(name)) {
        IBinding b=(IBinding)parentBindings.get(name);
        if (!result.containsKey(name)) {
          result.put(name,b);
        }
      }
    }
    parent=parent.getParentQuery();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Get all accessible bindings from a query definition. If <code>qd</code> is a sub query definition, returns bindings defined onto itself and all not-aggregation bindings from its ancestors. If <code>qd</code> is not a sub query definition, just returns its bindings defined onto itself
 * @param qd
 * @return
 * @throws DataException
 */
public static Map<String,IBinding> getAccessibleBindings(IBaseQueryDefinition qd) throws DataException {
  if (qd == null) {
    return null;
  }
  Map<String,IBinding> result=new HashMap<String,IBinding>(qd.getBindings());
  IBaseQueryDefinition parent=null;
  if (qd instanceof SubqueryDefinition) {
    parent=qd.getParentQuery();
  }
  while (parent != null) {
    Map parentBindings=parent.getBindings();
    Map<String,Boolean> aggrInfo=parseAggregations(parentBindings);
    Iterator it=parentBindings.keySet().iterator();
    while (it.hasNext()) {
      String name=(String)it.next();
      if (!aggrInfo.get(name)) {
        IBinding b=(IBinding)parentBindings.get(name);
        if (!result.containsKey(name)) {
          result.put(name,b);
        }
      }
    }
    if (parent instanceof SubqueryDefinition) {
      parent=parent.getParentQuery();
    }
 else {
      break;
    }
  }
  return result;
}
Program: 65483
Project: 65483
Buggy source:
/** 
 * @return
 */
private boolean createNoneODASelectedDataSource(){
  DataSourceHandle dsHandle=null;
  if (helper.SCRIPT_DATA_SOURCE_DISPLAY_NAME.equals(prevSelectedDataSourceType.toString())) {
    String driverName=DataUIConstants.DATA_SOURCE_SCRIPT;
    Class classType=ScriptDataSourceHandle.class;
    dsHandle=helper.createDataSource(classType,dsName,driverName);
  }
  if (CASSANDRA_DATA_SOURCE_DISPLAY_NAME.equals(prevSelectedDataSourceType.toString())) {
    Class classType=ScriptDataSourceHandle.class;
    dsHandle=helper.createDataSource(classType,dsName,DataUIConstants.CASSANDRA_DATA_SOURCE_SCRIPT);
  }
 else {
    dsHandle=helper.createNoneOdaDataSourceHandle(dsName,prevSelectedDataSourceType);
  }
  if (dsHandle == null)   return false;
  try {
    slotHandle.add(dsHandle);
  }
 catch (  ContentException e) {
    ExceptionHandler.handle(e);
  }
catch (  NameException e) {
    ExceptionHandler.handle(e);
  }
  if (dsHandle instanceof ScriptDataSourceHandle) {
    Utility.setScriptActivityEditor();
  }
  createSelectedDataSourceTearDown();
  return true;
}

Fixed version (ground truth):
/** 
 * @return
 */
private boolean createNoneODASelectedDataSource(){
  DataSourceHandle dsHandle=null;
  if (helper.SCRIPT_DATA_SOURCE_DISPLAY_NAME.equals(prevSelectedDataSourceType.toString())) {
    String driverName=DataUIConstants.DATA_SOURCE_SCRIPT;
    Class classType=ScriptDataSourceHandle.class;
    dsHandle=helper.createDataSource(classType,dsName,driverName);
  }
 else   if (CASSANDRA_DATA_SOURCE_DISPLAY_NAME.equals(prevSelectedDataSourceType.toString())) {
    Class classType=ScriptDataSourceHandle.class;
    dsHandle=helper.createDataSource(classType,dsName,DataUIConstants.CASSANDRA_DATA_SOURCE_SCRIPT);
  }
 else {
    dsHandle=helper.createNoneOdaDataSourceHandle(dsName,prevSelectedDataSourceType);
  }
  if (dsHandle == null)   return false;
  try {
    slotHandle.add(dsHandle);
  }
 catch (  ContentException e) {
    ExceptionHandler.handle(e);
  }
catch (  NameException e) {
    ExceptionHandler.handle(e);
  }
  if (dsHandle instanceof ScriptDataSourceHandle) {
    Utility.setScriptActivityEditor();
  }
  createSelectedDataSourceTearDown();
  return true;
}
Program: 65485
Project: 65485
Buggy source:
public int getSubQueryStartingIndex() throws DataException {
  if (!subQueryOnGroup)   return this.parentIterator.getCurrentResultIndex();
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}

Fixed version (ground truth):
public int getSubQueryStartingIndex() throws DataException {
  if (!subQueryOnGroup)   return this.parentIterator.getCurrentResultIndex();
  if (parentIterator instanceof EmptyResultIterator)   return 0;
  int groupIndex=this.parentIterator.getCurrentGroupIndex(groupLevel);
  int[] groupStartingEndingIndex=this.parentIterator.getGroupStartAndEndIndex(groupLevel);
  return (this.parentExecutor instanceof ISubQueryExecutor) ? ((ISubQueryExecutor)this.parentExecutor).getSubQueryStartingIndex() + groupStartingEndingIndex[groupIndex * 2] : groupStartingEndingIndex[groupIndex * 2];
}
Program: 65489
Project: 65489
Buggy source:
/** 
 * Utility method to create constant expression
 * @param expr
 * @return
 */
public static IScriptExpression createConstantExpression(String constantExpr){
  ScriptExpression scriptExpression=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(constantExpr));
  scriptExpression.setConstant(true);
  scriptExpression.setConstantValue(constantExpr);
  return scriptExpression;
}

Fixed version (ground truth):
/** 
 * Utility method to create constant expression
 * @param expr
 * @return
 */
public static IScriptExpression createConstantExpression(String constantExpr){
  ScriptExpression scriptExpression=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(constantExpr));
  scriptExpression.setScriptId(BaseExpression.constantId);
  scriptExpression.setHandle(constantExpr);
  return scriptExpression;
}
Program: 65490
Project: 65490
Buggy source:
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  try {
    if (iParamBind.getExpr() instanceof IScriptExpression) {
      ScriptContext evalContext=this.outerScope == null ? context : context.newContext(this.outerScope);
      if (iParamBind.getExpr().getHandle() == null)       iParamBind.getExpr().setHandle(evalContext.compile("String_Node_Str",null,0,((IScriptExpression)iParamBind.getExpr()).getText()));
      evaluateResult=ScriptEvalUtil.evalExpr(iParamBind.getExpr(),evalContext,null,0);
    }
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}

Fixed version (ground truth):
/** 
 * @param scope
 * @param cx
 * @param iParamBind
 * @return
 * @throws DataException
 */
private Object evaluateInputParameterValue(Scriptable scope,Context cx,IInputParameterBinding iParamBind) throws DataException {
  Object evaluateResult=null;
  try {
    if (iParamBind.getExpr() instanceof IScriptExpression) {
      ScriptContext evalContext=this.outerScope == null ? context : context.newContext(this.outerScope);
      if (iParamBind.getExpr().getHandle() == null && !(BaseExpression.constantId.equals(iParamBind.getExpr().getScriptId())))       iParamBind.getExpr().setHandle(evalContext.compile("String_Node_Str",null,0,((IScriptExpression)iParamBind.getExpr()).getText()));
      evaluateResult=ScriptEvalUtil.evalExpr(iParamBind.getExpr(),evalContext,null,0);
    }
  }
 catch (  BirtException e) {
    DataException dataEx=new DataException(ResourceConstants.UNEXPECTED_ERROR,e);
    if (logger != null)     logger.logp(Level.FINE,PreparedOdaDSQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw dataEx;
  }
  return evaluateResult;
}
Program: 65491
Project: 65491
Buggy source:
private ScriptExpression cloneExpression(ScriptExpression expr){
  ScriptExpression nExpr=new ScriptExpression(expr.getText(),expr.getDataType());
  nExpr.setConstant(expr.isConstant());
  nExpr.setConstantValue(expr.getConstantValue());
  nExpr.setGroupName(expr.getGroupName());
  nExpr.setHandle(expr.getHandle());
  nExpr.setScriptId(expr.getScriptId());
  return nExpr;
}

Fixed version (ground truth):
private ScriptExpression cloneExpression(ScriptExpression expr){
  ScriptExpression nExpr=new ScriptExpression(expr.getText(),expr.getDataType());
  nExpr.setGroupName(expr.getGroupName());
  nExpr.setHandle(expr.getHandle());
  nExpr.setScriptId(expr.getScriptId());
  return nExpr;
}
Program: 65492
Project: 65492
Buggy source:
/** 
 * @param cx
 * @param expr1
 * @throws DataException 
 */
private static void prepareScriptExpression(ScriptContext cx,IBaseExpression expr1) throws DataException {
  try {
    if (expr1 == null)     return;
    if (expr1 instanceof IScriptExpression) {
      String exprText=((IScriptExpression)expr1).getText();
      if (expr1.getHandle() == null && !((IScriptExpression)expr1).isConstant())       expr1.setHandle(new OLAPExpressionHandler(cx.compile(expr1.getScriptId(),null,0,exprText)));
    }
 else     if (expr1 instanceof IExpressionCollection) {
      Object[] exprs=((IExpressionCollection)expr1).getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareScriptExpression(cx,(IBaseExpression)exprs[i]);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param cx
 * @param expr1
 * @throws DataException 
 */
private static void prepareScriptExpression(ScriptContext cx,IBaseExpression expr1) throws DataException {
  try {
    if (expr1 == null)     return;
    if (expr1 instanceof IScriptExpression) {
      String exprText=((IScriptExpression)expr1).getText();
      if (expr1.getHandle() == null && !(BaseExpression.constantId.equals(expr1.getScriptId())))       expr1.setHandle(new OLAPExpressionHandler(cx.compile(expr1.getScriptId(),null,0,exprText)));
    }
 else     if (expr1 instanceof IExpressionCollection) {
      Object[] exprs=((IExpressionCollection)expr1).getExpressions().toArray();
      for (int i=0; i < exprs.length; i++) {
        prepareScriptExpression(cx,(IBaseExpression)exprs[i]);
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 65494
Project: 65494
Buggy source:
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setConstant(true);
    jsExpr.setConstantValue(expr.getExpression());
    return jsExpr;
  }
 else   if ("String_Node_Str".equals(expr.getType())) {
    return null;
  }
 else {
    if (expr.getStringExpression() == null)     return null;
    jsExpr=new ExpressionAdapter(expr,el);
  }
  return jsExpr;
}

Fixed version (ground truth):
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setScriptId(BaseExpression.constantId);
    jsExpr.setHandle(expr.getExpression());
    return jsExpr;
  }
 else   if ("String_Node_Str".equals(expr.getType())) {
    return null;
  }
 else {
    if (expr.getStringExpression() == null)     return null;
    jsExpr=new ExpressionAdapter(expr,el);
  }
  return jsExpr;
}
Program: 65495
Project: 65495
Buggy source:
private IScriptExpression adapterExpression(Expression expr){
  if (expr instanceof Expression.Script && "String_Node_Str".equals(((Expression.Script)expr).getLanguage())) {
    ScriptExpression scriptExpr=null;
    try {
      scriptExpr=getModelAdapter().adaptJSExpression(expr.getScriptText(),((Expression.Script)expr).getLanguage());
      return new ScriptExpression(scriptExpr.getText());
    }
 catch (    Exception ex) {
    }
  }
 else {
    if (expr.getType() == Expression.CONSTANT) {
      ScriptExpression jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getScriptText()));
      jsExpr.setConstant(true);
      return jsExpr;
    }
  }
  return new ScriptExpression(expr.getScriptText());
}

Fixed version (ground truth):
private IScriptExpression adapterExpression(Expression expr){
  if (expr instanceof Expression.Script && "String_Node_Str".equals(((Expression.Script)expr).getLanguage())) {
    ScriptExpression scriptExpr=null;
    try {
      scriptExpr=getModelAdapter().adaptJSExpression(expr.getScriptText(),((Expression.Script)expr).getLanguage());
      return new ScriptExpression(scriptExpr.getText());
    }
 catch (    Exception ex) {
    }
  }
 else {
    if (expr.getType() == Expression.CONSTANT) {
      ScriptExpression jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getScriptText()));
      jsExpr.setScriptId(BaseExpression.constantId);
      jsExpr.setHandle(expr.getScriptText());
      return jsExpr;
    }
  }
  return new ScriptExpression(expr.getScriptText());
}
Program: 65496
Project: 65496
Buggy source:
public Map getAllExtensionProperties(){
  return new HashMap();
}

Fixed version (ground truth):
public Map getAllExtensionProperties(){
  return properties;
}
Program: 65497
Project: 65497
Buggy source:
public String getExtensionProperty(String name){
  return null;
}

Fixed version (ground truth):
public String getExtensionProperty(String name){
  return properties.get(name);
}
Program: 65498
Project: 65498
Buggy source:
public void setExtensionProperty(String name,String value){
}

Fixed version (ground truth):
public void setExtensionProperty(String name,String value){
  properties.put(name,value);
}
Program: 65499
Project: 65499
Buggy source:
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}

Fixed version (ground truth):
/** 
 * Disposes instance handles.
 */
public void dispose(){
  if (session != null) {
    try {
      DataService.getInstance().unRegisterSession(session);
    }
 catch (    BirtException e) {
      logger.log(e);
    }
  }
  if (engineTask != null) {
    engineTask.close();
  }
 else   if (session != null) {
    session.shutdown();
  }
}
Program: 65501
Project: 65501
Buggy source:
/** 
 * Returns the 1-based index of the outermost group in which the current row is the first row. For example, if a query contain N groups (group with index 1 being the outermost group, and group with index N being the innermost group), and this function returns a value M, it indicates that the current row is the first row in groups with indexes (M, M+1, ..., N ).
 * @return	The 1-based index of the outermost group in whichthe current row is the first row; (N+1) if the current row is not at the start of any group;
 */
public int getStartingGroupLevel() throws DataException {
  checkHasCurrentRow();
  if (cacheProvider.getCurrentIndex() == 0)   return 0;
  if (groups.length == 0)   return 1;
  int childGroupIdx=cacheProvider.getCurrentIndex();
  int currentGroupIdx=leafGroupIdx;
  int level;
  for (level=groups.length - 1; level >= 0; level--) {
    GroupInfo currentGroup=findGroup(level,currentGroupIdx);
    if (childGroupIdx == currentGroup.firstChild) {
      childGroupIdx=currentGroupIdx;
      currentGroupIdx=currentGroup.parent;
      continue;
    }
    break;
  }
  return level + 2;
}

Fixed version (ground truth):
/** 
 * Returns the 1-based index of the outermost group in which the current row is the first row. For example, if a query contain N groups (group with index 1 being the outermost group, and group with index N being the innermost group), and this function returns a value M, it indicates that the current row is the first row in groups with indexes (M, M+1, ..., N ).
 * @return	The 1-based index of the outermost group in whichthe current row is the first row; (N+1) if the current row is not at the start of any group;
 */
public int getStartingGroupLevel() throws DataException {
  checkHasCurrentRow();
  if (cacheProvider.getCurrentIndex() == 0)   return 0;
  if (groups.length == 0)   return 1;
  int childGroupIdx=cacheProvider.getCurrentIndex();
  int currentGroupIdx=leafGroupIdx;
  int level;
  for (level=groups.length - 1; level >= 0; level--) {
    GroupInfo currentGroup=findGroup(level,currentGroupIdx);
    if (currentGroup != null && childGroupIdx == currentGroup.firstChild) {
      childGroupIdx=currentGroupIdx;
      currentGroupIdx=currentGroup.parent;
      continue;
    }
    break;
  }
  return level + 2;
}
Program: 65502
Project: 65502
Buggy source:
private boolean containMember(Object[] levelkey,Object[] key){
  Object[] memberKeys=levelkey;
  for (  Object obj : key) {
    if (obj.toString().equals(memberKeys[0].toString())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean containMember(Object[] levelkey,Object[] key){
  Object[] memberKeys=levelkey;
  for (  Object obj : key) {
    try {
      if (ScriptEvalUtil.compare(obj,memberKeys[0]) == 0) {
        return true;
      }
    }
 catch (    DataException e) {
    }
  }
  return false;
}
Program: 65506
Project: 65506
Buggy source:
@SuppressWarnings("String_Node_Str") private void populateDataSetColumns(IEventHandler handler,IBaseQueryDefinition query,IResultClass resultClass,GroupSpec[] groupSpecs,boolean forceLookingForward) throws DataException {
  this.query=dataSourceQuery.getQueryDefinition();
  this.groupCalculator=needLookingForwardFor1Row(groupSpecs,forceLookingForward) ? new SimpleGroupCalculator(session,groupSpecs,this.rowResultSet.getMetaData()) : new DummyGroupCalculator();
  this.currResultObj=this.rowResultSet.next();
  this.session=session;
  this.groupCalculator.registerCurrentResultObject(this.currResultObj);
  this.groupCalculator.registerNextResultObject(this.rowResultSet);
  this.initialRowCount=(this.currResultObj != null) ? -1 : 0;
  this.rowCount=(this.currResultObj != null) ? 1 : 0;
  this.handler=handler;
  this.resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(handler.getAllColumnBindings());
  if (query instanceof IQueryDefinition && ((IQueryDefinition)query).needAutoBinding()) {
    for (int i=1; i <= resultClass.getFieldCount(); i++) {
      this.resultSetNameSet.add(resultClass.getFieldName(i));
      this.resultSetNameSet.add(resultClass.getFieldAlias(i));
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void populateDataSetColumns(IEventHandler handler,IBaseQueryDefinition query,IResultClass resultClass,GroupSpec[] groupSpecs,boolean forceLookingForward) throws DataException {
  this.resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(handler.getAllColumnBindings());
  if (query instanceof IQueryDefinition && ((IQueryDefinition)query).needAutoBinding()) {
    for (int i=1; i <= resultClass.getFieldCount(); i++) {
      this.resultSetNameSet.add(resultClass.getFieldName(i));
      this.resultSetNameSet.add(resultClass.getFieldAlias(i));
    }
  }
}
Program: 65507
Project: 65507
Buggy source:
public boolean canFinish(){
  if (!validStatus())   return false;
  try {
    if (m_designSession != null)     return m_designSession.getNewWizard().canFinish();
 else {
      if (this.nextPage != null) {
        return nextPage.isPageComplete();
      }
      return isPageComplete();
    }
  }
 catch (  OdaException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean canFinish(){
  this.getControl().setFocus();
  if (!validStatus())   return false;
  try {
    if (m_designSession != null)     return m_designSession.getNewWizard().canFinish();
 else {
      if (this.nextPage != null) {
        return nextPage.isPageComplete();
      }
      return isPageComplete();
    }
  }
 catch (  OdaException e) {
    return false;
  }
}
Program: 65510
Project: 65510
Buggy source:
public IResultIterator preview() throws BirtException {
  int max=dataSetHandle.getIntProperty(DataSetHandle.ROW_FETCH_LIMIT_PROP);
  try {
    dataSetHandle.setIntProperty(DataSetHandle.ROW_FETCH_LIMIT_PROP,this.maxRow);
    result=task.execute();
    return result.nextResultIterator().getResultIterator();
  }
  finally {
    dataSetHandle.setIntProperty(DataSetHandle.ROW_FETCH_LIMIT_PROP,max);
  }
}

Fixed version (ground truth):
public IResultIterator preview() throws BirtException {
  result=task.execute();
  return result.nextResultIterator().getResultIterator();
}
Program: 65511
Project: 65511
Buggy source:
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  if (modelChanged) {
    modelChanged=false;
    new UIJob("String_Node_Str"){
      public IStatus runInUIThread(      IProgressMonitor monitor){
        updateResultsProcess();
        return Status.OK_STATUS;
      }
    }
.schedule();
  }
}

Fixed version (ground truth):
public void pageActivated(){
  getContainer().setMessage(Messages.getString("String_Node_Str"),IMessageProvider.NONE);
  if (modelChanged) {
    modelChanged=false;
    dataSetHandle=((DataSetEditor)getContainer()).getHandle();
    int maxRow=this.getMaxRowPreference();
    if (dataSetHandle.getRowFetchLimit() <= 0 || dataSetHandle.getRowFetchLimit() > maxRow) {
      ModuleHandle moduleHandle=((Module)dataSetHandle.getRoot().copy()).getModuleHandle();
      SlotHandle dataSets=moduleHandle.getDataSets();
      for (int i=0; i < dataSets.getCount(); i++) {
        if (dataSetHandle.getName().equals(dataSets.get(i).getName())) {
          dataSetHandle=(DataSetHandle)dataSets.get(i);
          try {
            dataSetHandle.setRowFetchLimit(maxRow);
          }
 catch (          SemanticException e) {
          }
          break;
        }
      }
    }
    new UIJob("String_Node_Str"){
      public IStatus runInUIThread(      IProgressMonitor monitor){
        updateResultsProcess();
        return Status.OK_STATUS;
      }
    }
.schedule();
  }
}
Program: 65512
Project: 65512
Buggy source:
private void clearProperyBindingMap(final Map dataSetBindingMap,final Map dataSourceBindingMap){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      DataSetHandle dsHandle=((DataSetEditor)getContainer()).getHandle();
      try {
        DataSetMetaDataHelper.clearPropertyBindingMap(dsHandle,dataSetBindingMap,dataSourceBindingMap);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
);
}

Fixed version (ground truth):
private void clearProperyBindingMap(final Map dataSetBindingMap,final Map dataSourceBindingMap){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      try {
        DataSetMetaDataHelper.clearPropertyBindingMap(dataSetHandle,dataSetBindingMap,dataSourceBindingMap);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
);
}
Program: 65517
Project: 65517
Buggy source:
private int writeResultObject(Map valueMap) throws DataException, IOException {
  ByteArrayOutputStream tempBaos=new ByteArrayOutputStream();
  BufferedOutputStream tempBos=new BufferedOutputStream(tempBaos);
  DataOutputStream tempDos=new DataOutputStream(tempBos);
  for (  IBinding binding : bindings) {
    if (this.streamManager.getVersion() >= VersionManager.VERSION_3_7_2_1) {
      ResultObjectUtil.writeObject(tempDos,valueMap.get(binding.getBindingName()),this.getDataTypeClass(binding));
    }
 else {
      IOUtil.writeObject(tempDos,valueMap.get(binding.getBindingName()));
    }
  }
  tempDos.flush();
  tempBos.flush();
  tempBaos.flush();
  byte[] bytes=tempBaos.toByteArray();
  int rowBytes=bytes.length;
  IOUtil.writeRawBytes(dataSetStream,bytes);
  tempBaos=null;
  tempBos=null;
  tempDos=null;
  return rowBytes;
}

Fixed version (ground truth):
private int writeResultObject(Map valueMap) throws DataException, IOException {
  ByteArrayOutputStream tempBaos=new ByteArrayOutputStream();
  BufferedOutputStream tempBos=new BufferedOutputStream(tempBaos);
  DataOutputStream tempDos=new DataOutputStream(tempBos);
  for (  IBinding binding : bindings) {
    if (this.streamManager.getVersion() > VersionManager.VERSION_3_7_2_1 || "String_Node_Str".equals(this.dtContext.getBundleVersion()) || "String_Node_Str".equals(this.dtContext.getBundleVersion())) {
      ResultObjectUtil.writeObject(tempDos,valueMap.get(binding.getBindingName()),this.getDataTypeClass(binding));
    }
 else {
      IOUtil.writeObject(tempDos,valueMap.get(binding.getBindingName()));
    }
  }
  tempDos.flush();
  tempBos.flush();
  tempBaos.flush();
  byte[] bytes=tempBaos.toByteArray();
  int rowBytes=bytes.length;
  IOUtil.writeRawBytes(dataSetStream,bytes);
  tempBaos=null;
  tempBos=null;
  tempDos=null;
  return rowBytes;
}
Program: 65518
Project: 65518
Buggy source:
/** 
 * Load data set with assignment of inner id.
 * @return
 * @throws DataException
 */
public DataSetResultSet loadDataSetData(Set<Integer> preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID) throws DataException {
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  DataSetResultSet populator=new DataSetResultSet(stream,lensStream,this.loadResultClass(),preFilteredRowIds,stringTableMap,index,version,includeInnerID);
  return populator;
}

Fixed version (ground truth):
/** 
 * Load data set with assignment of inner id.
 * @return
 * @throws DataException
 */
public DataSetResultSet loadDataSetData(Set<Integer> preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID) throws DataException {
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  int adjustedVersion=resolveVersionConflict();
  DataSetResultSet populator=new DataSetResultSet(stream,lensStream,this.loadResultClass(),preFilteredRowIds,stringTableMap,index,adjustedVersion,includeInnerID);
  return populator;
}
Program: 65519
Project: 65519
Buggy source:
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_4_2_1_1;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static int getLatestVersion(){
  return VERSION_4_2_1_2;
}
Program: 65520
Project: 65520
Buggy source:
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    Matcher matcherHtml=PAGE_LINK_PATTERN_HTML.matcher(hyperlink);
    if (matcherHtml.find()) {
      return new PdfAction(hyperlink);
    }
    Matcher matcherLocal=PAGE_LINK_PATTERN_LOCAL.matcher(hyperlink);
    if (matcherLocal.find()) {
      String fileName=matcherLocal.group(1);
      String pageNumber=matcherLocal.group(matcherLocal.groupCount());
      return new PdfAction(fileName,Integer.valueOf(pageNumber));
    }
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a PdfAction.
 * @param hyperlink the hyperlink.
 * @param bookmark the bookmark.
 * @param target if target equals "_blank", the target will be opened in a new window, else the target will be opened in the current window.
 * @return the created PdfAction.
 */
private PdfAction createPdfAction(String hyperlink,String bookmark,String target,int type){
  if ("String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target) || "String_Node_Str".equalsIgnoreCase(target)|| "String_Node_Str".equalsIgnoreCase(target)) {
    return new PdfAction(hyperlink);
  }
 else {
    if (type == IHyperlinkAction.ACTION_BOOKMARK) {
      return PdfAction.gotoLocalPage(bookmark,false);
    }
 else {
      return PdfAction.gotoRemotePage(hyperlink,bookmark,false,false);
    }
  }
}
Program: 65521
Project: 65521
Buggy source:
public void load(){
  if (getDescriptorProvider() instanceof UnitPropertyDescriptorProvider) {
    deMeasureValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getMeasureValue();
    if (deMeasureValue == null)     deMeasureValue="String_Node_Str";
    if (!deMeasureValue.equals(String.valueOf(complexUnit.getValue()))) {
      try {
        complexUnit.setValue(deMeasureValue);
      }
 catch (      NumberFormatException e) {
      }
    }
    String[] items=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitItems();
    complexUnit.setUnits(items);
    try {
      deUnitValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitDisplayName(((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnit());
    }
 catch (    Exception e) {
      ExceptionUtil.handle(e);
      return;
    }
    if (deUnitValue == null)     complexUnit.deselectUnit();
 else     if (!deUnitValue.equals(complexUnit.getUnit())) {
      complexUnit.selectUnit(Arrays.asList(items).indexOf(deUnitValue));
    }
  }
}

Fixed version (ground truth):
public void load(){
  if (getDescriptorProvider() instanceof UnitPropertyDescriptorProvider) {
    deMeasureValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getMeasureValue();
    if (deMeasureValue == null)     deMeasureValue="String_Node_Str";
    if (!deMeasureValue.equals(String.valueOf(complexUnit.getValue()))) {
      try {
        complexUnit.setValue(deMeasureValue);
      }
 catch (      NumberFormatException e) {
      }
    }
    String[] items=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitItems();
    if (!Arrays.equals(complexUnit.getUnits(),items)) {
      complexUnit.setUnits(items);
    }
    try {
      deUnitValue=((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnitDisplayName(((UnitPropertyDescriptorProvider)getDescriptorProvider()).getUnit());
    }
 catch (    Exception e) {
      ExceptionUtil.handle(e);
      return;
    }
    if (deUnitValue == null)     complexUnit.deselectUnit();
 else     if (!deUnitValue.equals(complexUnit.getUnit())) {
      complexUnit.selectUnit(Arrays.asList(items).indexOf(deUnitValue));
    }
  }
}