nus-yam/ex-repair huggingface dataset:
Program: 72558
Project: 72558
Buggy source:
/** 
 * Obtain a JDBC connection from a Data Source connection factory via the specified JNDI name service.  May return null if no JNDI Name URL is specified, or not able to obtain a connection from the JNDI name service.
 */
private Connection getJndiDSConnection(String driverClass,String jndiNameUrl,Properties connectionProperties){
  if (jndiNameUrl == null || jndiNameUrl.length() == 0)   return null;
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + jndiNameUrl);
  IConnectionFactory factory=new JndiDataSource();
  Connection jndiDSConnection=null;
  try {
    jndiDSConnection=factory.getConnection(driverClass,jndiNameUrl,connectionProperties);
  }
 catch (  SQLException e) {
    if (logger.isLoggable(Level.INFO))     logger.info("String_Node_Str" + e.toString());
  }
  return jndiDSConnection;
}

Fixed version (ground truth):
/** 
 * Obtain a JDBC connection from a Data Source connection factory via the specified JNDI name service.  May return null if no JNDI Name URL is specified, or not able to obtain a connection from the JNDI name service.
 */
private Connection getJndiDSConnection(String driverClass,String jndiNameUrl,Properties connectionProperties){
  if (jndiNameUrl == null || jndiNameUrl.length() == 0)   return null;
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + jndiNameUrl);
  IConnectionFactory factory=new JndiDataSource();
  Connection jndiDSConnection=null;
  try {
    jndiDSConnection=factory.getConnection(driverClass,jndiNameUrl,connectionProperties);
  }
 catch (  SQLException e) {
    if (logger.isLoggable(Level.FINE))     logger.info("String_Node_Str" + e.toString());
  }
  return jndiDSConnection;
}
Program: 72559
Project: 72559
Buggy source:
public void loadAndRegisterDriver(String className,Collection<String> driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  Driver driver=findDriver(className,driverClassPath);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}

Fixed version (ground truth):
public void loadAndRegisterDriver(String className,Collection<String> driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.info("String_Node_Str" + className);
  }
  Driver driver=findDriver(className,driverClassPath);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}
Program: 72560
Project: 72560
Buggy source:
/** 
 * This is used for UPDATE, the data in report document as data source for transformation.
 * @return
 * @throws DataException
 */
public IExprDataResultSet loadExprDataResultSet() throws DataException {
  if (version == VersionManager.VERSION_2_0)   throw new DataException(ResourceConstants.WRONG_VERSION);
  InputStream inputStream=streamManager.getInStream(DataEngineContext.EXPR_META_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  BufferedInputStream buffStream=new BufferedInputStream(inputStream);
  ExprMetaInfo[] exprMetas=ExprMetaUtil.loadExprMetaInfo(buffStream);
  try {
    buffStream.close();
    inputStream.close();
  }
 catch (  IOException e) {
  }
  IExprDataResultSet exprDataResultSet=null;
  if (streamManager.isBasedOnSecondRD() == false)   exprDataResultSet=new ExprDataResultSet1(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),exprMetas,version,version < VersionManager.VERSION_2_2_1_3 ? null : this.loadDataSetData());
 else   exprDataResultSet=new ExprDataResultSet2(tempDir,streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.PARENT_SCOPE),exprMetas,version,version < VersionManager.VERSION_2_2_1_3 ? null : this.loadDataSetData());
  return exprDataResultSet;
}

Fixed version (ground truth):
/** 
 * This is used for UPDATE, the data in report document as data source for transformation.
 * @return
 * @throws DataException
 */
public IExprDataResultSet loadExprDataResultSet() throws DataException {
  if (version == VersionManager.VERSION_2_0)   throw new DataException(ResourceConstants.WRONG_VERSION);
  ExprMetaInfo[] exprMetas=loadExprMetaInfo();
  IExprDataResultSet exprDataResultSet=null;
  if (streamManager.isBasedOnSecondRD() == false)   exprDataResultSet=new ExprDataResultSet1(streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),exprMetas,version,version < VersionManager.VERSION_2_2_1_3 ? null : this.loadDataSetData());
 else   exprDataResultSet=new ExprDataResultSet2(tempDir,streamManager.getInStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE),streamManager.getInStream(DataEngineContext.ROW_INDEX_STREAM,StreamManager.ROOT_STREAM,StreamManager.PARENT_SCOPE),exprMetas,version,version < VersionManager.VERSION_2_2_1_3 ? null : this.loadDataSetData());
  return exprDataResultSet;
}
Program: 72561
Project: 72561
Buggy source:
public void testTotalRunningCount() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_RUNNINGCOUNT_FUNC,ag.getName());
  assertEquals(IAggrFunction.RUNNING_AGGR,ag.getType());
  assertEquals(0,ag.getParameterDefn().length);
  ac.start();
  for (int i=0; i < doubleArray1.length; i++) {
    ac.onRow(new Double[]{new Double(doubleArray1[i]),new Double(5)});
    assertEquals(new Integer(i + 1),ac.getValue());
  }
  ac.finish();
}

Fixed version (ground truth):
public void testTotalRunningCount() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_RUNNINGCOUNT_FUNC,ag.getName());
  assertEquals(IAggrFunction.RUNNING_AGGR,ag.getType());
  assertEquals(1,ag.getParameterDefn().length);
  ac.start();
  for (int i=0; i < doubleArray1.length; i++) {
    ac.onRow(new Double[]{new Double(doubleArray1[i]),new Double(5)});
    assertEquals(new Integer(i + 1),ac.getValue());
  }
  ac.finish();
  ac.start();
  for (int i=0; i < anyObjectArray.length; i++) {
    ac.onRow(new Object[]{anyObjectArray[i]});
  }
  ac.finish();
  assertEquals(new Integer(5),ac.getValue());
  ac.start();
  for (int i=0; i < anyObjectArray.length; i++) {
    ac.onRow(null);
  }
  ac.finish();
  assertEquals(new Integer(8),ac.getValue());
}
Program: 72562
Project: 72562
Buggy source:
/** 
 * Returns the driverName.
 * @return 
 */
