Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-5118

Trying to Add Content to a Review which has a reviewer who was deleted, causes an NullPointerException.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.4.0
    • None
    • None
    • None

    Description

      Recipe to reproduce:

      1. Create a review, and add a user
      2. Remove the user from Crucible via the User Admin
      3. View the Review
      4. Click: Edit Details
      5. Click: Add Content
      6. Get this NPE
         Caused by: java.lang.NullPointerException
                at com.cenqua.crucible.model.managers.LogManager$Builder.entityId(LogManager.java:534)
                at com.cenqua.crucible.model.managers.LogManager.logReviewReviewerAdd(LogManager.java:323)
                at com.atlassian.crucible.actions.create.EditReviewDetailsAction.execute(EditReviewDetailsAction.java:352)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358)
        

      TODO:

      1. Why is an EditReviewDetailsAction triggering a com.cenqua.crucible.model.managers.LogManager.logReviewReviewerAdd method call, when no new reviewers are added to the review ?
      2. The bug lies in the logic here:
                            if (projectManager.isAllowedReviewer(project, user)) {
                                if (!newParticipants.containsKey(user)) {
                                    newParticipants.put(user,
                                                        new ReviewParticipant.ParticipantsRoles(user, true, false, false));
                                }
        
                                updated = true;
                                LogManager.logReviewReviewerAdd(review, getCurrentUser(), user,
                                        review.getState().isReviewState());
        
        

      This was introduced here: https://fisheye.dev.internal.atlassian.com/changelog/FE-hg?cs=838f12aea28b8d878394806681768a74a9f323af with the refactor to use: getActiveUser over getUserById. activeUser returns null if the username is not found or not active.

      Then the reviewers set allows null, and must contain a null user.... hence the contains method, returns null.

      Attachments

        Activity

          People

            tom@atlassian.com Tom Davies
            npellow Nick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: