nus-yam/ex-repair huggingface dataset:
Program: 73958
Project: 73958
Buggy source:
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
synchronized (cacheCounter2) {
    String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
    cacheCounter2=new Integer(cacheCounter2.intValue() + 1);
    sessionFile=new File(sessionTempDir);
    int i=0;
    while (sessionFile.exists() || !sessionFile.mkdir()) {
      i++;
      sessionTempDir=sessionTempDir + "String_Node_Str" + i;
      sessionFile=new File(sessionTempDir);
      if (i > MAX_DIR_CREATION_ATTEMPT)       throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,sessionFile.getAbsolutePath());
    }
    sessionFile.deleteOnExit();
  }
  return getCanonicalPath(sessionFile);
}

Fixed version (ground truth):
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
synchronized (cacheCounter2) {
    String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
    cacheCounter2=new Integer(cacheCounter2.intValue() + 1);
    sessionFile=new File(sessionTempDir);
    int i=0;
    while (sessionFile.exists() || !sessionFile.mkdirs()) {
      i++;
      sessionTempDir=sessionTempDir + "String_Node_Str" + i;
      sessionFile=new File(sessionTempDir);
      if (i > MAX_DIR_CREATION_ATTEMPT)       throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,sessionFile.getAbsolutePath());
    }
    sessionFile.deleteOnExit();
  }
  return getCanonicalPath(sessionFile);
}
Program: 73959
Project: 73959
Buggy source:
/** 
 * @param tempDirStr
 * @param resultObjectUtil
 */
MergeTempFileUtil(String tempDirStr,ResultObjectUtil resultObjectUtil){
  this.tempDirStr=tempDirStr;
  this.resultObjectUtil=resultObjectUtil;
  File tempDir=new File(tempDirStr);
  if (tempDir.exists() == false)   tempDir.mkdir();
}

Fixed version (ground truth):
/** 
 * @param tempDirStr
 * @param resultObjectUtil
 */
MergeTempFileUtil(String tempDirStr,ResultObjectUtil resultObjectUtil){
  this.tempDirStr=tempDirStr;
  this.resultObjectUtil=resultObjectUtil;
  File tempDir=new File(tempDirStr);
  if (tempDir.exists() == false)   tempDir.mkdirs();
}
Program: 73960
Project: 73960
Buggy source:
/** 
 * Construction
 * @param dataCountOfUnit
 * @param tempDirStr
 * @param goalFileStr
 */
SortDataProvider(int dataCountOfUnit,String tempDirStr,String goalFileStr,ResultObjectUtil resultObjectUtil){
  this.dataCountOfUnit=dataCountOfUnit;
  this.resultObjectUtil=resultObjectUtil;
  tempDir=new File(tempDirStr);
  if (tempDir.exists() == false)   tempDir.mkdir();
  this.tempDirStr=tempDirStr;
  goalFile=new File(goalFileStr);
}

Fixed version (ground truth):
/** 
 * Construction
 * @param dataCountOfUnit
 * @param tempDirStr
 * @param goalFileStr
 */
SortDataProvider(int dataCountOfUnit,String tempDirStr,String goalFileStr,ResultObjectUtil resultObjectUtil){
  this.dataCountOfUnit=dataCountOfUnit;
  this.resultObjectUtil=resultObjectUtil;
  tempDir=new File(tempDirStr);
  if (tempDir.exists() == false)   tempDir.mkdirs();
  this.tempDirStr=tempDirStr;
  goalFile=new File(goalFileStr);
}
Program: 73961
Project: 73961
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode();
  File f=new File(tempDir);
  if (!f.exists() || !f.isDirectory()) {
    f.mkdir();
  }
  tempDir+=File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(tempDir,engine);
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(tempDir,engine);
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 73962
Project: 73962
Buggy source:
/** 
 * @throws FileNotFoundException
 */
private void createCacheOutputStream() throws FileNotFoundException {
  metaOutputStream=new BufferedOutputStream(new FileOutputStream(ResultSetCacheUtil.getMetaFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID())),1024);
  rowOutputStream=new DataOutputStream(new BufferedOutputStream(new FileOutputStream(ResultSetCacheUtil.getDataFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID())),1024));
  File file=ResultSetCacheUtil.getDataFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID());
  file.deleteOnExit();
  file=ResultSetCacheUtil.getMetaFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID());
  file.deleteOnExit();
}

Fixed version (ground truth):
/** 
 * @throws FileNotFoundException
 */
private void createCacheOutputStream() throws FileNotFoundException {
  File tmpDir=new File(resultService.getSession().getTempDir());
  if (!tmpDir.exists() || !tmpDir.isDirectory()) {
    tmpDir.mkdirs();
  }
  metaOutputStream=new BufferedOutputStream(new FileOutputStream(ResultSetCacheUtil.getMetaFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID())),1024);
  rowOutputStream=new DataOutputStream(new BufferedOutputStream(new FileOutputStream(ResultSetCacheUtil.getDataFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID())),1024));
  File file=ResultSetCacheUtil.getDataFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID());
  file.deleteOnExit();
  file=ResultSetCacheUtil.getMetaFile(resultService.getSession().getTempDir(),resultService.getQueryResults().getID());
  file.deleteOnExit();
}
Program: 73963
Project: 73963
Buggy source:
/** 
 * Return the Meta file
 * @return
 */
static File getMetaFile(String tempDir,String id){
  File file=new File(tempDir + CACHED_FILE_PREFIX + id+ "String_Node_Str");
  return file;
}

Fixed version (ground truth):
/** 
 * Return the Meta file
 * @return
 */
static File getMetaFile(String tempDir,String id){
  File tmpDir=new File(tempDir);
  if (!tmpDir.exists() || !tmpDir.isDirectory()) {
    tmpDir.mkdirs();
  }
  File file=new File(tempDir + CACHED_FILE_PREFIX + id+ "String_Node_Str");
  return file;
}
Program: 73964
Project: 73964
Buggy source:
/** 
 * @param documentDir
 * @param deleteOld
 * @throws DataException
 */
public DirectoryDocumentManager(String documentDir,boolean deleteOld) throws DataException {
  this.documentDir=documentDir;
  File dir=new File(documentDir);
  if (!dir.exists() || !dir.isDirectory()) {
    if (!dir.mkdir()) {
      throw new DataException(ResourceConstants.OLAPDIR_CREATE_FAIL,documentDir);
    }
  }
  if (deleteOld) {
    File[] oldFiles=dir.listFiles();
    for (int i=0; i < oldFiles.length; i++) {
      oldFiles[i].delete();
    }
  }
}

Fixed version (ground truth):
/** 
 * @param documentDir
 * @param deleteOld
 * @throws DataException
 */
public DirectoryDocumentManager(String documentDir,boolean deleteOld) throws DataException {
  this.documentDir=documentDir;
  File dir=new File(documentDir);
  if (!dir.exists() || !dir.isDirectory()) {
    if (!dir.mkdirs()) {
      throw new DataException(ResourceConstants.OLAPDIR_CREATE_FAIL,documentDir);
    }
  }
  if (deleteOld) {
    File[] oldFiles=dir.listFiles();
    for (int i=0; i < oldFiles.length; i++) {
      oldFiles[i].delete();
    }
  }
}
Program: 73965
Project: 73965
Buggy source:
/** 
 * @param dirName
 * @param managerName
 * @return
 * @throws DataException
 * @throws IOException
 */
static FileDocumentManager createManager(String dirName,String managerName,int cacheSize) throws DataException, IOException {
  FileDocumentManager manager=new FileDocumentManager(cacheSize);
  manager.create(dirName,managerName);
  return manager;
}

Fixed version (ground truth):
/** 
 * @param dirName
 * @param managerName
 * @return
 * @throws DataException
 * @throws IOException
 */
static FileDocumentManager createManager(String dirName,String managerName,int cacheSize) throws DataException, IOException {
  File tmpDir=new File(dirName);
  if (!tmpDir.exists() || !tmpDir.isDirectory()) {
    tmpDir.mkdirs();
  }
  FileDocumentManager manager=new FileDocumentManager(cacheSize);
  manager.create(dirName,managerName);
  return manager;
}
Program: 73967
Project: 73967
Buggy source:
private void executeQuery(DataEngineImpl myDataEngine) throws BirtException, DataException, Exception, IOException {
  QueryDefinition qd=this.newReportQuery();
  rowBeArray=getRowExpr();
  totalBeArray=getAggrExpr();
  bindingNameRow=getRowExprName();
  bindingExprRow=getAggrExprName();
  prepareExprNameAndQuery(rowBeArray,bindingNameRow,totalBeArray,bindingExprRow,qd);
  IQueryResults qr=myDataEngine.prepare(qd,appContextMap).execute(null);
  qr.getResultIterator().next();
  qr.close();
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.STRING_PREFIX_INTERVAL);
  qd.addResultSetExpression(bindingNameGroup[0],bindingExprGroup[0]);
  qd.addGroup(groupDefn[0]);
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String outputStr=getOutputStrForGroupTest(30,qd,0,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
  getDataSetCacheManager(myDataEngine).resetForTest();
}

Fixed version (ground truth):
private void executeQuery(DataEngineImpl myDataEngine) throws BirtException, DataException, Exception, IOException {
  QueryDefinition qd=this.newReportQuery();
  rowBeArray=getRowExpr();
  totalBeArray=getAggrExpr();
  bindingNameRow=getRowExprName();
  bindingExprRow=getAggrExprName();
  prepareExprNameAndQuery(rowBeArray,bindingNameRow,totalBeArray,bindingExprRow,qd);
  IQueryResults qr=myDataEngine.prepare(qd,appContextMap).execute(null);
  qr.getResultIterator().next();
  qr.close();
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.STRING_PREFIX_INTERVAL);
  groupDefn[0].setIntervalRange(1);
  qd.addResultSetExpression(bindingNameGroup[0],bindingExprGroup[0]);
  qd.addGroup(groupDefn[0]);
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String outputStr=getOutputStrForGroupTest(30,qd,0,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
  getDataSetCacheManager(myDataEngine).resetForTest();
}
Program: 73968
Project: 73968
Buggy source:
private void groupOnNumber(Object startValue) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NUMERIC_INTERVAL);
  if (startValue != null)   groupDefn[0].setIntervalStart(startValue);
  groupDefn[0].setIntervalRange(3);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}