String getDriverName(){
  return driverName;
}

Fixed version (ground truth):
/** 
 * Returns the driverName.
 * @return
 */
String getDriverName(){
  return driverName;
}
Program: 72563
Project: 72563
Buggy source:
/** 
 * Find a connection available for new statements in the pool, or create a new one if none available 
 */
private CacheConnection getAvailableConnection() throws DataException {
  Iterator it=odaConnections.iterator();
  while (it.hasNext()) {
    CacheConnection c=(CacheConnection)(it.next());
    if (c.currentStatements < c.maxStatements)     return c;
  }
  return newConnection();
}

Fixed version (ground truth):
/** 
 * Find a connection available for new statements in the pool, or create a new one if none available 
 */
private CacheConnection getAvailableConnection() throws DataException {
  Iterator it=this.getOdaConnections().iterator();
  while (it.hasNext()) {
    CacheConnection c=(CacheConnection)(it.next());
    if (c.currentStatements < c.maxStatements)     return c;
  }
  return newConnection();
}
Program: 72564
Project: 72564
Buggy source:
public ICandidateQuery newCandidateQuery(){
  return new CandidateQuery(this.session);
}

Fixed version (ground truth):
public ICandidateQuery newCandidateQuery(boolean fromCache) throws DataException {
  if (fromCache) {
    return new org.eclipse.birt.data.engine.executor.dscache.CandidateQuery(session);
  }
 else {
    return new CandidateQuery(this.session);
  }
}
Program: 72565
Project: 72565
Buggy source:
/** 
 * @param driverName
 * @param connProperties
 */
DataSource(String driverName,Map connProperties,DataEngineSession session){
  this.driverName=driverName;
  if (connProperties != null)   this.connectionProps.putAll(connProperties);
  this.session=session;
}

Fixed version (ground truth):
/** 
 * @param driverName
 * @param connProperties
 * @param session
 * @param info
 */
public DataSource(String driverName,Map connProperties,DataEngineSession session){
  this.driverName=driverName;
  if (connProperties != null)   this.connectionProps.putAll(connProperties);
  this.session=session;
  this.session.getEngine().addShutdownListener(new ShutdownListener(session));
}
Program: 72566
Project: 72566
Buggy source:
public boolean isOpen(){
  return odaConnections.size() > 0;
}

Fixed version (ground truth):
public boolean isOpen(){
  return this.getOdaConnections().size() > 0;
}
Program: 72567
Project: 72567
Buggy source:
/** 
 * Opens a new Connection and add it to the pool
 * @return
 * @throws DataException
 */
private CacheConnection newConnection() throws DataException {
  CacheConnection conn=new CacheConnection();
  conn.odaConn=ConnectionManager.getInstance().openConnection(driverName,connectionProps,appContext);
  int max=conn.odaConn.getMaxQueries();
  if (max != 0)   conn.maxStatements=max;
  this.odaConnections.add(conn);
  return conn;
}

Fixed version (ground truth):
/** 
 * Opens a new Connection and add it to the pool
 * @return
 * @throws DataException
 */
private CacheConnection newConnection() throws DataException {
  CacheConnection conn=new CacheConnection();
  conn.odaConn=ConnectionManager.getInstance().openConnection(driverName,connectionProps,appContext);
  int max=conn.odaConn.getMaxQueries();
  if (max != 0)   conn.maxStatements=max;
  this.getOdaConnections().add(conn);
  return conn;
}
Program: 72568
Project: 72568
Buggy source:
public IDataSourceQuery newQuery(String queryType,String queryText) throws DataException {
  return new DataSourceQuery(this,queryType,queryText,this.session);
}

Fixed version (ground truth):
public IDataSourceQuery newQuery(String queryType,String queryText,boolean fromCache) throws DataException {
  if (fromCache) {
    return new org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery(this.session);
  }
 else {
    return new DataSourceQuery(this,queryType,queryText,this.session);
  }
}
Program: 72569
Project: 72569
Buggy source:
public void close(){
  if (statementMap.size() > 0) {
    Iterator keySet=statementMap.keySet().iterator();
    while (keySet.hasNext()) {
      PreparedStatement stmt=(PreparedStatement)keySet.next();
      try {
        stmt.close();
      }
 catch (      DataException e) {
        logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
      }
    }
    statementMap.clear();
  }
  Iterator it=odaConnections.iterator();
  while (it.hasNext()) {
    CacheConnection c=(CacheConnection)(it.next());
    try {
      c.odaConn.close();
    }
 catch (    DataException e) {
      logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
    }
  }
  odaConnections.clear();
}

