InspectionProfileModifiableModel (@NotNull InspectionProfileImpl selectedProfile, @NotNull Project project, @NotNull String newName, boolean modifyLevel) { final boolean isProjectLevel = selectedProfile.isProjectLevel() ^ modifyLevel; BaseInspectionProfileManager profileManager = isProjectLevel ? myProjectProfileManager : myAppProfileManager; InspectionProfileImpl inspectionProfile = new InspectionProfileImpl(newName, InspectionToolRegistrar.getInstance(), profileManager); inspectionProfile.copyFrom(selectedProfile); inspectionProfile.setName(newName); inspectionProfile.initInspectionTools(project); inspectionProfile.setProjectLevel(isProjectLevel); InspectionProfileModifiableModel modifiableModel = new InspectionProfileModifiableModel(inspectionProfile); modifiableModel.setModified(true); return modifiableModel; }