nus-yam/ex-repair huggingface dataset:
Program: 76920
Project: 76920
Buggy source:
public void visitGroup(GroupElement obj){
  writer.attribute(DesignSchemaConstants.ID_ATTRIB,new Long(obj.getID()).toString());
  attribute(obj,DesignSchemaConstants.VIEW_ACTION_ATTRIB,DesignElement.VIEW_ACTION_PROP);
  super.visitGroup(obj);
  property(obj,GroupElement.GROUP_NAME_PROP);
  property(obj,GroupElement.INTERVAL_BASE_PROP);
  property(obj,GroupElement.INTERVAL_PROP);
  property(obj,GroupElement.INTERVAL_RANGE_PROP);
  property(obj,GroupElement.SORT_DIRECTION_PROP);
  property(obj,GroupElement.SORT_TYPE_PROP);
  property(obj,GroupElement.KEY_EXPR_PROP);
  property(obj,GroupElement.TOC_PROP);
  property(obj,GroupElement.EVENT_HANDLER_CLASS_PROP);
  property(obj,GroupElement.ON_PREPARE_METHOD);
  property(obj,GroupElement.ON_PAGE_BREAK_METHOD);
  property(obj,GroupElement.REPEAT_HEADER_PROP);
  property(obj,GroupElement.HIDE_DETAIL_PROP);
  property(obj,Style.PAGE_BREAK_AFTER_PROP);
  property(obj,Style.PAGE_BREAK_BEFORE_PROP);
  writeUserPropertyDefns(obj);
  writeUserPropertyValues(obj);
  writeStructureList(obj,GroupElement.SORT_PROP);
  writeStructureList(obj,GroupElement.FILTER_PROP);
}

Fixed version (ground truth):
public void visitGroup(GroupElement obj){
  writer.attribute(DesignSchemaConstants.ID_ATTRIB,new Long(obj.getID()).toString());
  attribute(obj,DesignSchemaConstants.VIEW_ACTION_ATTRIB,DesignElement.VIEW_ACTION_PROP);
  super.visitGroup(obj);
  property(obj,GroupElement.GROUP_NAME_PROP);
  property(obj,GroupElement.INTERVAL_BASE_PROP);
  property(obj,GroupElement.INTERVAL_PROP);
  property(obj,GroupElement.INTERVAL_RANGE_PROP);
  property(obj,GroupElement.SORT_DIRECTION_PROP);
  property(obj,GroupElement.SORT_TYPE_PROP);
  property(obj,GroupElement.KEY_EXPR_PROP);
  property(obj,GroupElement.TOC_PROP);
  property(obj,GroupElement.EVENT_HANDLER_CLASS_PROP);
  property(obj,GroupElement.ON_PREPARE_METHOD);
  property(obj,GroupElement.ON_PAGE_BREAK_METHOD);
  property(obj,GroupElement.REPEAT_HEADER_PROP);
  property(obj,GroupElement.HIDE_DETAIL_PROP);
  property(obj,Style.PAGE_BREAK_AFTER_PROP);
  property(obj,Style.PAGE_BREAK_BEFORE_PROP);
  property(obj,Style.PAGE_BREAK_INSIDE_PROP);
  writeUserPropertyDefns(obj);
  writeUserPropertyValues(obj);
  writeStructureList(obj,GroupElement.SORT_PROP);
  writeStructureList(obj,GroupElement.FILTER_PROP);
}
Program: 76922
Project: 76922
Buggy source:
private void enableLineSettings(boolean isEnabled){
  if (fccShadow != null) {
    fccShadow.setEnabled(isEnabled);
  }
  if (btnPalette != null) {
    btnPalette.setEnabled(isEnabled);
  }
  btnCurve.setEnabled(isEnabled);
}

Fixed version (ground truth):
private void enableLineSettings(boolean isEnabled){
  if (lblShadow != null) {
    lblShadow.setEnabled(isEnabled);
  }
  if (fccShadow != null) {
    fccShadow.setEnabled(isEnabled);
  }
  if (btnPalette != null) {
    btnPalette.setEnabled(isEnabled);
  }
  btnCurve.setEnabled(isEnabled);
}
Program: 76923
Project: 76923
Buggy source:
/** 
 * layout the content and its children. It can be called in three status: <ol>  <li> start, the first time it is called. In this status,  it first check if it need page-break-before, <li> inprogress, the second or more time it is called. In this status, it tries to layout the content and its children to the current page. <li> end, the last time it is called. In this status, it means all the content has been layout, it is the time to handle the page-break-after. </ol>
 */
public boolean layout(){
  boolean hasNextPage=false;
switch (status) {
case STATUS_START:
    if (handleVisibility()) {
      status=STATUS_END;
      return false;
    }
  if (isPageBreakBefore() || checkAvailableSpace()) {
    status=STATUS_INPROGRESS;
    return true;
  }
status=STATUS_INPROGRESS;
case STATUS_INPROGRESS:
hasNextPage=layoutChildren();
if (hasNextPage) {
return true;
}
closeExecutor();
status=STATUS_END;
if (isPageBreakAfter()) {
return true;
}
case STATUS_END:
return false;
}
return hasNextPage;
}

Fixed version (ground truth):
/** 
 * layout the content and its children. It can be called in three status: <ol>  <li> start, the first time it is called. In this status,  it first check if it need page-break-before, <li> inprogress, the second or more time it is called. In this status, it tries to layout the content and its children to the current page. <li> end, the last time it is called. In this status, it means all the content has been layout, it is the time to handle the page-break-after. </ol>
 */
public boolean layout(){
  boolean hasNextPage=false;
switch (status) {
case STATUS_START:
    if (handleVisibility()) {
      status=STATUS_END;
      return false;
    }
  if (isPageBreakBefore() || checkAvailableSpace()) {
    status=STATUS_INPROGRESS;
    return true;
  }
status=STATUS_INPROGRESS;
case STATUS_INPROGRESS:
hasNextPage=layoutChildren();
if (hasNextPage) {
if (!hasNextChild()) {
closeExecutor();
status=STATUS_END;
}
return true;
}
closeExecutor();
status=STATUS_END;
if (isPageBreakAfter()) {
return true;
}
case STATUS_END:
return false;
}
return hasNextPage;
}
Program: 76924
Project: 76924
Buggy source:
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultMetaData != null)   return this.cachedResultMetaData;
  java.sql.ResultSetMetaData resultmd=null;
  try {
    resultmd=preStat.getMetaData();
  }
 catch (  Throwable e) {
    resultmd=null;
  }
  if (resultmd != null) {
    try {
      resultmd.getColumnCount();
      if (resultmd.getColumnCount() == 0) {
        resultmd=null;
      }
    }
 catch (    SQLException e) {
      resultmd=null;
    }
    if (resultmd != null) {
      cachedResultMetaData=new ResultSetMetaData(resultmd);
    }
  }
  if (cachedResultMetaData == null) {
    this.cachedResultSet=executeQuery();
    if (this.cachedResultSet != null)     cachedResultMetaData=this.cachedResultSet.getMetaData();
  }
  return cachedResultMetaData;
}

Fixed version (ground truth):
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultMetaData != null)   return this.cachedResultMetaData;
  java.sql.ResultSetMetaData resultmd=null;
  try {
    resultmd=preStat.getMetaData();
  }
 catch (  Throwable e) {
    resultmd=null;
  }
  if (resultmd != null) {
    try {
      resultmd.getColumnCount();
      if (resultmd.getColumnCount() <= 0) {
        resultmd=null;
      }
    }
 catch (    SQLException e) {
      resultmd=null;
    }
    if (resultmd != null) {
      cachedResultMetaData=new ResultSetMetaData(resultmd);
    }
  }
  if (cachedResultMetaData == null) {
    this.cachedResultSet=executeQuery();
    if (this.cachedResultSet != null)     cachedResultMetaData=this.cachedResultSet.getMetaData();
  }
  return cachedResultMetaData;
}
Program: 76925
Project: 76925
Buggy source:
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultMetaData != null)   return this.cachedResultMetaData;
  java.sql.ResultSetMetaData resultmd=null;
  try {
    resultmd=preStat.getMetaData();
  }
 catch (  Throwable e) {
    resultmd=null;
  }
  if (resultmd != null) {
    try {
      resultmd.getColumnCount();
    }
 catch (    SQLException e) {
      resultmd=null;
    }
    if (resultmd != null) {
      cachedResultMetaData=new ResultSetMetaData(resultmd);
    }
  }
  if (cachedResultMetaData == null) {
    this.cachedResultSet=executeQuery();
    if (this.cachedResultSet != null)     cachedResultMetaData=this.cachedResultSet.getMetaData();
  }
  return cachedResultMetaData;
}

Fixed version (ground truth):
public IResultSetMetaData getMetaData() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,Statement.class.getName(),"String_Node_Str","String_Node_Str");
  assertNotNull(preStat);
  if (this.cachedResultMetaData != null)   return this.cachedResultMetaData;
  java.sql.ResultSetMetaData resultmd=null;
  try {
    resultmd=preStat.getMetaData();
  }
 catch (  Throwable e) {
    resultmd=null;
  }
  if (resultmd != null) {
    try {
      resultmd.getColumnCount();
      if (resultmd.getColumnCount() == 0) {
        resultmd=null;
      }
    }
 catch (    SQLException e) {
      resultmd=null;
    }
    if (resultmd != null) {
      cachedResultMetaData=new ResultSetMetaData(resultmd);
    }
  }
  if (cachedResultMetaData == null) {
    this.cachedResultSet=executeQuery();
    if (this.cachedResultSet != null)     cachedResultMetaData=this.cachedResultSet.getMetaData();
  }
  return cachedResultMetaData;
}
Program: 76926
Project: 76926
Buggy source:
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterDefns();
  addCustomFields(odaStatement);
  addColumnHints(odaStatement);
  odaStatement.setColumnsProjection(this.projectedFields);
  try {
    resultMetadata=odaStatement.getMetaData();
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}

Fixed version (ground truth):
public IPreparedDSQuery prepare() throws DataException {
  if (odaStatement != null)   throw new DataException(ResourceConstants.QUERY_HAS_PREPARED);
  odaStatement=dataSource.prepareStatement(queryText,queryType);
  addProperties();
  addParameterDefns();
  addCustomFields(odaStatement);
  addColumnHints(odaStatement);
  odaStatement.setColumnsProjection(this.projectedFields);
  odaStatement.setMaxRows(this.getRowFetchLimit());
  try {
    resultMetadata=odaStatement.getMetaData();
  }
 catch (  DataException e) {
    resultMetadata=null;
  }
  return this;
}
Program: 76927
Project: 76927
Buggy source:
protected org.eclipse.birt.data.engine.odi.IResultIterator executeOdiQuery(IEventHandler eventHandler) throws DataException {
  if (doesLoadFromCache() == true) {
    DataSourceQuery dsQuery=new DataSourceQuery(dataEngine.getSession());
    JointDataSetQuery jointQuery=(JointDataSetQuery)odiQuery;
    dsQuery.setExprProcessor(jointQuery.getExprProcessor());
    List fetchEvents=jointQuery.getFetchEvents();
    if (fetchEvents != null)     for (int i=0; i < fetchEvents.size(); i++)     dsQuery.addOnFetchEvent((IResultObjectEvent)fetchEvents.get(i));
    dsQuery.setMaxRows(jointQuery.getMaxRows());
    dsQuery.setOrdering(toList(jointQuery.getOrdering()));
    dsQuery.setGrouping(toList(jointQuery.getGrouping()));
    return dsQuery.execute(eventHandler);
  }
  initialize(dataEngine,appContext);
  JointResultMetadata jrm=getJointResultMetadata(left.getResultMetaData(),right.getResultMetaData());
  resultClass=jrm.getResultClass();
  populator=JointDataSetPopulatorFactory.getBinaryTreeDataSetPopulator(left.getOdiResult(),right.getOdiResult(),jrm,matcher,joinType,dataEngine.getSession());
  if (doesSaveToCache() == false)   return new CachedResultSet((BaseQuery)this.odiQuery,resultClass,populator,eventHandler,dataEngine.getSession());
 else   return new CachedResultSet((BaseQuery)this.odiQuery,resultClass,new DataSetResultCache(populator,resultClass,dataEngine.getSession()),eventHandler,dataEngine.getSession());
}

Fixed version (ground truth):
protected org.eclipse.birt.data.engine.odi.IResultIterator executeOdiQuery(IEventHandler eventHandler) throws DataException {
  if (doesLoadFromCache() == true) {
    DataSourceQuery dsQuery=new DataSourceQuery(dataEngine.getSession());
    JointDataSetQuery jointQuery=(JointDataSetQuery)odiQuery;
    dsQuery.setExprProcessor(jointQuery.getExprProcessor());
    List fetchEvents=jointQuery.getFetchEvents();
    if (fetchEvents != null)     for (int i=0; i < fetchEvents.size(); i++)     dsQuery.addOnFetchEvent((IResultObjectEvent)fetchEvents.get(i));
    dsQuery.setMaxRows(jointQuery.getMaxRows());
    dsQuery.setOrdering(toList(jointQuery.getOrdering()));
    dsQuery.setGrouping(toList(jointQuery.getGrouping()));
    return dsQuery.execute(eventHandler);
  }
  initialize(dataEngine,appContext);
  JointResultMetadata jrm=getJointResultMetadata(left.getResultMetaData(),right.getResultMetaData());
  resultClass=jrm.getResultClass();
  populator=JointDataSetPopulatorFactory.getBinaryTreeDataSetPopulator(left.getOdiResult(),right.getOdiResult(),jrm,matcher,joinType,dataEngine.getSession(),dataSetDesign.getRowFetchLimit());
  if (doesSaveToCache() == false)   return new CachedResultSet((BaseQuery)this.odiQuery,resultClass,populator,eventHandler,dataEngine.getSession());
 else   return new CachedResultSet((BaseQuery)this.odiQuery,resultClass,new DataSetResultCache(populator,resultClass,dataEngine.getSession()),eventHandler,dataEngine.getSession());
}
Program: 76928
Project: 76928
Buggy source:
/** 
 * Executes the fetch script; returns the result 
 */
