Program: 70033
Project: 70033
Buggy source:
public void event(UserRequest ureq,Controller source,Event event){
  if (source == editorCtr) {
    if (event == Event.DONE_EVENT) {
      fireEvent(ureq,new FolderEvent(FolderEvent.NEW_FILE_EVENT,fileName));
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.CANCELLED_EVENT) {
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
  }
 else   if (source == createFileForm) {
    if (event == Event.CANCELLED_EVENT) {
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.FAILED_EVENT) {
      status=FolderCommandStatus.STATUS_FAILED;
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.DONE_EVENT) {
      String relFilePath="String_Node_Str" + fileName;
      if (!folderComponent.getCurrentContainerPath().equals("String_Node_Str")) {
        relFilePath=folderComponent.getCurrentContainerPath() + relFilePath;
      }
      VFSContainer writableRootContainer=folderComponent.getRootContainer();
      Object[] result=VFSManager.findWritableRootFolderFor(writableRootContainer,relFilePath);
      if (result != null) {
        writableRootContainer=(VFSContainer)result[0];
        relFilePath=(String)result[1];
      }
 else {
        relFilePath=fileName;
        writableRootContainer=folderComponent.getCurrentContainer();
      }
      if (relFilePath.endsWith("String_Node_Str") || relFilePath.endsWith("String_Node_Str")) {
        editorCtr=WysiwygFactory.createWysiwygController(ureq,getWindowControl(),writableRootContainer,relFilePath,true);
        ((HTMLEditorController)editorCtr).setNewFile(true);
      }
 else {
        editorCtr=new PlainTextEditorController(ureq,getWindowControl(),(VFSLeaf)writableRootContainer.resolve(relFilePath),"String_Node_Str",true,true,null);
      }
      this.listenTo(editorCtr);
      mainPanel.setContent(editorCtr.getInitialComponent());
    }
  }
}

Fixed version (ground truth):
public void event(UserRequest ureq,Controller source,Event event){
  if (source == editorCtr) {
    if (event == Event.DONE_EVENT) {
      fireEvent(ureq,new FolderEvent(FolderEvent.NEW_FILE_EVENT,fileName));
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.CANCELLED_EVENT) {
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
  }
 else   if (source == createFileForm) {
    if (event == Event.CANCELLED_EVENT) {
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.FAILED_EVENT) {
      status=FolderCommandStatus.STATUS_FAILED;
      fireEvent(ureq,FolderCommand.FOLDERCOMMAND_FINISHED);
    }
 else     if (event == Event.DONE_EVENT) {
      String relFilePath="String_Node_Str" + fileName;
      if (!folderComponent.getCurrentContainerPath().equals("String_Node_Str")) {
        relFilePath=folderComponent.getCurrentContainerPath() + relFilePath;
      }
      VFSContainer writableRootContainer=folderComponent.getRootContainer();
      ContainerAndFile result=VFSManager.findWritableRootFolderFor(writableRootContainer,relFilePath);
      if (result != null) {
        writableRootContainer=result.getContainer();
        relFilePath=result.getFileName();
      }
 else {
        relFilePath=fileName;
        writableRootContainer=folderComponent.getCurrentContainer();
      }
      if (relFilePath.endsWith("String_Node_Str") || relFilePath.endsWith("String_Node_Str")) {
        editorCtr=WysiwygFactory.createWysiwygController(ureq,getWindowControl(),writableRootContainer,relFilePath,true);
        ((HTMLEditorController)editorCtr).setNewFile(true);
      }
 else {
        editorCtr=new PlainTextEditorController(ureq,getWindowControl(),(VFSLeaf)writableRootContainer.resolve(relFilePath),"String_Node_Str",true,true,null);
      }
      this.listenTo(editorCtr);
      mainPanel.setContent(editorCtr.getInitialComponent());
    }
  }
}