Plugins with broken "project-operation" modules can prevent other modules project-operations from being loaded

XMLWordPrintable

      The code in question is the following in com.atlassian.jira.bc.project.projectoperation.DefaultProjectOperationManager:

              for (Iterator iterator = projectOperationDescriptors.iterator(); iterator.hasNext();)
              {
                  final ProjectOperationModuleDescriptor descriptor = (ProjectOperationModuleDescriptor) iterator.next();
                  final PluggableProjectOperation pluggableProjectOperation = (PluggableProjectOperation) descriptor.getModule();
      
                  // if a particular operation dies, we don't want it to take out _all_ operations
                  try
                  {
                      if (pluggableProjectOperation != null && pluggableProjectOperation.showOperation(project, user))
                      {
                          ret.add(pluggableProjectOperation);
                      }
                  }
                  catch (Exception e)
                  {
                      log.error("Error loading project operation " + descriptor.getCompleteKey(), e);
                  }
              }
      

      if the descriptor.getModule() fails for any reason no pluggable project operation will be loaded. I suggest this code:

              for (Iterator iterator = projectOperationDescriptors.iterator(); iterator.hasNext();)
              {
                  final ProjectOperationModuleDescriptor descriptor = (ProjectOperationModuleDescriptor) iterator.next();
      
                  // if a particular operation dies, we don't want it to take out _all_ operations
                  try
                  {
                      final PluggableProjectOperation pluggableProjectOperation = (PluggableProjectOperation) descriptor.getModule();
                      if (pluggableProjectOperation != null && pluggableProjectOperation.showOperation(project, user))
                      {
                          ret.add(pluggableProjectOperation);
                      }
                  }
                  catch (Exception e)
                  {
                      log.error("Error loading project operation " + descriptor.getCompleteKey(), e);
                  }
              }
      

              Assignee:
              ɹǝʞɐq pɐɹq
              Reporter:
              Samuel Le Berrigaud (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified