Promise<Void> (@NotNull Module module, @NotNull LanguageLevel languageLevel, boolean modifySource) { if (modifySource) { for (JavaProjectModelModifier modifier : getModelModifiers()) { Promise<Void> promise = modifier.changeLanguageLevel(module, languageLevel); if (promise != null) { return promise; } } } else { final LanguageLevel moduleLevel = LanguageLevelUtil.getCustomLanguageLevel(module); if (moduleLevel != null && JavaSdkUtil.isLanguageLevelAcceptable(myProject, module, languageLevel)) { final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); rootModel.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(languageLevel); rootModel.commit(); } else { LanguageLevelProjectExtension.getInstance(myProject).setLanguageLevel(languageLevel); ProjectRootManagerEx.getInstanceEx(myProject).makeRootsChange(EmptyRunnable.INSTANCE, RootsChangeRescanningInfo.TOTAL_RESCAN); } return Promises.resolvedPromise(null); } return Promises.rejectedPromise(); }