Buggy code:
public class ActivityServiceImpl extends AbstractRegistrableService implements ActivityService { private static final Logger logger = LoggerFactory . getLogger ( ActivityServiceImpl . class ) ; protected static final int MAX_LEN_USER_ID = 255 ; protected static final int MAX_LEN_SITE_ID = 255 ; protected static final int MAX_LEN_ACTIVITY_TYPE = 255 ; protected static final int MAX_LEN_ACTIVITY_DATA = 4000 ; protected static final int MAX_LEN_APP_TOOL_ID = 36 ; protected static final String ACTIVITY_PROP_ACTIVITY_SUMMARY = "activitySummary" ; protected static final String ACTIVITY_PROP_ID = "id" ; protected static final String ACTIVITY_PROP_POST_DATE = "postDate" ; protected static final String ACTIVITY_PROP_USER = "user" ; protected static final String ACTIVITY_PROP_FEEDUSER = "feedUserId" ; protected static final String ACTIVITY_PROP_CONTENTID = "contentId" ; protected static final String ACTIVITY_FEED_FORMAT = "json" ; @ Override public void register ( ) { } public void postActivity ( String site , String user , String contentId , ActivityType activity , Map < String , String > extraInfo ) { } private void postActivity ( String activityType , String siteNetwork , String appTool , String activityData , String contentId , String contentType ) { } private long postFeedEntry ( ActivityFeed activityFeed ) { } private int getCountUserContentFeedEntries ( String feedUserId , String siteId , String contentId ) { } private long insertFeedEntry ( ActivityFeed activityFeed ) { } private void updateFeedEntry ( ActivityFeed activityFeed ) { } @ Override public void renameContentId ( String oldUrl , String newUrl , String site ) { } @ Override public List < ContentItemTO > getActivities ( String site , String user , int num , String sort , boolean ascending , boolean excludeLive , String filterType ) throws ServiceException { } protected boolean getActivityFeeds ( String user , String site , int startPos , int size , String filterType , boolean hideLiveItems , List < ContentItemTO > contentItems , int remainingItem ) { } protected ContentItemTO createActivityItem ( String site , JSONObject feedObject , String id ) { try { <START_BUG> ContentItemTO item = contentService . getContentItem ( site , id ) ; <END_BUG> if ( item == null ) { item = contentService . createDummyDmContentItemForDeletedNode ( site , id ) ; String modifier = ( feedObject . containsKey ( ActivityServiceImpl . ACTIVITY_PROP_FEEDUSER ) ) ? feedObject . getString ( ActivityServiceImpl . ACTIVITY_PROP_FEEDUSER ) : "" ; if ( ( modifier != null ) && ( ! ( modifier . isEmpty ( ) ) ) ) { item . user = modifier ; } String activitySummary = ( feedObject . containsKey ( ActivityServiceImpl . ACTIVITY_PROP_ACTIVITY_SUMMARY ) ) ? feedObject . getString ( ActivityServiceImpl . ACTIVITY_PROP_ACTIVITY_SUMMARY ) : "" ; JSONObject summaryObject = JSONObject . fromObject ( activitySummary ) ; if ( summaryObject . containsKey ( CONTENT_TYPE ) ) { String contentType = ( ( String ) ( summaryObject . get ( CONTENT_TYPE ) ) ) ; item . contentType = contentType ; } if ( summaryObject . containsKey ( INTERNAL_NAME ) ) { String internalName = ( ( String ) ( summaryObject . get ( INTERNAL_NAME ) ) ) ; item . internalName = internalName ; } if ( summaryObject . containsKey ( BROWSER_URI ) ) { String browserUri = ( ( String ) ( summaryObject . get ( BROWSER_URI ) ) ) ; item . browserUri = browserUri ; } } String postDate = ( feedObject . containsKey ( ActivityServiceImpl . ACTIVITY_PROP_POST_DATE ) ) ? feedObject . getString ( ActivityServiceImpl . ACTIVITY_PROP_POST_DATE ) : "" ; Date editedDate = ContentUtils . getEditedDate ( postDate ) ; item . eventDate = editedDate ; return item ; } catch ( Exception e ) { ActivityServiceImpl . logger . error ( ( ( "Error<seq2seq4repair_space>fetching<seq2seq4repair_space>content<seq2seq4repair_space>item<seq2seq4repair_space>for<seq2seq4repair_space>[" + id ) + "]" ) , e . getMessage ( ) ) ; return null ; } } private List < ActivityFeed > selectUserFeedEntries ( String feedUserId , String format , String siteId , int startPos , int feedSize , String contentType , boolean hideLiveItems ) { } @ Override public ActivityFeed getDeletedActivity ( String site , String path ) { } @ Autowired protected ActivityFeedMapper activityFeedMapper ; protected boolean userNamesAreCaseSensitive = false ; protected ContentService contentService ; public void setUserNamesAreCaseSensitive ( boolean userNamesAreCaseSensitive ) { } public void setContentService ( ContentService contentService ) { } protected SecurityService securityService ; public SecurityService getSecurityService ( ) { } public void setSecurityService ( SecurityService securityService ) { } }

Fix:
ContentItemTO item = contentService . getContentItem ( site , id , 0 ) ;