Fixed version (ground truth):
private void groupOnNumber(Object startValue,double intervalRange) throws Exception, IOException {
  String[] bindingNameGroup=new String[1];
  bindingNameGroup[0]="String_Node_Str";
  IBaseExpression[] bindingExprGroup=new IBaseExpression[1];
  bindingExprGroup[0]=new ScriptExpression("String_Node_Str");
  GroupDefinition[] groupDefn=new GroupDefinition[]{new GroupDefinition("String_Node_Str")};
  groupDefn[0].setKeyExpression("String_Node_Str");
  groupDefn[0].setInterval(IGroupDefinition.NUMERIC_INTERVAL);
  if (startValue != null)   groupDefn[0].setIntervalStart(startValue);
  groupDefn[0].setIntervalRange(intervalRange);
  String[] bindingNameRow=new String[3];
  bindingNameRow[0]="String_Node_Str";
  bindingNameRow[1]="String_Node_Str";
  bindingNameRow[2]="String_Node_Str";
  IBaseExpression[] bindingExprRow=new IBaseExpression[3];
  bindingExprRow[0]=new ScriptExpression("String_Node_Str");
  bindingExprRow[1]=new ScriptExpression("String_Node_Str");
  bindingExprRow[2]=new ScriptExpression("String_Node_Str");
  String[] columnStr=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  QueryDefinition qd=this.createQuery(bindingNameGroup,bindingExprGroup,groupDefn,null,null,null,null,null,null,bindingNameRow,bindingExprRow);
  String outputStr=getOutputStrForGroupTest(30,qd,groupDefn.length,bindingNameRow,columnStr);
  testPrint(outputStr);
  this.checkOutputFile();
}
Program: 73969
Project: 73969
Buggy source:
/** 
 * Test feature of group on number
 * @throws Exception
 */
public void testGroupOnNumber1() throws Exception {
  groupOnNumber(null);
}

Fixed version (ground truth):
/** 
 * Test feature of group on number
 * @throws Exception
 */
public void testGroupOnNumber1() throws Exception {
  groupOnNumber(null,3);
}
Program: 73970
Project: 73970
Buggy source:
/** 
 * Test feature of group on number
 * @throws Exception
 */
public void testGroupOnNumber() throws Exception {
  groupOnNumber(new Integer(10));
}

Fixed version (ground truth):
/** 
 * Test feature of group on number
 * @throws Exception
 */
