void (@NotNull ModifiableRootModel modifiableRootModel) { if (myRootModel.isSdkInherited()) { modifiableRootModel.inheritSdk(); } else { modifiableRootModel.setSdk(myRootModel.getSdk()); } modifiableRootModel.getModuleExtension(CompilerModuleExtension.class).inheritCompilerOutputPath(true); modifiableRootModel.getModuleExtension(LanguageLevelModuleExtension.class) .setLanguageLevel(LanguageLevelUtil.getCustomLanguageLevel(myRootModel.getModule())); for (OrderEntry entry : myRootModel.getOrderEntries()) { if (entry instanceof JdkOrderEntry) continue; if (entry instanceof ModuleSourceOrderEntry) continue; if (entry instanceof ClonableOrderEntry) { modifiableRootModel.addOrderEntry(((ClonableOrderEntry)entry).cloneEntry(modifiableRootModel, (ProjectRootManagerImpl)ProjectRootManager.getInstance(myProject), VirtualFilePointerManager.getInstance())); } } VirtualFile content = LocalFileSystem.getInstance().findFileByNioFile(myComponentPath); if (content == null) { try { Files.createFile(NioFiles.createParentDirectories(myComponentPath)); } catch (IOException e) { throw new UncheckedIOException(e); } content = LocalFileSystem.getInstance().refreshAndFindFileByNioFile(myComponentPath); } modifiableRootModel.addContentEntry(content); }