Program: 69837
Project: 69837
Buggy source:
/** 
 * Set the documents media base that is used to deliver media files referenced by the content.
 * @param documentBaseContainer the vfs container that contains the media files
 * @param relFilePath The file path of the HTML file relative to the documentBaseContainer
 * @param usess The user session
 */
public void setDocumentMediaBase(final VFSContainer documentBaseContainer,String relFilePath,UserSession usess){
  linkBrowserRelativeFilePath=relFilePath;
  contentMapper=new Mapper(){
    public MediaResource handle(    String relPath,    HttpServletRequest request){
      VFSItem vfsItem=documentBaseContainer.resolve(relPath);
      MediaResource mr;
      if (vfsItem == null || !(vfsItem instanceof VFSLeaf))       mr=new NotFoundMediaResource(relPath);
 else       mr=new VFSMediaResource((VFSLeaf)vfsItem);
      return mr;
    }
  }
;
  String uri;
  String mapperID=VFSManager.getRealPath(documentBaseContainer);
  if (mapperID == null) {
    uri=CoreSpringFactory.getImpl(MapperService.class).register(usess,contentMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID;
    uri=CoreSpringFactory.getImpl(MapperService.class).register(usess,mapperID,contentMapper);
  }
  if (relFilePath != null) {
    int lastSlash=relFilePath.lastIndexOf("String_Node_Str");
    if (lastSlash == -1) {
      relFilePath="String_Node_Str";
    }
 else     if (lastSlash + 1 < relFilePath.length()) {
      relFilePath=relFilePath.substring(0,lastSlash + 1);
    }
 else {
      String containerPath=documentBaseContainer.getName();
      if (documentBaseContainer instanceof LocalFolderImpl) {
        LocalFolderImpl folder=(LocalFolderImpl)documentBaseContainer;
        containerPath=folder.getBasefile().getAbsolutePath();
      }
      log.warn("String_Node_Str" + relFilePath + "String_Node_Str"+ containerPath);
    }
  }
 else {
    relFilePath="String_Node_Str";
    linkBrowserRelativeFilePath=relFilePath;
  }
  String fulluri=uri + "String_Node_Str" + relFilePath;
  setQuotedConfigValue(DOCUMENT_BASE_URL,fulluri);
}

Fixed version (ground truth):
/** 
 * Set the documents media base that is used to deliver media files referenced by the content.
 * @param documentBaseContainer the vfs container that contains the media files
 * @param relFilePath The file path of the HTML file relative to the documentBaseContainer
 * @param usess The user session
 */
public void setDocumentMediaBase(final VFSContainer documentBaseContainer,String relFilePath,UserSession usess){
  linkBrowserRelativeFilePath=relFilePath;
  contentMapper=new Mapper(){
    public MediaResource handle(    String relPath,    HttpServletRequest request){
      VFSItem vfsItem=documentBaseContainer.resolve(relPath);
      MediaResource mr;
      if (vfsItem == null || !(vfsItem instanceof VFSLeaf))       mr=new NotFoundMediaResource(relPath);
 else       mr=new VFSMediaResource((VFSLeaf)vfsItem);
      return mr;
    }
  }
;
  String uri;
  String mapperID=VFSManager.getRealPath(documentBaseContainer);
  if (mapperID == null) {
    uri=CoreSpringFactory.getImpl(MapperService.class).register(usess,contentMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID;
    uri=CoreSpringFactory.getImpl(MapperService.class).register(mapperID,contentMapper);
  }
  if (relFilePath != null) {
    int lastSlash=relFilePath.lastIndexOf("String_Node_Str");
    if (lastSlash == -1) {
      relFilePath="String_Node_Str";
    }
 else     if (lastSlash + 1 < relFilePath.length()) {
      relFilePath=relFilePath.substring(0,lastSlash + 1);
    }
 else {
      String containerPath=documentBaseContainer.getName();
      if (documentBaseContainer instanceof LocalFolderImpl) {
        LocalFolderImpl folder=(LocalFolderImpl)documentBaseContainer;
        containerPath=folder.getBasefile().getAbsolutePath();
      }
      log.warn("String_Node_Str" + relFilePath + "String_Node_Str"+ containerPath);
    }
  }
 else {
    relFilePath="String_Node_Str";
    linkBrowserRelativeFilePath=relFilePath;
  }
  String fulluri=uri + "String_Node_Str" + relFilePath;
  setQuotedConfigValue(DOCUMENT_BASE_URL,fulluri);
}