public void testGroupOnNumber() throws Exception {
  groupOnNumber(new Integer(10),3);
}
Program: 73971
Project: 73971
Buggy source:
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,String driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ url);
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + url);
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  RuntimeException e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,String driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ url);
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + url);
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(e.getLocalizedMessage()));
  }
}
Program: 73974
Project: 73974
Buggy source:
private static Logger createFileLogger(String dirName){
  try {
    Handler logFileHandler=new FileHandler(generateUniqueLogFileName(dirName),true);
    logFileHandler.setFormatter(new SimpleFormatter());
    logFileHandler.setLevel(Level.FINEST);
    Logger logger=Logger.getAnonymousLogger();
    logger.addHandler(logFileHandler);
    return logger;
  }
 catch (  SecurityException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
catch (  IOException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
private static Logger createFileLogger(String dirName){
  try {
    File directory=new File(dirName);
    if (!directory.exists()) {
      if (!directory.mkdirs())       throw new IOException("String_Node_Str" + dirName + "String_Node_Str");
    }
 else {
      if (directory.isFile())       throw new IOException("String_Node_Str" + dirName + "String_Node_Str");
    }
    Handler logFileHandler=new FileHandler(generateUniqueLogFileName(dirName),true);
    logFileHandler.setFormatter(new SimpleFormatter());
    logFileHandler.setLevel(Level.FINEST);
    Logger logger=Logger.getAnonymousLogger();
    logger.addHandler(logFileHandler);
    return logger;
  }
 catch (  SecurityException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
catch (  IOException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}
Program: 73975
Project: 73975
Buggy source:
public MarginsPropertyDescriptorProvider(String property,String element){
  super(property,element);
  choiceSet=ChoiceSetFactory.getElementChoiceSet(element,property);
}

Fixed version (ground truth):
public MarginsPropertyDescriptorProvider(String property,String element){
  super(property,element);
  choiceSet=ChoiceSetFactory.getDimensionChoiceSet(element,property);
}
Program: 73976
Project: 73976
Buggy source:
public List checkCompatibility(){
  if (getHeader() == null) {
    PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
    if (headerHandle != null) {
      try {
        headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
      }
 catch (      SemanticException e) {
        List errorList=new ArrayList(1);
        errorList.add(e);
        return errorList;
      }
    }
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public List checkCompatibility(){
  List errorList=new ArrayList(1);
  if (!CROSSTAB_CURRENT_VERSION.equals(handle.getExtensionVersion())) {
    try {
      handle.setExtensionVersion(CROSSTAB_CURRENT_VERSION);
    }
 catch (    SemanticException e) {
      errorList.add(e);
    }
  }
  if (getHeader() == null) {
    PropertyHandle headerHandle=handle.getPropertyHandle(HEADER_PROP);
    if (headerHandle != null) {
      try {
        headerHandle.setValue(CrosstabExtendedItemFactory.createCrosstabCell(getModuleHandle()));
      }
 catch (      SemanticException e) {
        errorList.add(e);
      }
    }
  }
  return errorList.size() == 0 ? Collections.EMPTY_LIST : errorList;
}
Program: 73980
Project: 73980
Buggy source:
public final Object getMetrics(FontDefinition fd){
  return _g2d.getFontMetrics((Font)createFont(fd));
}

Fixed version (ground truth):
public final Object getMetrics(FontDefinition fd){
  return getGraphicsContext().getFontMetrics((Font)createFont(fd));
}
Program: 73981
Project: 73981
Buggy source:
/** 
 * The constructor.
 */
public SwingDisplayServer(){
  _bi=new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
  _g2d=(Graphics2D)_bi.getGraphics();
  _g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  _g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  _g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
  logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{System.getProperty("String_Node_Str"),System.getProperty("String_Node_Str")},getULocale()));
  _simc=new SwingImageCache(this);
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public SwingDisplayServer(){
  logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{System.getProperty("String_Node_Str"),System.getProperty("String_Node_Str")},getULocale()));
  _simc=new SwingImageCache(this);
}
Program: 73982
Project: 73982
Buggy source:
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
    if (GraphicsEnvironment.isHeadless()) {
      iDpiResolution=super.getDpiResolution();
    }
 else {
      iDpiResolution=Toolkit.getDefaultToolkit().getScreenResolution();
    }
  }
  return iDpiResolution;
}

Fixed version (ground truth):
public final int getDpiResolution(){
  if (iDpiResolution == 0) {
switch (getGraphicsContext().getDeviceConfiguration().getDevice().getType()) {
case GraphicsDevice.TYPE_RASTER_SCREEN:
      if (GraphicsEnvironment.isHeadless()) {
        iDpiResolution=super.getDpiResolution();
      }
 else {
        iDpiResolution=Toolkit.getDefaultToolkit().getScreenResolution();
      }
    break;
case GraphicsDevice.TYPE_PRINTER:
  iDpiResolution=72;
break;
case GraphicsDevice.TYPE_IMAGE_BUFFER:
if (userResolution == 0) {
iDpiResolution=Toolkit.getDefaultToolkit().getScreenResolution();
}
 else {
iDpiResolution=userResolution;
}
break;
}
if (iDpiResolution >= 192) {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
 else {
_g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
}
}
return iDpiResolution;
}
Program: 73983
Project: 73983
Buggy source:
public void dispose(){
  _g2d.dispose();
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  if (_bi != null) {
    this._g2d.dispose();
    this._g2d=null;
    this._bi=null;
  }
  super.dispose();
}
Program: 73984
Project: 73984
Buggy source:
public final void setDpiResolution(int dpi){
  iDpiResolution=dpi;
}

Fixed version (ground truth):
public final void setDpiResolution(int dpi){
  userResolution=dpi;
}
Program: 73985
Project: 73985
Buggy source:
public final Object createFont(FontDefinition fd){
  final Map m=new HashMap();
  m.put(TextAttribute.FAMILY,fd.getName());
  m.put(TextAttribute.SIZE,new Float(pointsToPixels(fd.getSize())));
  if (fd.isItalic()) {
    m.put(TextAttribute.POSTURE,TextAttribute.POSTURE_OBLIQUE);
  }
  if (fd.isBold()) {
    m.put(TextAttribute.WEIGHT,TextAttribute.WEIGHT_BOLD);
  }
  if (fd.isUnderline()) {
    m.put(TextAttribute.UNDERLINE,TextAttribute.UNDERLINE_ON);
  }
  if (fd.isStrikethrough()) {
    m.put(TextAttribute.STRIKETHROUGH,TextAttribute.STRIKETHROUGH_ON);
  }
  return new Font(m);
}

Fixed version (ground truth):
public final Object createFont(FontDefinition fd){
  final Map m=new HashMap();
  m.put(TextAttribute.FAMILY,fd.getName());
  m.put(TextAttribute.SIZE,new Float(fd.getSize() * getDpiResolution() / 72d));
  if (fd.isItalic()) {
    m.put(TextAttribute.POSTURE,TextAttribute.POSTURE_OBLIQUE);
  }
  if (fd.isBold()) {
    m.put(TextAttribute.WEIGHT,TextAttribute.WEIGHT_BOLD);
  }
  if (fd.isUnderline()) {
    m.put(TextAttribute.UNDERLINE,TextAttribute.UNDERLINE_ON);
  }
  if (fd.isStrikethrough()) {
    m.put(TextAttribute.STRIKETHROUGH,TextAttribute.STRIKETHROUGH_ON);
  }
  return new Font(m);
}
Program: 73986
Project: 73986
Buggy source:
public ITextMetrics getTextMetrics(Label la){
  return new SwingTextMetrics(this,la);
}

Fixed version (ground truth):
public ITextMetrics getTextMetrics(Label la){
  return new SwingTextMetrics(this,la,getGraphicsContext());
}
Program: 73987
Project: 73987
Buggy source:
public void setProperty(String sProperty,Object oValue){
  if (sProperty.equals(IDeviceRenderer.UPDATE_NOTIFIER) && iv != null) {
    _iun=(IUpdateNotifier)oValue;
    iv.setUpdateNotifier(_iun);
    _lhmAllTriggers.clear();
    Object obj=_iun.peerInstance();
    if (obj instanceof JComponent) {
      JComponent jc=(JComponent)obj;
      if (_eh != null) {
        jc.removeMouseListener(_eh);
        jc.removeMouseMotionListener(_eh);
        jc.removeKeyListener(_eh);
        jc.removeFocusListener(_eh);
      }
      _eh=new SwingEventHandler(iv,_lhmAllTriggers,_iun,getULocale());
      jc.addMouseListener(_eh);
      jc.addMouseMotionListener(_eh);
      jc.addKeyListener(_eh);
      jc.addFocusListener(_eh);
    }
  }
 else   if (sProperty.equals(IDeviceRenderer.GRAPHICS_CONTEXT)) {
    _g2d=(Graphics2D)oValue;
    _g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    _g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
    _g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
    _g2d.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{_g2d},getULocale()));
  }
 else   if (sProperty.equals(IDeviceRenderer.DPI_RESOLUTION)) {
    getDisplayServer().setDpiResolution(((Integer)oValue).intValue());
  }
}

Fixed version (ground truth):
public void setProperty(String sProperty,Object oValue){
  if (sProperty.equals(IDeviceRenderer.UPDATE_NOTIFIER) && iv != null) {
    _iun=(IUpdateNotifier)oValue;
    iv.setUpdateNotifier(_iun);
    _lhmAllTriggers.clear();
    Object obj=_iun.peerInstance();
    if (obj instanceof JComponent) {
      JComponent jc=(JComponent)obj;
      if (_eh != null) {
        jc.removeMouseListener(_eh);
        jc.removeMouseMotionListener(_eh);
        jc.removeKeyListener(_eh);
        jc.removeFocusListener(_eh);
      }
      _eh=new SwingEventHandler(iv,_lhmAllTriggers,_iun,getULocale());
      jc.addMouseListener(_eh);
      jc.addMouseMotionListener(_eh);
      jc.addKeyListener(_eh);
      jc.addFocusListener(_eh);
    }
  }
 else   if (sProperty.equals(IDeviceRenderer.GRAPHICS_CONTEXT)) {
    _g2d=(Graphics2D)oValue;
    prepareGraphicsContext();
  }
 else   if (sProperty.equals(IDeviceRenderer.DPI_RESOLUTION)) {
    getDisplayServer().setDpiResolution(((Integer)oValue).intValue());
  }
}
Program: 73988
Project: 73988
Buggy source:
/** 
 * The constructor initializes a tiny image that provides a graphics context capable of performing computations in the absence of a visual component
 * @param _xs
 * @param _la
 */
public SwingTextMetrics(IDisplayServer _xs,Label _la){
  if (bi == null) {
    bi=new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB);
    g2d=(Graphics2D)((BufferedImage)bi).getGraphics();
    g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
    g2d.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
  }
 else {
    g2d=(Graphics2D)((BufferedImage)bi).getGraphics();
  }
  xs=_xs;
  la=_la;
  computeTextAntialiasing();
  reuse(la);
}

Fixed version (ground truth):
/** 
 * The constructor initializes a tiny image that provides a graphics context capable of performing computations in the absence of a visual component
 * @param _xs
 * @param _la
 * @param _g2d 
 */
public SwingTextMetrics(IDisplayServer _xs,Label _la,Graphics2D _g2d){
  this.g2d=_g2d;
  xs=_xs;
  la=_la;
  computeTextAntialiasing();
  reuse(la);
}
Program: 73989
Project: 73989
Buggy source:
public void dispose(){
  if (bi != null) {
    ((BufferedImage)bi).flush();
    bi=null;
    g2d.dispose();
    g2d=null;
  }
}

Fixed version (ground truth):
public void dispose(){
}
Program: 73996
Project: 73996
Buggy source:
public Object next(){
  try {
    if (!this.hasNext)     return null;
    Object result=this.currentValue;
    boolean accept=false;
    while (this.dataSetIterator.next()) {
      accept=true;
      Iterator it=this.levelValueMap.keySet().iterator();
      while (it.hasNext()) {
        String key=it.next().toString();
        Object value=this.levelValueMap.get(key);
        if (ScriptEvalUtil.compare(value,this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(key))) != 0) {
          accept=false;
          break;
        }
      }
      if (accept) {
        this.currentValue=this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(this.attribute == null ? this.targetLevelName : OlapExpressionUtil.getAttributeColumnName(this.targetLevelName,this.attribute)));
        break;
      }
    }
    this.hasNext=accept;
    return result;
  }
 catch (  BirtException e) {
    return null;
  }
}

Fixed version (ground truth):
public Object next(){
  try {
    if (!this.hasNext)     return null;
    Object result=this.currentValue;
    boolean accept=false;
    while (this.dataSetIterator.next()) {
      accept=true;
      Iterator it=this.levelValueMap.keySet().iterator();
      while (it.hasNext()) {
        String key=it.next().toString();
        Object value=this.levelValueMap.get(key);
        if (ScriptEvalUtil.compare(value,this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(key))) != 0) {
          accept=false;
          break;
        }
      }
      if (accept) {
        this.currentValue=this.dataSetIterator.getValue(this.dataSetIterator.getFieldIndex(this.attribute == null ? this.targetLevelName : OlapExpressionUtil.getAttributeColumnName(this.targetLevelName,this.attribute)));
        break;
      }
    }
    this.hasNext=accept;
    return DataTypeUtil.convert(result,targetDateType);
  }
 catch (  BirtException e) {
    return null;
  }
}
Program: 73997
Project: 73997
Buggy source:
public MemberValueIterator(IDatasetIterator it,Map levelValueMap,String targetLevelName,String attribute){
  this.dataSetIterator=it;
  this.hasNext=true;
  this.levelValueMap=levelValueMap;
  this.targetLevelName=targetLevelName;
  this.attribute=attribute;
  this.next();
}