public boolean fetch() throws DataException {
  if (scriptEventHandler != null) {
    try {
      return scriptEventHandler.handleFetch(this,this.getDataRow());
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Executes the fetch script; returns the result 
 */
public boolean fetch() throws DataException {
  if (this.getDesign().getRowFetchLimit() <= 0 || this.rowIndex < this.getDesign().getRowFetchLimit()) {
    if (scriptEventHandler != null) {
      try {
        this.rowIndex++;
        return scriptEventHandler.handleFetch(this,this.getDataRow());
      }
 catch (      BirtException e) {
        throw DataException.wrap(e);
      }
    }
  }
  return false;
}
Program: 76929
Project: 76929
Buggy source:
/** 
 * @return
 */
public static IQuery newOdiQuery(){
  return new IQuery(){
    public void setOrdering(    List sortSpecs) throws DataException {
    }
    public void setGrouping(    List groupSpecs) throws DataException {
    }
    public void setMaxRows(    int maxRows){
    }
    public void addOnFetchEvent(    IResultObjectEvent event){
    }
    public void close(){
    }
    public void setExprProcessor(    IExpressionProcessor exprProcessor){
    }
    public void setDistinctValueFlag(    boolean distinctValueFlag){
    }
  }
;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static IQuery newOdiQuery(){
  return new IQuery(){
    public void setOrdering(    List sortSpecs) throws DataException {
    }
    public void setGrouping(    List groupSpecs) throws DataException {
    }
    public void setMaxRows(    int maxRows){
    }
    public void addOnFetchEvent(    IResultObjectEvent event){
    }
    public void close(){
    }
    public void setExprProcessor(    IExpressionProcessor exprProcessor){
    }
    public void setDistinctValueFlag(    boolean distinctValueFlag){
    }
    public void setRowFetchLimit(    int limit){
    }
  }
;
}
Program: 76930
Project: 76930
Buggy source:
public IResultObject next() throws DataException {
  if (!beInitialized) {
    initialize();
    beInitialized=true;
  }
  if (curComparedResult == 0) {
    return equalNext();
  }
  if (curComparedResult < 0) {
    return lessNext();
  }
  if (curComparedResult > 0) {
    return greaterNext();
  }
  return null;
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  if (this.rowFetchLimit <= 0 || this.rowCount < this.rowFetchLimit) {
    IResultObject result=doNext();
    if (result != null)     this.rowCount++;
    return result;
  }
  return null;
}
Program: 76931
Project: 76931
Buggy source:
/** 
 * Constructor.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @param seeker
 * @throws DataException
 */
public BaseJointDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,IMatchResultObjectSeeker seeker,DataEngineSession session) throws DataException {
  this.meta=meta;
  this.joinType=joinType;
  this.jcm=jcm;
  this.session=session;
  if (isPrimaryLeft()) {
    this.primaryIterator=left;
    this.secondaryIterator=right;
  }
 else {
    this.primaryIterator=right;
    this.secondaryIterator=left;
  }
  beInitialized=false;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @param seeker
 * @throws DataException
 */
public BaseJointDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,IMatchResultObjectSeeker seeker,DataEngineSession session,int rowFetchLimit) throws DataException {
  this.meta=meta;
  this.joinType=joinType;
  this.jcm=jcm;
  this.session=session;
  if (isPrimaryLeft()) {
    this.primaryIterator=left;
    this.secondaryIterator=right;
  }
 else {
    this.primaryIterator=right;
    this.secondaryIterator=left;
  }
  beInitialized=false;
  this.rowFetchLimit=rowFetchLimit;
  this.rowCount=0;
}
Program: 76932
Project: 76932
Buggy source:
/** 
 * Return the IResultObject instance of a data set when curComparedResult is less than 0;
 * @return
 * @throws DataException
 */
private IResultObject lessNext() throws DataException {
  if (curPrimaryMatchValues == null) {
    return null;
  }
  if (joinType == IJointDataSetDesign.INNER_JOIN && curSecondaryMatchValues == null) {
    return null;
  }
  IResultObject resultObject=null;
  if (joinType != IJointDataSetDesign.INNER_JOIN)   resultObject=createResultObject(curPrimaryResultObject,null);
  fetchPrimaryObject();
  curComparedResult=getCompartorResult();
  if (joinType != IJointDataSetDesign.INNER_JOIN) {
    return resultObject;
  }
 else {
    return next();
  }
}

Fixed version (ground truth):
/** 
 * Return the IResultObject instance of a data set when curComparedResult is less than 0;
 * @return
 * @throws DataException
 */
private IResultObject lessNext() throws DataException {
  if (curPrimaryMatchValues == null) {
    return null;
  }
  if (joinType == IJointDataSetDesign.INNER_JOIN && curSecondaryMatchValues == null) {
    return null;
  }
  IResultObject resultObject=null;
  if (joinType != IJointDataSetDesign.INNER_JOIN)   resultObject=createResultObject(curPrimaryResultObject,null);
  fetchPrimaryObject();
  curComparedResult=getCompartorResult();
  if (joinType != IJointDataSetDesign.INNER_JOIN) {
    return resultObject;
  }
 else {
    return doNext();
  }
}
Program: 76933
Project: 76933
Buggy source:
/** 
 * Return the IResultObject instance of a data set when curComparedResult is greater than 0;
 * @return
 * @throws DataException
 */
private IResultObject greaterNext() throws DataException {
  if (curPrimaryMatchValues == null && joinType != IJointDataSetDesign.FULL_OUTER_JOIN) {
    return null;
  }
  if (joinType == IJointDataSetDesign.FULL_OUTER_JOIN && curSecondaryResultObjects.next() && !beSecondaryUsed) {
    return createResultObject(null,curSecondaryResultObjects.getCurrentResult());
  }
  fetchSecondaryObjects();
  curComparedResult=getCompartorResult();
  return next();
}

Fixed version (ground truth):
/** 
 * Return the IResultObject instance of a data set when curComparedResult is greater than 0;
 * @return
 * @throws DataException
 */
private IResultObject greaterNext() throws DataException {
  if (curPrimaryMatchValues == null && joinType != IJointDataSetDesign.FULL_OUTER_JOIN) {
    return null;
  }
  if (joinType == IJointDataSetDesign.FULL_OUTER_JOIN && curSecondaryResultObjects.next() && !beSecondaryUsed) {
    return createResultObject(null,curSecondaryResultObjects.getCurrentResult());
  }
  fetchSecondaryObjects();
  curComparedResult=getCompartorResult();
  return doNext();
}
Program: 76934
Project: 76934
Buggy source:
/** 
 * Return the IResultObject instance of a data set when curComparedResult is equal to 0;
 * @return
 * @throws DataException
 */
private IResultObject equalNext() throws DataException {
  if (curSecondaryResultObjects.next()) {
    beSecondaryUsed=true;
    return createResultObject(curPrimaryResultObject,(IResultObject)(curSecondaryResultObjects.getCurrentResult()));
  }
 else {
    fetchPrimaryObject();
    curComparedResult=getCompartorResult();
    return next();
  }
}

Fixed version (ground truth):
/** 
 * Return the IResultObject instance of a data set when curComparedResult is equal to 0;
 * @return
 * @throws DataException
 */
private IResultObject equalNext() throws DataException {
  if (curSecondaryResultObjects.next()) {
    beSecondaryUsed=true;
    return createResultObject(curPrimaryResultObject,(IResultObject)(curSecondaryResultObjects.getCurrentResult()));
  }
 else {
    fetchPrimaryObject();
    curComparedResult=getCompartorResult();
    return doNext();
  }
}
Program: 76935
Project: 76935
Buggy source:
/** 
 * Return instance of IJointDataSetPopulator which is used for oridinary left, right, and inner join.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @return
 * @throws DataException
 */
public static IDataSetPopulator getBinaryTreeDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,DataEngineSession session) throws DataException {
  return new BaseJointDataSetPopulator(left,right,meta,jcm,joinType,null,session);
}

Fixed version (ground truth):
/** 
 * Return instance of IJointDataSetPopulator which is used for oridinary left, right, and inner join.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @return
 * @throws DataException
 */
public static IDataSetPopulator getBinaryTreeDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,DataEngineSession session,int rowFetchLimit) throws DataException {
  return new BaseJointDataSetPopulator(left,right,meta,jcm,joinType,null,session,rowFetchLimit);
}
Program: 76936
Project: 76936
Buggy source:
/** 
 * Return instance of IJointDataSetPopulator which is used for Cartesian join.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @return
 * @throws DataException
 */
public static IDataSetPopulator getCartesianJointDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,DataEngineSession session) throws DataException {
  IMatchResultObjectSeeker seeker=new CartesianResultObjectSeeker(jcm);
  return new BaseJointDataSetPopulator(left,right,meta,jcm,joinType,seeker,session);
}

