Module (@NotNull String name) { if (myModuleModel == null) return null; final Module moduleByName = myModuleModel.findModuleByName(name); if (moduleByName != null) { return moduleByName; } return myModuleModel.getModuleToBeRenamed(name); //if module was renamed }