Fixed version (ground truth):
public MemberValueIterator(IDatasetIterator it,Map levelValueMap,String targetLevelName,String attribute,int targetDataType){
  this.dataSetIterator=it;
  this.hasNext=true;
  this.levelValueMap=levelValueMap;
  this.targetLevelName=targetLevelName;
  this.attribute=attribute;
  this.targetDateType=targetDataType;
  this.next();
}
Program: 73998
Project: 73998
Buggy source:
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  if (!failLoadFileList.isEmpty()) {
    for (int i=0; i < failLoadFileList.size(); i++) {
      if (!fileList.contains(failLoadFileList.get(i))) {
        fileList.add(failLoadFileList.get(i));
      }
    }
  }
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}

Fixed version (ground truth):
/** 
 * Found drivers in the Jar file List
 * @param file
 * @return a List of JDBCDriverInformation
 */
public static void getJdbcDriverFromFile(List fileList){
  if (failLoadFileList != null) {
    boolean duplicated;
    for (int i=0; i < failLoadFileList.size(); i++) {
      duplicated=false;
      File failToLoadFile=(File)failLoadFileList.get(i);
      for (int j=0; j < fileList.size(); j++) {
        if (failToLoadFile.getName().equals(((File)fileList.get(j)).getName())) {
          duplicated=true;
          break;
        }
      }
      if (!duplicated)       fileList.add(failToLoadFile);
    }
  }
  URLClassLoader urlClassLoader=createClassLoader(fileList);
  jdbcDriverInfos.addAll(getJDBCDriverInfoList(fileList,urlClassLoader));
}
Program: 74000
Project: 74000
Buggy source:
public List getReferableMeasureBindings(String measureName,ICubeQueryDefinition cubeDefn) throws DataException {
  List result=new ArrayList();
  List bindings=cubeDefn.getBindings();
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    final String referencedMeasureName=getReferencedMeasureName(binding.getExpression());
    if (measureName.equals(referencedMeasureName)) {
      List aggrOns=binding.getAggregatOns();
      if (aggrOns.size() == 0 && !isGrandTotal(binding)) {
        result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.MEASURE_TYPE));
      }
 else {
        if (fromSameEdge(aggrOns,cubeDefn)) {
          result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.GRAND_TOTAL_TYPE));
        }
 else         result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.SUB_TOTAL_TYPE));
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public List getReferableMeasureBindings(String measureName,ICubeQueryDefinition cubeDefn) throws DataException {
  List result=new ArrayList();
  List bindings=cubeDefn.getBindings();
  for (int i=0; i < bindings.size(); i++) {
    IBinding binding=(IBinding)bindings.get(i);
    final String referencedMeasureName=getReferencedMeasureName(binding.getExpression());
    if (measureName.equals(referencedMeasureName)) {
      List aggrOns=binding.getAggregatOns();
      if (this.isMeasureBinding(cubeDefn,binding)) {
        result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.MEASURE_TYPE));
      }
 else {
        if (fromSameEdge(aggrOns,cubeDefn)) {
          result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.GRAND_TOTAL_TYPE));
        }
 else         result.add(new BindingMetaInfo(binding.getBindingName(),IBindingMetaInfo.SUB_TOTAL_TYPE));
      }
    }
  }
  return result;
}
Program: 74001
Project: 74001
Buggy source:
/** 
 * Indicate whether the binding stands for an OVERALL grand total.
 * @param binding
 * @return
 * @throws DataException
 */
private boolean isGrandTotal(IBinding binding) throws DataException {
  return binding.getAggrFunction() != null;
}

Fixed version (ground truth):
/** 
 * Indicate whether the binding stands for an OVERALL grand total.
 * @param binding
 * @return
 * @throws DataException
 */