Fixed version (ground truth):
/** 
 * Return instance of IJointDataSetPopulator which is used for Cartesian join.
 * @param left
 * @param right
 * @param meta
 * @param jcm
 * @param joinType
 * @return
 * @throws DataException
 */
public static IDataSetPopulator getCartesianJointDataSetPopulator(IResultIterator left,IResultIterator right,JointResultMetadata meta,IJoinConditionMatcher jcm,int joinType,DataEngineSession session,int rowFetchLimit) throws DataException {
  IMatchResultObjectSeeker seeker=new CartesianResultObjectSeeker(jcm);
  return new BaseJointDataSetPopulator(left,right,meta,jcm,joinType,seeker,session,rowFetchLimit);
}
Program: 76939
Project: 76939
Buggy source:
public void modifyText(ModifyEvent e){
  if (!keyChooser.getText().trim().equals("String_Node_Str"))   resetInterval();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  if (!keyChooser.getText().trim().equals("String_Node_Str")) {
    resetInterval();
    tocEditor.setText(getKeyExpression());
  }
}
Program: 76942
Project: 76942
Buggy source:
/** 
 * get parsed parameters as string.
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsString(Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  Map params=new HashMap();
  if (parameterList == null)   return params;
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle parameter=null;
    Object parameterObj=iter.next();
    if (parameterObj instanceof ScalarParameterHandle) {
      parameter=(ScalarParameterHandle)parameterObj;
    }
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    String paramValue=getParamValueAsString(request,parameter);
    if (paramName != null)     params.put(paramName,paramValue);
  }
  return params;
}

Fixed version (ground truth):
/** 
 * get parsed parameters as string.
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParametersAsString(Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  Map params=new HashMap();
  if (parameterList == null)   return params;
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle parameter=null;
    Object parameterObj=iter.next();
    if (parameterObj instanceof ScalarParameterHandle) {
      parameter=(ScalarParameterHandle)parameterObj;
    }
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    Object paramValue=getParamValueAsString(request,parameter);
    if (paramName != null)     params.put(paramName,paramValue);
  }
  return params;
}
Program: 76945
Project: 76945
Buggy source:
/** 
 * get parameter object.
 * @param request HttpServletRequest
 * @param parameter ScalarParameterHandle
 * @return
 */
protected String getParamValueAsString(HttpServletRequest request,ScalarParameterHandle parameter){
  String paramName=parameter.getName();
  String paramValue=null;
  if (ParameterAccessor.isReportParameterExist(request,paramName)) {
    paramValue=ParameterAccessor.getReportParameter(request,paramName,null);
    return paramValue;
  }
  Object paramValueObj=null;
  if (this.isDesigner && (IBirtConstants.SERVLET_PATH_RUN.equalsIgnoreCase(request.getServletPath()) || IBirtConstants.SERVLET_PATH_PARAMETER.equalsIgnoreCase(request.getServletPath())) && 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);
    paramValueObj=ParameterValidationUtil.getDisplayValue(null,parameter.getPattern(),paramValueObj,locale);
  }
  if (paramValueObj != null)   paramValue=paramValueObj.toString();
  return paramValue;
}

Fixed version (ground truth):
/** 
 * get parameter object.
 * @param request HttpServletRequest
 * @param parameter ScalarParameterHandle
 * @return
 */
protected Object getParamValueAsString(HttpServletRequest request,ScalarParameterHandle parameter){
  String paramName=parameter.getName();
  String paramValue=null;
  if (ParameterAccessor.isReportParameterExist(request,paramName)) {
    paramValue=ParameterAccessor.getReportParameter(request,paramName,null);
    return paramValue;
  }
  Object paramValueObj=null;
  if (this.isDesigner && (IBirtConstants.SERVLET_PATH_RUN.equalsIgnoreCase(request.getServletPath()) || IBirtConstants.SERVLET_PATH_PARAMETER.equalsIgnoreCase(request.getServletPath())) && 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)   return paramValue;
  if (paramValueObj instanceof Date)   return paramValueObj;
 else   return paramValueObj.toString();
}
Program: 76946
Project: 76946
Buggy source:
public boolean canLeaveThePage(){
  if (isDirty()) {
    MessageDialog prefDialog=new MessageDialog(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),null,Messages.getString("String_Node_Str"),MessageDialog.INFORMATION,new String[]{Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str")},0);
    int ret=prefDialog.open();
switch (ret) {
case 0:
      doSave(null);
    break;
case 1:
  if (getEditorInput() != null) {
    this.setInput(getEditorInput());
  }
break;
case 2:
return false;
}
}
int errorLine=getErrorLIine();
if (errorLine > -1) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
setFocus();
setHighlightLine(errorLine);
return false;
}
return true;
}

Fixed version (ground truth):
public boolean canLeaveThePage(){
  if (isDirty()) {
    MessageDialog prefDialog=new MessageDialog(UIUtil.getDefaultShell(),Messages.getString("String_Node_Str"),null,Messages.getString("String_Node_Str"),MessageDialog.INFORMATION,new String[]{Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str")},0);
    int ret=prefDialog.open();
switch (ret) {
case 0:
      doSave(null);
    break;
case 1:
  if (getEditorInput() != null) {
    this.setInput(getEditorInput());
  }
break;
case 2:
if (getEditorInput() != null) {
this.setInput(getEditorInput());
}
return false;
}
}
int errorLine=getErrorLIine();
if (errorLine > -1) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
setFocus();
setHighlightLine(errorLine);
return false;
}
return true;
}
Program: 76947
Project: 76947
Buggy source:
/** 
 * Build the border string. <li>ignore all the border styles is style is null <li>CSS default border-color is the font-color, while BIRT is black <li>border-color is not inheritable.
 * @param content The <code>StringBuffer</code> to which the result is output.
 * @param name The proerty name.
 * @param width The border-width value.
 * @param style The border-style value.
 * @param color The border-color value
 */
private static void buildBorder(StringBuffer content,String name,String width,String style,String color){
  if (style == null || style.length() <= 0) {
    return;
  }
  addPropName(content,name);
  addPropValue(content,width);
  addPropValue(content,style);
  addPropValue(content,color == null ? "String_Node_Str" : color);
  content.append(';');
}

Fixed version (ground truth):
/** 
 * Build the border string. <li>ignore all the border styles is style is null <li>CSS default border-color is the font-color, while BIRT is black <li>border-color is not inheritable.
 * @param content The <code>StringBuffer</code> to which the result is output.
 * @param name The proerty name.
 * @param width The border-width value.
 * @param style The border-style value.
 * @param color The border-color value
 */
static void buildBorder(StringBuffer content,String name,String width,String style,String color){
  if (style == null || style.length() <= 0) {
    return;
  }
  addPropName(content,name);
  addPropValue(content,width);
  addPropValue(content,style);
  addPropValue(content,color == null ? "String_Node_Str" : color);
  content.append(';');
}
Program: 76951
Project: 76951
Buggy source:
/** 
 * Sets all the attributes to the node.
 * @param attributes
 */
public void setAttributes(Map attributes){
  attributes.putAll(attributes);
}

Fixed version (ground truth):
/** 
 * Sets all the attributes to the node.
 * @param attributes
 */
public void setAttributes(Map attributes){
  this.attributes.putAll(attributes);
}
Program: 76954
Project: 76954
Buggy source:
/** 
 * Parse report object and get the parameter default values
 * @param design IViewerReportDesignHandle
 * @param paramName String
 * @param options InputOptionsF
 * @return String
 */
protected String getParameterDefaultValues(IViewerReportDesignHandle design,String paramName,InputOptions options) throws ReportServiceException {
  if (design == null)   return null;
  String defalutValue=null;
  Object defaultValueObj=null;
  try {
    defaultValueObj=this.getReportService().getParameterDefaultValue(design,paramName,options);
  }
 catch (  ReportServiceException e) {
    e.printStackTrace();
  }
  ScalarParameterHandle parameter=(ScalarParameterHandle)findParameter(paramName);
  if (defaultValueObj != null && parameter != null) {
    String dataType=parameter.getDataType();
    String pattern=parameter.getPattern();
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
      defalutValue=ParameterValidationUtil.getDisplayValue(defaultValueObj);
    }
 else {
      if (DesignChoiceConstants.PARAM_TYPE_STRING.equalsIgnoreCase(dataType)) {
        pattern=null;
      }
      defalutValue=ParameterValidationUtil.getDisplayValue(null,pattern,defaultValueObj,locale);
    }
  }
  if (defalutValue == null && parameter != null) {
    defalutValue=parameter.getDefaultValue();
  }
  return defalutValue;
}

