Commits

John Kodumal committed 097818c

Formatting / minor code change

Comments (0)

Files changed (1)

src/main/java/com/atlassian/labs/streams/jira/DeleteIssueListener.java

         if (issueEvent.getEventTypeId().equals(EventType.ISSUE_DELETED_ID))
         {
             User user = issueEvent.getUser();
-            Either<ValidationErrors, Activity> postResult = new Activity.Builder(application("JIRA Deleted Issues", URI.create(applicationProperties.getBaseUrl())),
-                                                     new DateTime(),
-                                                     new UserProfile.Builder(user.getName()).fullName(user.getDisplayName())
-                                                         .build())
-                .content(some(html(issueEvent.getIssue().getDescription())))
-                .title(some(html(user.getDisplayName() + " deleted " + issueEvent.getIssue().getKey() + " - " + issueEvent.getIssue().getSummary())))
-                .url(some(URI.create(applicationProperties.getBaseUrl())))
-                .build();
-            for (Activity activity : postResult.right())
+            Either<ValidationErrors, Activity> result =
+                new Activity.Builder(application("JIRA Deleted Issues", URI.create(applicationProperties.getBaseUrl())),
+                                     new DateTime(),
+                                     new UserProfile.Builder(user.getName()).fullName(user.getDisplayName()).build())
+                    .content(some(html(issueEvent.getIssue().getDescription())))
+                    .title(some(html(user.getDisplayName() + " deleted " + issueEvent.getIssue().getKey() + " - " + issueEvent.getIssue().getSummary())))
+                    .url(some(URI.create(applicationProperties.getBaseUrl())))
+                    .build();
+            for (Activity activity : result.right())
             {
                 activityService.postActivity(activity);
             }
-            for (ValidationErrors errors : postResult.left())
+            for (ValidationErrors errors : result.left())
             {
                 log.error("Errors encountered attempting to post activity: " + errors.toString());
             }