Source:
public PageNotificationEventDescriptor getPageNotificationEventDescriptor( DocumentReference documentReference) throws NotificationException { XWikiContext context = contextProvider.get(); XWiki xwiki = context.getWiki(); PageNotificationEventDescriptor newDescriptor = null; final DocumentReference pageNotificationEventDescriptorClass = PAGE_NOTIFICATION_EVENT_DESCRIPTOR_CLASS.setWikiReference(documentReference.getWikiReference()); List<PageNotificationEventDescriptor> eventDescriptors = new ArrayList<>(); try { XWikiDocument doc = xwiki.getDocument(documentReference, context); BaseObject eventDescriptorObj = doc.getXObject(pageNotificationEventDescriptorClass); if (eventDescriptorObj != null) { if (eventDescriptorObj != null) { newDescriptor = new PageNotificationEventDescriptor(ImmutableMap.<String, String>builder() .put(APPLICATION_NAME, eventDescriptorObj.getStringValue(APPLICATION_NAME)) .put(EVENT_TYPE, eventDescriptorObj.getStringValue(EVENT_TYPE)) .put(EVENT_PRETTY_NAME, eventDescriptorObj.getStringValue(EVENT_PRETTY_NAME)) .put(EVENT_ICON, eventDescriptorObj.getStringValue(EVENT_ICON)) .put(OBJECT_TYPE, eventDescriptorObj.getStringValue(OBJECT_TYPE)) .put(VALIDATION_EXPRESSION, eventDescriptorObj.getStringValue(VALIDATION_EXPRESSION)) .put(NOTIFICATION_TEMPLATE, eventDescriptorObj.getStringValue(NOTIFICATION_TEMPLATE)) .build(), eventDescriptorObj.getListValue(LISTEN_TO), doc.getAuthorReference()); } } return newDescriptor; } catch (XWikiException e) { throw new NotificationException( String.format("Failed to get the event descriptors for the user [%s].", documentReference), e); } }

Target:
public PageNotificationEventDescriptor getPageNotificationEventDescriptor( DocumentReference documentReference) throws NotificationException { XWikiContext context = contextProvider.get(); XWiki xwiki = context.getWiki(); PageNotificationEventDescriptor newDescriptor = null; final DocumentReference pageNotificationEventDescriptorClass = PAGE_NOTIFICATION_EVENT_DESCRIPTOR_CLASS.setWikiReference(documentReference.getWikiReference()); List<PageNotificationEventDescriptor> eventDescriptors = new ArrayList<>(); try { XWikiDocument doc = xwiki.getDocument(documentReference, context); BaseObject eventDescriptorObj = doc.getXObject(pageNotificationEventDescriptorClass); if (eventDescriptorObj != null) { newDescriptor = new PageNotificationEventDescriptor(ImmutableMap.<String, String>builder() .put(APPLICATION_NAME, eventDescriptorObj.getStringValue(APPLICATION_NAME)) .put(EVENT_TYPE, eventDescriptorObj.getStringValue(EVENT_TYPE)) .put(EVENT_PRETTY_NAME, eventDescriptorObj.getStringValue(EVENT_PRETTY_NAME)) .put(EVENT_ICON, eventDescriptorObj.getStringValue(EVENT_ICON)) .put(OBJECT_TYPE, eventDescriptorObj.getStringValue(OBJECT_TYPE)) .put(VALIDATION_EXPRESSION, eventDescriptorObj.getStringValue(VALIDATION_EXPRESSION)) .put(NOTIFICATION_TEMPLATE, eventDescriptorObj.getStringValue(NOTIFICATION_TEMPLATE)) .build(), eventDescriptorObj.getListValue(LISTEN_TO), doc.getAuthorReference()); } return newDescriptor; } catch (XWikiException e) { throw new NotificationException( String.format("Failed to get the event descriptors for the user [%s].", documentReference), e); } }