Fixed version (ground truth):
/** 
 * Parse report object and get the parameter default values
 * @param design IViewerReportDesignHandle
 * @param paramName String
 * @param options InputOptionsF
 * @return Object
 */
protected Object getParameterDefaultValues(IViewerReportDesignHandle design,String paramName,InputOptions options) throws ReportServiceException {
  if (design == null)   return null;
  String defalutValue=null;
  Object defaultValueObj=null;
  try {
    defaultValueObj=this.getReportService().getParameterDefaultValue(design,paramName,options);
  }
 catch (  ReportServiceException e) {
    e.printStackTrace();
  }
  ScalarParameterHandle parameter=(ScalarParameterHandle)findParameter(paramName);
  if (defaultValueObj != null && parameter != null) {
    String dataType=parameter.getDataType();
    String pattern=parameter.getPattern();
    if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
      return defaultValueObj;
    }
    if (DesignChoiceConstants.PARAM_TYPE_STRING.equalsIgnoreCase(dataType)) {
      pattern=null;
    }
    defalutValue=ParameterValidationUtil.getDisplayValue(null,pattern,defaultValueObj,locale);
  }
  if (defalutValue == null && parameter != null) {
    defalutValue=parameter.getDefaultValue();
  }
  return defalutValue;
}
Program: 76955
Project: 76955
Buggy source:
/** 
 * Deletes all files created for the Derby database
 */
private void removeDatabase(){
  logger.info("String_Node_Str" + dbDir);
  if (!removeDirectory(new File(dbDir))) {
    logger.warning("String_Node_Str" + dbDir);
  }
}

Fixed version (ground truth):
/** 
 * Deletes all files created for the Derby database
 */
private void removeDatabase(){
}
Program: 76956
Project: 76956
Buggy source:
private void updateButtons(){
  boolean okEnable=false;
  if (!canSelect || selectedColumnName != null) {
    okEnable=true;
  }
  getOkButton().setEnabled(okEnable);
  int min=0;
  int max=bindingTable.getTable().getItemCount() - 1;
  if ((min <= selectIndex) && (selectIndex <= max)) {
    btnDel.setEnabled(true);
    if (btnEdit != null)     btnEdit.setEnabled(true);
  }
 else {
    btnDel.setEnabled(false);
    if (btnEdit != null)     btnEdit.setEnabled(false);
  }
  bindingTable.getTable().select(selectIndex);
}

Fixed version (ground truth):
private void updateButtons(){
  boolean okEnable=false;
  if (!canSelect || (selectedColumnName != null && getDataSetName() != null)) {
    okEnable=true;
  }
  getOkButton().setEnabled(okEnable);
  int min=0;
  int max=bindingTable.getTable().getItemCount() - 1;
  if ((min <= selectIndex) && (selectIndex <= max)) {
    btnDel.setEnabled(true);
    if (btnEdit != null)     btnEdit.setEnabled(true);
  }
 else {
    btnDel.setEnabled(false);
    if (btnEdit != null)     btnEdit.setEnabled(false);
  }
  bindingTable.getTable().select(selectIndex);
}
Program: 76957
Project: 76957
Buggy source:
/** 
 * @param rs
 * @param rinfo
 * @param is
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,XMLDataInputStream is,String tName) throws OdaException {
  super(rs,rinfo,is,tName);
}

Fixed version (ground truth):
/** 
 * @param rs
 * @param rinfo
 * @param is
 * @param tName
 * @throws OdaException
 */
public SaxParserConsumer(ResultSet rs,RelationInformation rinfo,XMLDataInputStream is,String tName) throws OdaException {
  super(rinfo,is,tName);
}
Program: 76959
Project: 76959
Buggy source:
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data set handles that are visible to this modules.
 * @return data set handles that are visible to this modules.
 */
public List getVisibleDataSets(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SET_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(sortVisibleElements(elementList,IModuleNameScope.NATIVE_LEVEL));
}
Program: 76960
Project: 76960
Buggy source:
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns data source handles that are visible to this modules.
 * @return data source handles that are visible to this modules.
 */