Fixed version (ground truth):
public void close(){
  if (statementMap.size() > 0) {
    Iterator keySet=statementMap.keySet().iterator();
    while (keySet.hasNext()) {
      PreparedStatement stmt=(PreparedStatement)keySet.next();
      try {
        stmt.close();
      }
 catch (      DataException e) {
        logger.logp(Level.FINE,className,"String_Node_Str","String_Node_Str",e);
      }
    }
    statementMap.clear();
  }
  Set<CacheConnection> it=this.getOdaConnections();
  if (it.size() > 1) {
    CacheConnection conn=it.iterator().next();
    conn.currentStatements=0;
    it.remove(conn);
    for (    CacheConnection connections : it) {
      try {
        connections.odaConn.close();
      }
 catch (      DataException e) {
        e.printStackTrace();
      }
    }
    it.clear();
    it.add(conn);
  }
}
Program: 72570
Project: 72570
Buggy source:
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (!visible) {
    return;
  }
  if (isFirstContent) {
    startPageContent(content);
    isFirstContent=false;
  }
  if (emitter != null) {
    if (content.getContentType() == IContent.PAGE_CONTENT) {
      ContentEmitterUtil.endContent(pageContent,emitter);
    }
 else {
      ContentEmitterUtil.endContent(content,emitter);
    }
  }
}

Fixed version (ground truth):
public void endContainer(IContent content,boolean finished,IContentEmitter emitter,boolean visible){
  if (!visible) {
    return;
  }
  if (isFirstContent) {
    startPageContent(content);
    isFirstContent=false;
  }
  if (emitter != null) {
    if (content.getContentType() == IContent.PAGE_CONTENT) {
      ContentEmitterUtil.endContent(pageContent,emitter);
      context.clearPageHint();
    }
 else {
      ContentEmitterUtil.endContent(content,emitter);
    }
  }
}
Program: 72571
Project: 72571
Buggy source:
public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof DesignElementEntry)   e1=((DesignElementEntry)e1).getReportElement();
  if (e2 instanceof DesignElementEntry)   e2=((DesignElementEntry)e2).getReportElement();
  return super.compare(viewer,e1,e2);
}

Fixed version (ground truth):
public int compare(Viewer viewer,Object e1,Object e2){
  if (e1 instanceof ResourceEntry && e2 instanceof ResourceEntry) {
    if ((((ResourceEntry)e1).isFile() ^ ((ResourceEntry)e2).isFile())) {
      return ((ResourceEntry)e1).isFile() ? 1 : -1;
    }
  }
  if (e1 instanceof DesignElementEntry)   e1=((DesignElementEntry)e1).getReportElement();
  if (e2 instanceof DesignElementEntry)   e2=((DesignElementEntry)e2).getReportElement();
  return super.compare(viewer,e1,e2);
}
Program: 72572
Project: 72572
Buggy source:
/** 
 * Creates the tree view
 * @param parent the parent
 */