private boolean isGrandTotal(IBinding binding) throws DataException {
  return binding.getAggregatOns().size() == 0;
}
Program: 74006
Project: 74006
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  this.USE_ROW_IN_AGGREGATION=false;
  this.GEN_queryResultID=null;
  this.UPDATE_queryResultID=null;
  this.USE_DATE_IN_COLUMNBINDING=true;
  this.GEN_add_subquery=false;
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_print=false;
  this.GEN_use_invalid_column=false;
  this.UPDATE_add_filter=-1;
  this.UPDATE_add_sort=false;
  this.UPDATE_add_diff_group=false;
  this.UPDATE_add_same_group=false;
  this.UPDATE_add_subquery=0;
  this.USE_DATE_IN_SUBQUERY=false;
  this.PRE_add_filter=-1;
  this.PRE_add_sort=false;
  this.PRE_execute_query=false;
  this.PRE_print_groupinfo=false;
  this.PRE_use_skipto=false;
  this.PRE_use_skipto_num=-1;
  this.PRE_add_group=-1;
  this.PRE_basedon_genfilter=false;
  this.GEN_filterDefn=new ArrayList();
  this.UPDATE_filterDefn=new ArrayList();
  this.TEST_ISEMPTY=false;
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  this.notIncludeAggr=false;
  this.add_subquery_on_query=false;
  this.USE_ROW_IN_AGGREGATION=false;
  this.GEN_queryResultID=null;
  this.UPDATE_queryResultID=null;
  this.USE_DATE_IN_COLUMNBINDING=true;
  this.GEN_add_subquery=false;
  this.GEN_add_sort=true;
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_print=false;
  this.GEN_use_invalid_column=false;
  this.UPDATE_add_filter=-1;
  this.UPDATE_add_sort=false;
  this.UPDATE_add_diff_group=false;
  this.UPDATE_add_same_group=false;
  this.UPDATE_add_subquery=0;
  this.USE_DATE_IN_SUBQUERY=false;
  this.PRE_add_filter=-1;
  this.PRE_add_sort=false;
  this.PRE_execute_query=false;
  this.PRE_print_groupinfo=false;
  this.PRE_use_skipto=false;
  this.PRE_use_skipto_num=-1;
  this.PRE_add_group=-1;
  this.PRE_basedon_genfilter=false;
  this.GEN_filterDefn=new ArrayList();
  this.UPDATE_filterDefn=new ArrayList();
  this.TEST_ISEMPTY=false;
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
}
Program: 74007
Project: 74007
Buggy source:
/** 
 * @throws BirtException
 */