public List getVisibleDataSources(){
  IModuleNameScope namescope=module.getModuleNameSpace(Module.DATA_SOURCE_NAME_SPACE);
  List elementList=namescope.getElements(IModuleNameScope.NATIVE_LEVEL);
  return generateHandleList(sortVisibleElements(elementList,IModuleNameScope.NATIVE_LEVEL));
}
Program: 76961
Project: 76961
Buggy source:
/** 
 * Returns theme handles according the input level.
 * @param level an <code>int</code> value, which should be the one defined in <code>IVisibleLevelControl</code>.
 * @return theme handles according the input level
 */
public List getVisibleThemes(int level){
  List elementList=module.getModuleNameSpace(Module.THEME_NAME_SPACE).getElements(level);
  return generateHandleList(elementList);
}

Fixed version (ground truth):
/** 
 * Returns theme handles according the input level.
 * @param level an <code>int</code> value, which should be the one defined in <code>IVisibleLevelControl</code>.
 * @return theme handles according the input level
 */
public List getVisibleThemes(int level){
  List elementList=module.getModuleNameSpace(Module.THEME_NAME_SPACE).getElements(level);
  return generateHandleList(sortVisibleElements(elementList,level));
}
Program: 76962
Project: 76962
Buggy source:
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSetExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  if (handler.versionNumber <= VersionUtil.VERSION_3_2_7) {
    if (OBSOLETE_XML_FILE_ID.equalsIgnoreCase(extensionID)) {
      extensionID=NEW_XML_FILE_ID;
    }
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSet)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSetExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSetExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSet)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSetExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}
Program: 76963
Project: 76963
Buggy source:
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSourceExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  if (handler.versionNumber <= VersionUtil.VERSION_3_2_7) {
    if (OBSOLETE_XML_FILE_ID.equalsIgnoreCase(extensionID)) {
      extensionID=NEW_XML_FILE_ID;
    }
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSource)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSourceExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse the attribute of "extensionId" for extendable element.
 * @param attrs the SAX attributes object
 * @param extensionNameRequired whether extension name is required
 */
private void parseODADataSourceExtensionID(Attributes attrs,boolean extensionNameRequired){
  String extensionID=getAttrib(attrs,DesignSchemaConstants.EXTENSION_ID_ATTRIB);
  if (StringUtil.isBlank(extensionID)) {
    if (!extensionNameRequired)     return;
    SemanticError e=new SemanticError(element,SemanticError.DESIGN_EXCEPTION_MISSING_EXTENSION);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    return;
  }
  if (handler.versionNumber < VersionUtil.VERSION_3_0_0) {
    if (OBSOLETE_FLAT_FILE_ID.equalsIgnoreCase(extensionID))     extensionID=NEW_FLAT_FILE_ID;
  }
  setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,extensionID);
  provider=((OdaDataSource)element).getProvider();
  if (provider == null)   return;
  if (provider instanceof OdaDummyProvider) {
    SemanticError e=new SemanticError(element,new String[]{extensionID},SemanticError.DESIGN_EXCEPTION_EXTENSION_NOT_FOUND);
    RecoverableError.dealMissingInvalidExtension(handler,e);
    isValidExtensionId=false;
  }
 else {
    String newExtensionID=provider.convertDataSourceExtensionID(extensionID);
    if (!extensionID.equals(newExtensionID)) {
      setProperty(IOdaExtendableElementModel.EXTENSION_ID_PROP,newExtensionID);
    }
  }
}
Program: 76964
Project: 76964
Buggy source:
/** 
 * Configures the tree viewer.
 */
protected void configTreeViewer(){
  ViewsTreeProvider provider=new LibraryExplorerProvider();
  treeViewer.setContentProvider(provider);
  treeViewer.setLabelProvider(provider);
  int ops=DND.DROP_COPY;
  Transfer[] transfers=new Transfer[]{TemplateTransfer.getInstance()};
  treeViewer.addDragSupport(ops,transfers,new LibraryDragListener(treeViewer));
  treeViewer.getControl().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.F5) {
        treeViewer.refresh();
      }
    }
  }
);
  treeViewer.getTree().addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      Object input=treeViewer.getInput();
      if (input instanceof Object[]) {
        Object[] array=(Object[])input;
        for (int i=0; i < array.length; i++) {
          if (array[i] instanceof ResourceEntry)           ((ResourceEntry)array[i]).dispose();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Configures the tree viewer.
 */
protected void configTreeViewer(){
  ViewsTreeProvider provider=new LibraryExplorerProvider();
  treeViewer.setContentProvider(provider);
  treeViewer.setLabelProvider(provider);
  int ops=DND.DROP_COPY | DND.DROP_LINK;
  Transfer[] transfers=new Transfer[]{TemplateTransfer.getInstance()};
  treeViewer.addDragSupport(ops,transfers,new LibraryDragListener(treeViewer));
  treeViewer.getControl().addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent e){
    }
    public void keyReleased(    KeyEvent e){
      if (e.keyCode == SWT.F5) {
        treeViewer.refresh();
      }
    }
  }
);
  treeViewer.getTree().addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      Object input=treeViewer.getInput();
      if (input instanceof Object[]) {
        Object[] array=(Object[])input;
        for (int i=0; i < array.length; i++) {
          if (array[i] instanceof ResourceEntry)           ((ResourceEntry)array[i]).dispose();
        }
      }
    }
  }
);
}