final Library library = libraryTable.createLibrary(libraryName);
final Library.ModifiableModel libraryModel = library.getModifiableModel();
for (OrderRootType rootType : OrderRootType.ALL_TYPES) {
final String[] roots = lib.getRoots(rootType);
for (String root : roots) {
<BUG>final VirtualFile vRoot = OrderRootType.CLASSES.equals(rootType)
? JarFileSystem.getInstance().refreshAndFindFileByPath(root + "!/")
: LocalFileSystem.getInstance().refreshAndFindFileByPath(root);

if (vRoot != null) {</BUG>
libraryModel.addRoot(vRoot, rootType);

final Library library = libraryTable.createLibrary(libraryName);
final Library.ModifiableModel libraryModel = library.getModifiableModel();
for (OrderRootType rootType : OrderRootType.ALL_TYPES) {
final String[] roots = lib.getRoots(rootType);
for (String root : roots) {
VirtualFile vRoot = LocalFileSystem.getInstance().refreshAndFindFileByPath(root);
if (vRoot != null && OrderRootType.CLASSES.equals(rootType) && !vRoot.isDirectory()) {
final VirtualFile jar = JarFileSystem.getInstance().refreshAndFindFileByPath(root + "!/");
if (jar != null) vRoot = jar;
}
if (vRoot != null) {