protected TreeViewer createTreeViewer(Composite parent){
  treeViewer=new TreeViewer(parent,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
  treeViewer.setSorter(new ItemSorter(){
    public int compare(    Viewer viewer,    Object e1,    Object e2){
      if (e1 instanceof DesignElementEntry)       e1=((DesignElementEntry)e1).getReportElement();
      if (e2 instanceof DesignElementEntry)       e2=((DesignElementEntry)e2).getReportElement();
      return super.compare(viewer,e1,e2);
    }
  }
);
  configTreeViewer();
  initPage();
  refreshRoot();
  return treeViewer;
}

Fixed version (ground truth):
/** 
 * Creates the tree view
 * @param parent the parent
 */
protected TreeViewer createTreeViewer(Composite parent){
  treeViewer=new TreeViewer(parent,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
  treeViewer.setSorter(new ItemSorter(){
    public int compare(    Viewer viewer,    Object e1,    Object e2){
      if (e1 instanceof ResourceEntry && e2 instanceof ResourceEntry) {
        if ((((ResourceEntry)e1).isFile() ^ ((ResourceEntry)e2).isFile())) {
          return ((ResourceEntry)e1).isFile() ? 1 : -1;
        }
      }
      if (e1 instanceof DesignElementEntry)       e1=((DesignElementEntry)e1).getReportElement();
      if (e2 instanceof DesignElementEntry)       e2=((DesignElementEntry)e2).getReportElement();
      return super.compare(viewer,e1,e2);
    }
  }
);
  configTreeViewer();
  initPage();
  refreshRoot();
  return treeViewer;
}
Program: 72573
Project: 72573
Buggy source:
/** 
 * save the metadata into the streams.
 * @param key
 */
private void storeDteMetaInfo(String pRsetId,String rowId,String queryId,String rsetId){
  try {
    if (context.isExecutingMasterPage()) {
      if (pRsetId == null) {
        rowId=String.valueOf(context.getPageNumber());
      }
    }
    DteMetaInfoIOUtil.storeMetaInfo(dos,pRsetId,rowId,queryId,rsetId);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * save the metadata into the streams.
 * @param key
 */
private void storeDteMetaInfo(String pRsetId,String rowId,String queryId,String rsetId){
  try {
    if (context.isExecutingMasterPage()) {
      if (pRsetId == null) {
        rowId="String_Node_Str";
      }
    }
    DteMetaInfoIOUtil.storeMetaInfo(dos,pRsetId,rowId,queryId,rsetId);
  }
 catch (  IOException e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
}
Program: 72574
Project: 72574
Buggy source:
private String loadResultSetID(IBaseResultSet parentResult,String queryID) throws BirtException {
  String resultSetID=null;
  if (parentResult == null) {
    if (context.isExecutingMasterPage()) {
      long pageNumber=context.getPageNumber();
      resultSetID=getResultID(null,String.valueOf(pageNumber),queryID);
      if (resultSetID == null) {
        resultSetID=getResultID(null,"String_Node_Str",queryID);
      }
    }
 else {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
    }
  }
 else {
    String pRsetId;
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    String rowid=parentResult.getRawID();
    resultSetID=getResultID(pRsetId,rowid,queryID);
  }
  return resultSetID;
}

Fixed version (ground truth):
private String loadResultSetID(IBaseResultSet parentResult,String queryID) throws BirtException {
  String resultSetID=null;
  if (parentResult == null) {
    if (context.isExecutingMasterPage()) {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
      if (resultSetID == null) {
        long pageNumber=context.getPageNumber();
        resultSetID=getResultID(null,String.valueOf(pageNumber),queryID);
        if (resultSetID == null) {
          resultSetID=getResultID(null,"String_Node_Str",queryID);
        }
      }
    }
 else {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
    }
  }
 else {
    String pRsetId;
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    String rowid=parentResult.getRawID();
    resultSetID=getResultID(pRsetId,rowid,queryID);
  }
  return resultSetID;
}
Program: 72575
Project: 72575
Buggy source:
/** 
 * save the metadata into the streams.
 * @param key
 */
private void storeDteMetaInfo(String pRsetId,String rowId,String queryId,String rsetId){
  if (dos != null) {
    try {
      if (context.isExecutingMasterPage()) {
        if (pRsetId == null) {
          rowId=String.valueOf(context.getPageNumber());
        }
      }
      DteMetaInfoIOUtil.storeMetaInfo(dos,pRsetId,rowId,queryId,rsetId);
    }
 catch (    IOException e) {
      logger.log(Level.SEVERE,e.getMessage());
    }
  }
}

Fixed version (ground truth):
/** 
 * save the metadata into the streams.
 * @param key
 */
private void storeDteMetaInfo(String pRsetId,String rowId,String queryId,String rsetId){
  if (dos != null) {
    try {
      if (context.isExecutingMasterPage()) {
        if (pRsetId == null) {
          rowId="String_Node_Str";
        }
      }
      DteMetaInfoIOUtil.storeMetaInfo(dos,pRsetId,rowId,queryId,rsetId);
    }
 catch (    IOException e) {
      logger.log(Level.SEVERE,e.getMessage());
    }
  }
}
Program: 72576
Project: 72576
Buggy source:
private String loadResultSetID(IBaseResultSet parentResult,String queryID) throws BirtException {
  String resultSetID=null;
  if (parentResult == null) {
    if (context.isExecutingMasterPage()) {
      long pageNumber=context.getPageNumber();
      resultSetID=getResultID(null,String.valueOf(pageNumber),queryID);
      if (resultSetID == null) {
        resultSetID=getResultID(null,"String_Node_Str",queryID);
      }
    }
 else {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
    }
  }
 else {
    String pRsetId;
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    String rowid=parentResult.getRawID();
    resultSetID=getResultID(pRsetId,rowid,queryID);
  }
  return resultSetID;
}

Fixed version (ground truth):
private String loadResultSetID(IBaseResultSet parentResult,String queryID) throws BirtException {
  String resultSetID=null;
  if (parentResult == null) {
    if (context.isExecutingMasterPage()) {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
      if (resultSetID == null) {
        long pageNumber=context.getPageNumber();
        resultSetID=getResultID(null,String.valueOf(pageNumber),queryID);
        if (resultSetID == null) {
          resultSetID=getResultID(null,"String_Node_Str",queryID);
        }
      }
    }
 else {
      resultSetID=getResultID(null,"String_Node_Str",queryID);
    }
  }
 else {
    String pRsetId;
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    String rowid=parentResult.getRawID();
    resultSetID=getResultID(pRsetId,rowid,queryID);
  }
  return resultSetID;
}
Program: 72577
Project: 72577
Buggy source:
public void onRow(Object[] args) throws DataException {
  count++;
}

Fixed version (ground truth):
public void onRow(Object[] args) throws DataException {
  if (!countByColumn || args == null || args.length == 0) {
    if (countByColumn) {
      countByColumn=false;
    }
    ++count;
  }
 else   if (args.length > 0 && args[0] != null) {
    ++count;
  }
}
Program: 72578
Project: 72578
Buggy source:
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{};
}

Fixed version (ground truth):
public IParameterDefn[] getParameterDefn(){
  return new IParameterDefn[]{new ParameterDefn(Constants.EXPRESSION_NAME,Constants.EXPRESSION_DISPLAY_NAME,true,true,SupportedDataTypes.INTEGER_DOUBLE,"String_Node_Str")};
}
Program: 72579
Project: 72579
Buggy source:
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  final String sPreviousValue=getLabel().getCaption().getValue();
  getLabel().getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  try {
    return Methods.computeBox(xs,IConstants.TOP,getLabel(),0,0);
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,uiex);
  }
 finally {
    getLabel().getCaption().setValue(sPreviousValue);
  }
}

Fixed version (ground truth):
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=LabelImpl.copyInstance(getLabel());
  final String sPreviousValue=getLabel().getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  try {
    return Methods.computeBox(xs,IConstants.TOP,la,0,0);
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,uiex);
  }
}
Program: 72580
Project: 72580
Buggy source:
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  final String sPreviousValue=getLabel().getCaption().getValue();
  getLabel().getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  double dWrapping=0;
  EObject container=eContainer();
  if (container instanceof Block) {
    dWrapping=((Block)container).getBounds().getWidth() / 72 * xs.getDpiResolution();
  }
  try {
    return Methods.computeBox(xs,IConstants.TOP,getLabel(),0,0,dWrapping);
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,uiex);
  }
}

Fixed version (ground truth):
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=LabelImpl.copyInstance(getLabel());
  final String sPreviousValue=la.getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  double dWrapping=0;
  EObject container=eContainer();
  if (container instanceof Block) {
    dWrapping=((Block)container).getBounds().getWidth() / 72 * xs.getDpiResolution();
  }
  try {
    return Methods.computeBox(xs,IConstants.TOP,la,0,0,dWrapping);
  }
 catch (  IllegalArgumentException uiex) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.GENERATION,uiex);
  }
}
Program: 72582
Project: 72582
Buggy source:
private void init(){
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector();
}

