Program: 132420
Project: 132420
Buggy source:
/** 
 * Creates a new instance of DiskLogger
 * @param logfile Name and path of file to use for append log.
 * @throws java.io.FileNotFoundException If that file cannot be created.
 * @throws java.io.IOException If that file cannot be created.
 */
public DiskLogger(String logfileDir,int viewId,long nextLSN,SyncMode syncMode,int pseudoSyncWait,int maxQ) throws FileNotFoundException, IOException {
  super("String_Node_Str");
  if (logfileDir == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (logfileDir.endsWith("String_Node_Str")) {
    this.logfileDir=logfileDir;
  }
 else {
    this.logfileDir=logfileDir + "String_Node_Str";
  }
  this.pseudoSyncWait=pseudoSyncWait;
  this.pseudoSyncModeEnabled=(pseudoSyncWait > 0);
  this.currentViewId=new AtomicInteger(viewId);
  assert(nextLSN > 0);
  this.nextLogSequenceNo=new AtomicLong(nextLSN);
  this.currentLogFileName=createLogFileName();
  File lf=new File(this.currentLogFileName);
  if (!lf.getParentFile().exists() && !lf.getParentFile().mkdirs()) {
    throw new IOException("String_Node_Str");
  }
  this.syncMode=syncMode;
  String openMode="String_Node_Str";
switch (syncMode) {
case ASYNC:
case FSYNC:
case FDATASYNC:
{
      openMode="String_Node_Str";
      break;
    }
case SYNC_WRITE:
{
    openMode="String_Node_Str";
    break;
  }
case SYNC_WRITE_METADATA:
{
  openMode="String_Node_Str";
  break;
}
}
fos=new RandomAccessFile(lf,openMode);
fos.setLength(0);
channel=fos.getChannel();
fdes=fos.getFD();
if (maxQ > 0) entries=new LinkedBlockingQueue(maxQ);
 else entries=new LinkedBlockingQueue();
quit=false;
this.down=new AtomicBoolean(false);
sync=new ReentrantLock();
final String sMode=(pseudoSyncWait == 0) ? "String_Node_Str" : "String_Node_Str";
Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + sMode + "String_Node_Str");
Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + syncMode);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of DiskLogger
 * @param logfile Name and path of file to use for append log.
 * @throws java.io.FileNotFoundException If that file cannot be created.
 * @throws java.io.IOException If that file cannot be created.
 */
public DiskLogger(String logfileDir,int viewId,long nextLSN,SyncMode syncMode,int pseudoSyncWait,int maxQ) throws FileNotFoundException, IOException {
  super("String_Node_Str");
  if (logfileDir == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (logfileDir.endsWith("String_Node_Str")) {
    this.logfileDir=logfileDir;
  }
 else {
    this.logfileDir=logfileDir + "String_Node_Str";
  }
  this.pseudoSyncWait=pseudoSyncWait;
  this.pseudoSyncModeEnabled=(pseudoSyncWait > 0);
  this.currentViewId=new AtomicInteger(viewId);
  assert(nextLSN > 0);
  this.nextLogSequenceNo=new AtomicLong(nextLSN);
  this.currentLogFileName=createLogFileName();
  File lf=new File(this.currentLogFileName);
  if (!lf.getParentFile().exists() && !lf.getParentFile().mkdirs()) {
    throw new IOException("String_Node_Str");
  }
  this.syncMode=syncMode;
  String openMode="String_Node_Str";
switch (syncMode) {
case ASYNC:
case FSYNC:
case FDATASYNC:
{
      openMode="String_Node_Str";
      break;
    }
case SYNC_WRITE:
{
    openMode="String_Node_Str";
    break;
  }
case SYNC_WRITE_METADATA:
{
  openMode="String_Node_Str";
  break;
}
}
fos=new RandomAccessFile(lf,openMode);
fos.setLength(0);
channel=fos.getChannel();
fdes=fos.getFD();
if (maxQ > 0) entries=new LinkedBlockingQueue<LogEntry>(maxQ);
 else entries=new LinkedBlockingQueue<LogEntry>();
quit=false;
this.down=new AtomicBoolean(false);
sync=new ReentrantLock();
final String sMode=(pseudoSyncWait == 0) ? "String_Node_Str" : "String_Node_Str";
Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + sMode + "String_Node_Str");
Logging.logMessage(Logging.LEVEL_INFO,this,"String_Node_Str" + syncMode);
}