private void genBasicIV() throws BirtException {
  QueryDefinition qd=newGenIVReportQuery();
  if (!this.usesDetails) {
    qd.setUsesDetails(false);
  }
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  GEN_queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(this.rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(this.totalExprName[i]) + "String_Node_Str";
    if (this.GEN_print == true)     this.testPrintln(abc);
    if (this.GEN_add_subquery == true) {
      IResultIterator subRi=ri.getSecondaryIterator(subQueryName1,scope);
      while (subRi.next()) {
        abc="String_Node_Str";
        for (int i=0; i < subRowExprName1.length; i++) {
          abc+=subRi.getValue(subRowExprName1[i]) + "String_Node_Str";
        }
        if (this.USE_DATE_IN_SUBQUERY)         abc+=subRi.getValue("String_Node_Str");
      }
      subRi.close();
    }
  }
  if (this.GEN_print == true)   this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genBasicIV() throws BirtException {
  QueryDefinition qd=newGenIVReportQuery();
  if (!this.usesDetails) {
    qd.setUsesDetails(false);
  }
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  GEN_queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(this.rowExprName[i]) + "String_Node_Str";
    if (!this.notIncludeAggr) {
      for (int i=0; i < totalExprName.length; i++)       abc+=ri.getValue(this.totalExprName[i]) + "String_Node_Str";
    }
    if (this.GEN_print == true)     this.testPrintln(abc);
    if (this.GEN_add_subquery == true) {
      IResultIterator subRi=ri.getSecondaryIterator(subQueryName1,scope);
      while (subRi.next()) {
        abc="String_Node_Str";
        for (int i=0; i < subRowExprName1.length; i++) {
          abc+=subRi.getValue(subRowExprName1[i]) + "String_Node_Str";
        }
        if (this.USE_DATE_IN_SUBQUERY)         abc+=subRi.getValue("String_Node_Str");
      }
      subRi.close();
    }
  }
  if (this.add_subquery_on_query) {
    IResultIterator subRi=ri.getSecondaryIterator(subQueryName1,scope);
    String abc="String_Node_Str";
    for (int i=0; i < subRowExprName1.length; i++)     abc+=subRi.getValue(subRowExprName1[i]) + "String_Node_Str";
    if (this.GEN_print)     this.testPrintln(abc);
    while (subRi.next()) {
      abc="String_Node_Str";
      for (int i=0; i < subRowExprName1.length; i++)       abc+=subRi.getValue(subRowExprName1[i]) + "String_Node_Str";
      this.testPrintln(abc);
    }
  }
  if (this.GEN_print == true)   this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 74008
Project: 74008
Buggy source:
/** 
 * @return aggregation expression array
 */
private IBaseExpression[] getAggrExpr(){
  int num2=2;
  IBaseExpression[] totalBeArray=new IBaseExpression[num2];
  totalBeArray[0]=new ScriptExpression("String_Node_Str");
  if (this.USE_ROW_IN_AGGREGATION)   totalBeArray[1]=new ScriptExpression("String_Node_Str");
 else   totalBeArray[1]=new ScriptExpression("String_Node_Str");
  totalExprName=new String[totalBeArray.length];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  return totalBeArray;
}

Fixed version (ground truth):
/** 
 * @return aggregation expression array
 */
private IBaseExpression[] getAggrExpr(){
  if (this.notIncludeAggr)   return new IBaseExpression[0];
  int num2=2;
  IBaseExpression[] totalBeArray=new IBaseExpression[num2];
  totalBeArray[0]=new ScriptExpression("String_Node_Str");
  if (this.USE_ROW_IN_AGGREGATION)   totalBeArray[1]=new ScriptExpression("String_Node_Str");
 else   totalBeArray[1]=new ScriptExpression("String_Node_Str");
  totalExprName=new String[totalBeArray.length];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  return totalBeArray;
}
Program: 74010
Project: 74010
Buggy source:
void shutdownDerby(){
  try {
    getDerbyDriver().connect("String_Node_Str",null);
  }
 catch (  SQLException e) {
  }
}

Fixed version (ground truth):
void shutdownDerby(){
  try {
    if (derbyClassLoader == null || !derbyClassLoader.isGood()) {
      initClassLoaders();
    }
    getDerbyDriver().connect("String_Node_Str",null);
  }
 catch (  SQLException e) {
  }
}
Program: 74012
Project: 74012
Buggy source:
/** 
 * Generate document name according to report name.
 * @param request
 * @return document name.
 */
protected static String generateDocumentFromReport(HttpServletRequest request){
  String fileName=getReport(request,null);
  if (fileName.indexOf('.') >= 0) {
    fileName=fileName.substring(0,fileName.lastIndexOf('.'));
  }
  String id=getParameter(request,PARAM_ID);
  if (id != null && id.length() > 0) {
    fileName=fileName + id + SUFFIX_REPORT_DOCUMENT;
  }
 else {
    fileName=fileName + SUFFIX_REPORT_DOCUMENT;
  }
  return fileName;
}

Fixed version (ground truth):
/** 
 * Generate document name according to report name.
 * @param reportName
 * @param id
 * @return document name.
 */
protected static String generateDocumentFromReport(String reportName,String id){
  if (reportName == null)   return null;
  String documentFile="String_Node_Str";
  if (reportName.indexOf('.') >= 0) {
    documentFile=reportName.substring(0,reportName.lastIndexOf('.'));
  }
  if (id != null && id.length() > 0) {
    documentFile=documentFile + id + SUFFIX_REPORT_DOCUMENT;
  }
 else {
    documentFile=documentFile + SUFFIX_REPORT_DOCUMENT;
  }
  return documentFile;
}
Program: 74013
Project: 74013
Buggy source:
/** 
 * Get report document name. If passed file path is null, get document file from request. If isCreated is true, try to create the document file when file path is null.
 * @param request
 * @param filePath
 * @param isCreated
 * @return
 */
public static String getReportDocument(HttpServletRequest request,String filePath,boolean isCreated){
  if (filePath == null)   filePath=DataUtil.trimString(getParameter(request,PARAM_REPORT_DOCUMENT));
  if (filePath.length() <= 0 && !isCreated)   return null;
  if (filePath.length() <= 0) {
    filePath=generateDocumentFromReport(request);
    filePath=createDocumentPath(filePath,request);
  }
 else {
    filePath=getRealPathOnWorkingFolder(filePath,request);
  }
  return filePath;
}

Fixed version (ground truth):
/** 
 * Return the document file according to report name
 * @param request
 * @param reportFile
 * @param id
 * @return
 */
public static String getReportDocument(HttpServletRequest request,String reportFile,String id){
  if (reportFile == null)   return null;
  String documentFile=generateDocumentFromReport(reportFile,id);
  documentFile=createDocumentPath(documentFile,request);
  return documentFile;
}
Program: 74015
Project: 74015
Buggy source:
private void prepareMetaData(){
  if (isMetaDataPrepared == true)   return;
  HashMap queryIds=report.getQueryIDs();
  HashMap query2itemMapping=report.getReportItemToQueryMap();
  Iterator iter=queryIds.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry entry=(Map.Entry)iter.next();
    IDataQueryDefinition baseQuery=(IDataQueryDefinition)entry.getKey();
    if (baseQuery instanceof IQueryDefinition) {
      IQueryDefinition query=(IQueryDefinition)baseQuery;
      String queryId=(String)entry.getValue();
      ReportItemDesign item=(ReportItemDesign)query2itemMapping.get(query);
      String queryName=item.getName();
      if (queryName == null) {
        queryName="String_Node_Str" + item.getID();
      }
      queryId2NameMapping.put(queryId,queryName);
      queryId2QueryMapping.put(queryId,query);
      ;
    }
  }
  try {
    loadResultSetMetaData();
  }
 catch (  EngineException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
    executionContext.addException(e);
  }
  isMetaDataPrepared=true;
}

Fixed version (ground truth):
private void prepareMetaData(){
  if (isMetaDataPrepared == true)   return;
  HashMap queryIds=report.getQueryIDs();
  HashMap query2itemMapping=report.getReportItemToQueryMap();
  Iterator iter=queryIds.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry entry=(Map.Entry)iter.next();
    IDataQueryDefinition baseQuery=(IDataQueryDefinition)entry.getKey();
    if (baseQuery instanceof IQueryDefinition) {
      IQueryDefinition query=(IQueryDefinition)baseQuery;
      String queryId=(String)entry.getValue();
      ReportItemDesign item=(ReportItemDesign)query2itemMapping.get(query);
      String queryName=item.getName();
      if (queryName == null) {
        queryName="String_Node_Str" + item.getID();
      }
      queryId2NameMapping.put(queryId,queryName);
      queryId2QueryMapping.put(queryId,query);
      ;
    }
  }
  try {
    loadResultSetMetaData();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  isMetaDataPrepared=true;
}