Fixed version (ground truth):
private void init(){
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector<Listener>();
}
Program: 72583
Project: 72583
Buggy source:
private String buildString(){
  if (sKey != null && sKey.length() > 0) {
    return sKey + ExternalizedTextEditorComposite.SEPARATOR + sCurrent;
  }
  return sCurrent;
}

Fixed version (ground truth):
private String buildString(){
  if (sKey != null && sKey.length() > 0) {
    return sKey + ExternalizedTextEditorComposite.SEPARATOR + sCurrent;
  }
 else   if (sCurrent.contains(ExternalizedTextEditorComposite.SEPARATOR)) {
    return ExternalizedTextEditorComposite.SEPARATOR + sCurrent;
  }
 else {
    return sCurrent;
  }
}
Program: 72584
Project: 72584
Buggy source:
public ExternalizedTextEditorComposite(Composite parent,int style,int iHeightHint,int iWidthHint,List keys,IUIServiceProvider serviceprovider,String sText){
  super(parent,SWT.NONE);
  this.iStyle=style;
  this.iHeightHint=iHeightHint;
  this.iWidthHint=iWidthHint;
  this.keys=keys;
  this.serviceprovider=serviceprovider;
  init();
  placeComponents();
  setText(sText);
}

Fixed version (ground truth):
public ExternalizedTextEditorComposite(Composite parent,int style,int iHeightHint,int iWidthHint,List<String> keys,IUIServiceProvider serviceprovider,String sText){
  super(parent,SWT.NONE);
  this.iStyle=style;
  this.iHeightHint=iHeightHint;
  this.iWidthHint=iWidthHint;
  this.keys=keys;
  this.serviceprovider=serviceprovider;
  init();
  placeComponents();
  setText(sText);
}
Program: 72585
Project: 72585
Buggy source:
/** 
 * @return "key=defaultValue"
 */
private String buildString(){
  StringBuffer sbText=new StringBuffer("String_Node_Str");
  String sKey=cmbKeys.getText();
  if (cbExternalize.getSelection()) {
    sbText.append(sKey);
    sbText.append(ExternalizedTextEditorComposite.SEPARATOR);
  }
  sbText.append(txtValue.getText());
  return sbText.toString();
}

Fixed version (ground truth):
/** 
 * @return "key=defaultValue"
 */
private String buildString(){
  StringBuffer sbText=new StringBuffer("String_Node_Str");
  String sKey=cmbKeys.getText();
  if (cbExternalize.getSelection()) {
    sbText.append(sKey);
    sbText.append(ExternalizedTextEditorComposite.SEPARATOR);
  }
 else   if (txtValue.getText().contains(ExternalizedTextEditorComposite.SEPARATOR)) {
    sbText.append(ExternalizedTextEditorComposite.SEPARATOR);
  }
  sbText.append(txtValue.getText());
  return sbText.toString();
}
Program: 72586
Project: 72586
Buggy source:
/** 
 * @param parent
 * @param style
 */
