Program: 44198
Project: 44198
Buggy source:
public static SnapshotView createView(PrintStream logger,Stream stream,String loadModule,File viewroot,String viewtag,boolean update) throws IOException, ViewException, CleartoolException, UCMEntityNotFoundException, UnableToCreateEntityException, UnableToGetEntityException, UnableToLoadEntityException {
  SnapshotView snapview=null;
  logger.println("String_Node_Str" + viewroot.getAbsolutePath());
  logger.println("String_Node_Str" + viewtag);
  boolean pathExists=false;
  if (viewroot.exists()) {
    pathExists=true;
    logger.println("String_Node_Str");
  }
 else {
    if (!viewroot.mkdir()) {
      throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,null);
    }
  }
  logger.println("String_Node_Str");
  if (UCMView.viewExists(viewtag)) {
    logger.println("String_Node_Str");
    try {
      String vt=SnapshotView.viewrootIsValid(viewroot);
      logger.println("String_Node_Str" + vt);
      if (!vt.equals(viewtag) && pathExists) {
        logger.println("String_Node_Str" + vt);
        FilePath path=new FilePath(viewroot);
        logger.println("String_Node_Str" + path);
        try {
          path.deleteRecursive();
        }
 catch (        Exception e) {
          throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e);
        }
        return createView(logger,stream,loadModule,viewroot,viewtag);
      }
    }
 catch (    ClearCaseException e) {
      try {
        logger.println("String_Node_Str");
        SnapshotView.end(viewtag);
        SnapshotView.regenerateViewDotDat(viewroot,viewtag);
      }
 catch (      ClearCaseException e1) {
        throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e1);
      }
    }
catch (    Exception e) {
      logger.println("String_Node_Str" + e.getMessage());
      throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e);
    }
    logger.println("String_Node_Str");
    snapview=UCMView.getSnapshotView(viewroot);
  }
 else {
    logger.println("String_Node_Str");
    snapview=SnapshotView.create(stream,viewroot,viewtag);
    logger.println("String_Node_Str" + viewroot.getAbsolutePath());
  }
  if (update) {
    logger.println("String_Node_Str" + loadModule.toLowerCase() + "String_Node_Str");
    LoadRules lr=new LoadRules(snapview,Components.valueOf(loadModule.toUpperCase()));
    snapview.Update(true,true,true,false,lr);
  }
  return snapview;
}

Fixed version (ground truth):
public static SnapshotView createView(PrintStream logger,Stream stream,String loadModule,File viewroot,String viewtag,boolean update) throws ViewException, UnableToInitializeEntityException, CleartoolException, IOException, UnableToLoadEntityException {
  SnapshotView snapview=null;
  logger.println("String_Node_Str" + viewroot.getAbsolutePath());
  logger.println("String_Node_Str" + viewtag);
  boolean pathExists=false;
  if (viewroot.exists()) {
    pathExists=true;
    logger.println("String_Node_Str");
  }
 else {
    if (!viewroot.mkdir()) {
      throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,null);
    }
  }
  logger.println("String_Node_Str");
  if (UCMView.viewExists(viewtag)) {
    logger.println("String_Node_Str");
    try {
      String vt=SnapshotView.viewrootIsValid(viewroot);
      logger.println("String_Node_Str" + vt);
      if (!vt.equals(viewtag) && pathExists) {
        logger.println("String_Node_Str" + vt);
        FilePath path=new FilePath(viewroot);
        logger.println("String_Node_Str" + path);
        try {
          path.deleteRecursive();
        }
 catch (        Exception e) {
          throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e);
        }
        return createView(logger,stream,loadModule,viewroot,viewtag);
      }
    }
 catch (    ClearCaseException e) {
      try {
        logger.println("String_Node_Str");
        SnapshotView.end(viewtag);
        SnapshotView.regenerateViewDotDat(viewroot,viewtag);
      }
 catch (      ClearCaseException e1) {
        throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e1);
      }
    }
catch (    Exception e) {
      logger.println("String_Node_Str" + e.getMessage());
      throw new ViewException("String_Node_Str",viewroot.getAbsolutePath(),Type.CREATION_FAILED,e);
    }
    logger.println("String_Node_Str");
    snapview=SnapshotView.get(viewroot);
  }
 else {
    logger.println("String_Node_Str");
    snapview=SnapshotView.create(stream,viewroot,viewtag);
    logger.println("String_Node_Str" + viewroot.getAbsolutePath());
  }
  if (update) {
    logger.println("String_Node_Str" + loadModule.toLowerCase() + "String_Node_Str");
    LoadRules lr=new LoadRules(snapview,Components.valueOf(loadModule.toUpperCase()));
    snapview.Update(true,true,true,false,lr);
  }
  return snapview;
}