public ExternalizedTextEditorDialog(Shell parent,String sText,List keys,IUIServiceProvider serviceprovider,String defaultValue){
  super(parent);
  this.sResult=sText;
  this.sInputValue=getValueComponent(sText);
  this.keys=keys;
  this.serviceprovider=serviceprovider;
  this.defaultValue=defaultValue;
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param style
 */
public ExternalizedTextEditorDialog(Shell parent,String sText,List<String> keys,IUIServiceProvider serviceprovider,String defaultValue){
  super(parent);
  this.sResult=sText;
  this.sInputValue=getValueComponent(sText);
  this.keys=keys;
  this.serviceprovider=serviceprovider;
  this.defaultValue=defaultValue;
}
Program: 72587
Project: 72587
Buggy source:
public void dispose(){
  if (container != null || !container.isDisposed())   container.dispose();
  deRegisterEventManager();
}

Fixed version (ground truth):
public void dispose(){
  if (container != null && !container.isDisposed()) {
    container.dispose();
  }
  deRegisterEventManager();
}
Program: 72588
Project: 72588
Buggy source:
public void postElementEvent(){
  if (fTableViewer.getContentProvider() == null) {
    return;
  }
  if (fTableViewer != null) {
    fTableViewer.setInput(input);
    refreshTableItemView();
  }
}

Fixed version (ground truth):
public void postElementEvent(){
  if (fTableViewer == null || fTableViewer.getContentProvider() == null) {
    return;
  }
  if (fTableViewer != null) {
    fTableViewer.setInput(input);
    refreshTableItemView();
  }
}
Program: 72589
Project: 72589
Buggy source:
/** 
 * Test if the handle is from library.
 * @param handle
 * @return
 */
public static boolean isReferenceElement(DesignElementHandle handle){
  return handle.getExtends() != null;
}

Fixed version (ground truth):
/** 
 * Test if the handle is from library.
 * @param handle
 * @return
 * @deprecated use {@link #isLinkedElement(DesignElementHandle)}
 */
public static boolean isReferenceElement(DesignElementHandle handle){
  return isLinkedElement(handle);
}
Program: 72590
Project: 72590
Buggy source:
public Image getNodeIcon(Object model){
  if (model instanceof DesignElementHandle && ((DesignElementHandle)model).getSemanticErrors().size() > 0) {
    return ReportPlatformUIImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
  }
  if (OlapUtil.needLibraryImage(model))   return UIHelper.getImage(BuilderConstancts.IMAGE_LINK_CUBE);
 else   return UIHelper.getImage(BuilderConstancts.IMAGE_CUBE);
}

Fixed version (ground truth):
public Image getNodeIcon(Object model){
  if (model instanceof DesignElementHandle && ((DesignElementHandle)model).getSemanticErrors().size() > 0) {
    return ReportPlatformUIImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
  }
  if (OlapUtil.isFromLibrary(model))   return UIHelper.getImage(BuilderConstancts.IMAGE_LINK_CUBE);
 else   return UIHelper.getImage(BuilderConstancts.IMAGE_CUBE);
}
Program: 72591
Project: 72591
Buggy source:
public static boolean isFromLibrary(Object model){
  if (model instanceof DesignElementHandle) {
    DesignElementHandle handle=(DesignElementHandle)model;
    if (handle.getExtends() != null && handle.getExtends().getRoot() instanceof LibraryHandle) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isFromLibrary(Object model){
  if (model instanceof DesignElementHandle) {
    return DEUtil.isLinkedElement((DesignElementHandle)model);
  }
  return false;
}
Program: 72592
Project: 72592
Buggy source:
private static boolean isLinkImg(DesignElementHandle handle){
  if (!(handle.getRoot() instanceof LibraryHandle || (handle.getExtends() != null && handle.getExtends().getRoot() instanceof LibraryHandle))) {
    return false;
  }
  if ((handle instanceof DataSourceHandle) || (handle instanceof DataSetHandle) || (handle instanceof GridHandle)|| (handle instanceof ImageHandle)|| (handle instanceof DataItemHandle)|| (handle instanceof LabelHandle)|| (handle instanceof ListingHandle)|| (handle instanceof TableHandle)|| (handle instanceof TextItemHandle)|| (handle instanceof TextDataHandle)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isLinkImg(DesignElementHandle handle){
  if (!DEUtil.isLinkedElement(handle)) {
    return false;
  }
  if ((handle instanceof DataSourceHandle) || (handle instanceof DataSetHandle) || (handle instanceof GridHandle)|| (handle instanceof ImageHandle)|| (handle instanceof DataItemHandle)|| (handle instanceof LabelHandle)|| (handle instanceof ListingHandle)|| (handle instanceof TableHandle)|| (handle instanceof TextItemHandle)|| (handle instanceof TextDataHandle)) {
    return true;
  }
  return false;
}
Program: 72593
Project: 72593
Buggy source:
public boolean isEnabled(){
  boolean enabled=true;
  if (measureViewHandle instanceof ComputedMeasureViewHandle) {
    enabled=false;
  }
 else {
    if (OlapUtil.isFromLibrary(measureViewHandle.getCrosstabHandle())) {
      return false;
    }
    IAggregationCellViewProvider provider=providerWrapper.getProvider(expectedView);
    SwitchCellInfo info=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
    info.setMeasureInfo(true,measureViewHandle.getCubeMeasureName(),expectedView);
    enabled=provider.canSwitch(info);
    IAggregationCellViewProvider matchProvider=providerWrapper.getMatchProvider(measureViewHandle.getCell());
    if (matchProvider != null && matchProvider.getViewName().equals(expectedView)) {
      enabled=false;
    }
  }
  setEnabled(enabled);
  return enabled;
}

Fixed version (ground truth):
public boolean isEnabled(){
  boolean enabled=true;
  if (measureViewHandle instanceof ComputedMeasureViewHandle) {
    enabled=false;
  }
 else {
    if (DEUtil.isLinkedElement(measureViewHandle.getCrosstabHandle())) {
      return false;
    }
    IAggregationCellViewProvider provider=providerWrapper.getProvider(expectedView);
    SwitchCellInfo info=new SwitchCellInfo(measureViewHandle.getCrosstab(),SwitchCellInfo.MEASURE);
    info.setMeasureInfo(true,measureViewHandle.getCubeMeasureName(),expectedView);
    enabled=provider.canSwitch(info);
    IAggregationCellViewProvider matchProvider=providerWrapper.getMatchProvider(measureViewHandle.getCell());
    if (matchProvider != null && matchProvider.getViewName().equals(expectedView)) {
      enabled=false;
    }
  }
  setEnabled(enabled);
  return enabled;
}
Program: 72594
Project: 72594
Buggy source:
public Image getNodeIcon(Object model){
  if (model instanceof DesignElementHandle && ((DesignElementHandle)model).getSemanticErrors().size() > 0) {
    return ReportPlatformUIImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
  }
  if (OlapUtil.needLibraryImage(model))   return CrosstabUIHelper.getImage(CrosstabUIHelper.CROSSTAB_LINK_IMAGE);
  return CrosstabUIHelper.getImage(CrosstabUIHelper.CROSSTAB_IMAGE);
}

Fixed version (ground truth):
public Image getNodeIcon(Object model){
  if (model instanceof DesignElementHandle && ((DesignElementHandle)model).getSemanticErrors().size() > 0) {
    return ReportPlatformUIImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
  }
  if (model instanceof DesignElementHandle && DEUtil.isLinkedElement((DesignElementHandle)model))   return CrosstabUIHelper.getImage(CrosstabUIHelper.CROSSTAB_LINK_IMAGE);
  return CrosstabUIHelper.getImage(CrosstabUIHelper.CROSSTAB_IMAGE);
}
Program: 72596
Project: 72596
Buggy source:
private void populateSeriesTypes(Collection allChartType,Series series,Orientation orientation){
  Iterator iterTypes=allChartType.iterator();
  while (iterTypes.hasNext()) {
    IChartType type=(IChartType)iterTypes.next();
    Series newSeries=type.getSeries();
    if (htSeriesNames == null) {
      htSeriesNames=new Hashtable<String,Series>(20);
    }
    if (newSeries.canParticipateInCombination()) {
      if (!(newSeries instanceof StockSeries) || (orientation.getValue() == Orientation.VERTICAL)) {
        String sDisplayName=newSeries.getDisplayName();
        htSeriesNames.put(sDisplayName,newSeries);
        cbSeriesType.add(sDisplayName);
      }
      if (type.getName().equals(chartModel.getType())) {
        cbSeriesType.select(cbSeriesType.getItemCount() - 1);
      }
    }
  }
}

Fixed version (ground truth):
private void populateSeriesTypes(Collection<IChartType> allChartType,Series series,Orientation orientation){
  Iterator<IChartType> iterTypes=allChartType.iterator();
  while (iterTypes.hasNext()) {
    IChartType type=iterTypes.next();
    Series newSeries=type.getSeries();
    if (htSeriesNames == null) {
      htSeriesNames=new Hashtable<String,Series>(20);
    }
    if (newSeries.canParticipateInCombination()) {
      if (!(newSeries instanceof StockSeries) || (orientation.getValue() == Orientation.VERTICAL)) {
        String sDisplayName=newSeries.getDisplayName();
        htSeriesNames.put(sDisplayName,newSeries);
        cbSeriesType.add(sDisplayName);
      }
      if (type.getName().equals(chartModel.getType())) {
        cbSeriesType.select(cbSeriesType.getItemCount() - 1);
      }
    }
  }
}
Program: 72598
Project: 72598
Buggy source:
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
private boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=(IChartType)htTypes.get(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}

Fixed version (ground truth):
/** 
 * Updates the dimension combo according to chart type and axes number
 * @param sSelectedType Chart type
 * @return whether the dimension is changed after updating
 */
private boolean updateDimensionCombo(String sSelectedType){
  boolean isOldExist=false;
  IChartType chartType=htTypes.get(sSelectedType);
  String[] dimensionArray=chartType.getSupportedDimensions();
  int axesNum=ChartUIUtil.getOrthogonalAxisNumber(chartModel);
  if (sDimension == null) {
    sDimension=chartType.getDefaultDimension();
    isOldExist=true;
  }
  cbDimension.removeAll();
  for (int i=0; i < dimensionArray.length; i++) {
    boolean isSupported=chartType.isDimensionSupported(dimensionArray[i],(ChartWizardContext)context,axesNum,0);
    if (isSupported) {
      cbDimension.add(dimensionArray[i]);
    }
    if (!isOldExist && sDimension.equals(dimensionArray[i])) {
      isOldExist=isSupported;
    }
  }
  if (!isOldExist) {
    sDimension=chartType.getDefaultDimension();
  }
  cbDimension.setText(sDimension);
  return !isOldExist;
}
Program: 72599
Project: 72599
Buggy source:
public void createControl(Composite parent){
  manipulateCompatible();
  initControl(parent);
  if (previewPainter == null) {
    previewPainter=createPreviewPainter();
  }
  doPreview();
}

Fixed version (ground truth):
public void createControl(Composite parent){
  manipulateCompatible();
  initControl(parent);
  if (previewPainter == null) {
    previewPainter=createPreviewPainter();
  }
  if (!isSutaskPreviewable(getCurrentSubtask())) {
    doPreview();
  }
}
Program: 72600
Project: 72600
Buggy source:
private void populateSeriesTypesList(){
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (series.canParticipateInCombination()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(getContext().getClass().getSimpleName()),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    ;
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel != null && chartModel instanceof ChartWithAxes) {
    String lastType=ChartCacheManager.getInstance().findSeriesType();
    if (lastType != null) {
      cbSeriesType.setText(lastType);
    }
 else {
      Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
      if (xAxis.getAssociatedAxes().size() > 1) {
        Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
        if (!overlayAxis.getSeriesDefinitions().isEmpty()) {
          String sDisplayName=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries().getDisplayName();
          cbSeriesType.setText(sDisplayName);
        }
      }
    }
    changeOverlaySeriesType();
    refreshChart();
    doPreview();
  }
}

Fixed version (ground truth):
private void populateSeriesTypesList(boolean bPreivew){
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (series.canParticipateInCombination()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(getContext().getClass().getSimpleName()),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    ;
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel != null && chartModel instanceof ChartWithAxes) {
    String lastType=ChartCacheManager.getInstance().findSeriesType();
    if (lastType != null) {
      cbSeriesType.setText(lastType);
    }
 else {
      Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
      if (xAxis.getAssociatedAxes().size() > 1) {
        Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
        if (!overlayAxis.getSeriesDefinitions().isEmpty()) {
          String sDisplayName=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries().getDisplayName();
          cbSeriesType.setText(sDisplayName);
        }
      }
    }
    changeOverlaySeriesType();
    refreshChart();
    if (bPreivew) {
      doPreview();
    }
  }
}
Program: 72601
Project: 72601
Buggy source:
private void placeComponents(){
  foSashForm=new SashForm(topControl,SWT.VERTICAL);
{
    GridLayout layout=new GridLayout();
    foSashForm.setLayout(layout);
    GridData gridData=new GridData(GridData.FILL_BOTH);
    gridData.heightHint=570;
    foSashForm.setLayoutData(gridData);
  }
  createPreviewArea();
  createTypeArea();
  setDefaultTypeSelection();
  refreshChart();
  populateSeriesTypesList();
}

Fixed version (ground truth):
private void placeComponents(){
  foSashForm=new SashForm(topControl,SWT.VERTICAL);
{
    GridLayout layout=new GridLayout();
    foSashForm.setLayout(layout);
    GridData gridData=new GridData(GridData.FILL_BOTH);
    gridData.heightHint=570;
    foSashForm.setLayoutData(gridData);
  }
  createPreviewArea();
  createTypeArea();
  setDefaultTypeSelection();
  refreshChart();
  populateSeriesTypesList(false);
}
Program: 72603
Project: 72603
Buggy source:
private Data createDateData(Object txt,StyleEntry entry,String timeFormat){
  timeFormat=ExcelUtil.parse(timeFormat);
  if (timeFormat.equals("String_Node_Str")) {
    timeFormat="String_Node_Str";
  }
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
  return new Data(txt,entry,Data.DATE);
}

Fixed version (ground truth):
private Data createDateData(Object txt,StyleEntry entry,String timeFormat){
  timeFormat=ExcelUtil.parse(timeFormat);
  if (timeFormat.equals("String_Node_Str")) {
    if (txt instanceof java.sql.Date) {
      timeFormat="String_Node_Str";
    }
 else     if (txt instanceof java.sql.Time) {
      timeFormat="String_Node_Str";
    }
 else {
      timeFormat="String_Node_Str";
    }
  }
  entry.setProperty(StyleConstant.DATE_FORMAT_PROP,timeFormat);
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Data.DATE);
  return new Data(txt,entry,Data.DATE);
}
Program: 72604
Project: 72604
Buggy source:
public JSObjectMetaData getReturn(){
  JSObjectMetaData meta=JSSyntaxContext.getEnginJSObject(method.getReturnType());
  if (meta == null)   try {
    return JSSyntaxContext.getJavaClassMeta(method.getReturnType());
  }
 catch (  ClassNotFoundException e) {
    return null;
  }
  return meta;
}

Fixed version (ground truth):
public JSObjectMetaData getReturn(){
  JSObjectMetaData meta=JSSyntaxContext.getEnginJSObject(method.getReturnType());
  if (meta == null) {
    try {
      return JSSyntaxContext.getJavaClassMeta(method.getReturnType());
    }
 catch (    ClassNotFoundException e) {
      return null;
    }
  }
  return meta;
}
Program: 72605
Project: 72605
Buggy source:
private CompletionProposal[] getCompletionProposals(JSObjectMetaData meta,int offset){
  List proposals=new ArrayList();
  int wordLength=currentWord == null ? 0 : currentWord.length();
  JSField[] members=meta.getFields();
  if (members != null) {
    for (int i=0; i < members.length; i++) {
      if (currentWord == null || currentWord.equals("String_Node_Str") || members[i].getName().toLowerCase().startsWith(currentWord.toLowerCase())) {
        proposals.add(new CompletionProposal(members[i].getName(),offset - wordLength,wordLength,members[i].getName().length(),getMemberImage(members[i].getVisibility()),members[i].getDisplayText(),null,null));
      }
    }
  }
  JSMethod[] methods=meta.getMethods();
  if (methods != null) {
    for (int i=0; i < methods.length; i++) {
      if (currentWord == null || currentWord.equals("String_Node_Str") || methods[i].getName().toLowerCase().startsWith(currentWord.toLowerCase())) {
        proposals.add(new CompletionProposal("String_Node_Str" + methods[i].getName() + "String_Node_Str",offset - wordLength - 1,wordLength + 1,methods[i].getName().length() + 2,getMethodImage(methods[i].getVisibility()),methods[i].getDisplayText(),null,null));
      }
    }
  }
  return (CompletionProposal[])proposals.toArray(new CompletionProposal[proposals.size()]);
}

Fixed version (ground truth):
private CompletionProposal[] getCompletionProposals(JSObjectMetaData meta,int offset){
  List<CompletionProposal> proposals=new ArrayList<CompletionProposal>();
  int wordLength=currentWord == null ? 0 : currentWord.length();
  JSField[] members=meta.getFields();
  if (members != null) {
    for (int i=0; i < members.length; i++) {
      if (currentWord == null || currentWord.equals("String_Node_Str") || members[i].getName().toLowerCase().startsWith(currentWord.toLowerCase())) {
        proposals.add(new CompletionProposal(members[i].getName(),offset - wordLength,wordLength,members[i].getName().length(),getMemberImage(members[i].getVisibility()),members[i].getDisplayText(),null,null));
      }
    }
  }
  JSMethod[] methods=meta.getMethods();
  if (methods != null) {
    for (int i=0; i < methods.length; i++) {
      if (currentWord == null || currentWord.equals("String_Node_Str") || methods[i].getName().toLowerCase().startsWith(currentWord.toLowerCase())) {
        JSObjectMetaData[] args=methods[i].getArguments();
        boolean hasArg=args != null && args.length > 0;
        proposals.add(new CompletionProposal("String_Node_Str" + methods[i].getName() + "String_Node_Str",offset - wordLength - 1,wordLength + 1,methods[i].getName().length() + (hasArg ? 2 : 3),getMethodImage(methods[i].getVisibility()),methods[i].getDisplayText(),null,null));
      }
    }
  }
  return proposals.toArray(new CompletionProposal[proposals.size()]);
}
Program: 72606
Project: 72606
Buggy source:
public JSObjectMetaData getVariableMeta(String variableName){
  if (objectMetaMap.containsKey(variableName))   return (JSObjectMetaData)objectMetaMap.get(variableName);
 else   return getEnginJSObject(variableName);
}

Fixed version (ground truth):
public JSObjectMetaData getVariableMeta(String variableName){
  if (objectMetaMap.containsKey(variableName)) {
    return objectMetaMap.get(variableName);
  }
 else {
    return getEnginJSObject(variableName);
  }
}