Source:
<code>private void bindViewHolderToThreadRow(DiscussionThreadViewHolder holder) { holder.authorLayoutViewHolder.populateViewHolder(config, discussionThread, discussionThread, initialTimeStampMs, new Runnable() { @Override public void run() { listener.onClickAuthor(discussionThread.getAuthor()); } }); holder.threadTitleTextView.setText(discussionThread.getTitle()); DiscussionTextUtils.renderHtml(holder.threadBodyTextView, discussionThread.getRenderedBody()); String groupName = discussionThread.getGroupName(); if (groupName == null) { holder.threadVisibilityTextView.setText(R.string.discussion_post_visibility_everyone); } else { holder.threadVisibilityTextView.setText(ResourceUtil.getFormattedString( context.getResources(), R.string.discussion_post_visibility_cohort, "cohort", groupName)); } bindNumberResponsesView(holder.numberResponsesViewHolder); final String loggedInUser = loginPrefs.getUsername(); <START> if (loggedInUser != null && loggedInUser.equals(discussionThread.getAuthor())) { <END> holder.actionsBar.setVisibility(View.GONE); } else { holder.actionsBar.setVisibility(View.VISIBLE); bindSocialView(holder.socialLayoutViewHolder, discussionThread); holder.discussionReportViewHolder.reportLayout.setOnClickListener(new View.OnClickListener() { public void onClick(final View v) { discussionService.setThreadFlagged(discussionThread.getIdentifier(), new FlagBody(!discussionThread.isAbuseFlagged())) .enqueue(new ErrorHandlingCallback<DiscussionThread>( context, CallTrigger.USER_ACTION, (TaskProgressCallback) null) { @Override protected void onResponse(@NonNull final DiscussionThread topicThread) { discussionThread = discussionThread.patchObject(topicThread); notifyItemChanged(0); EventBus.getDefault().post(new DiscussionThreadUpdatedEvent(discussionThread)); } }); } }); holder.discussionReportViewHolder.setReported(discussionThread.isAbuseFlagged()); } }</code><technical_language>Is valid case of values null here? I suppose null check is in response @Nullable annotation getUsername() method, is present called login such. In case I suggest reverse comparison, get rid of unneeded null check. for other sections well</technical_language>

Target:
private void bindViewHolderToThreadRow(DiscussionThreadViewHolder holder) { holder.authorLayoutViewHolder.populateViewHolder(config, discussionThread, discussionThread, initialTimeStampMs, new Runnable() { @Override public void run() { listener.onClickAuthor(discussionThread.getAuthor()); } }); holder.threadTitleTextView.setText(discussionThread.getTitle()); DiscussionTextUtils.renderHtml(holder.threadBodyTextView, discussionThread.getRenderedBody()); String groupName = discussionThread.getGroupName(); if (groupName == null) { holder.threadVisibilityTextView.setText(R.string.discussion_post_visibility_everyone); } else { holder.threadVisibilityTextView.setText(ResourceUtil.getFormattedString( context.getResources(), R.string.discussion_post_visibility_cohort, "cohort", groupName)); } bindNumberResponsesView(holder.numberResponsesViewHolder); if (TextUtils.equals(loginPrefs.getUsername(), discussionThread.getAuthor())) { holder.actionsBar.setVisibility(View.GONE); } else { holder.actionsBar.setVisibility(View.VISIBLE); bindSocialView(holder.socialLayoutViewHolder, discussionThread); holder.discussionReportViewHolder.reportLayout.setOnClickListener(new View.OnClickListener() { public void onClick(final View v) { discussionService.setThreadFlagged(discussionThread.getIdentifier(), new FlagBody(!discussionThread.isAbuseFlagged())) .enqueue(new ErrorHandlingCallback<DiscussionThread>( context, CallTrigger.USER_ACTION, (TaskProgressCallback) null) { @Override protected void onResponse(@NonNull final DiscussionThread topicThread) { discussionThread = discussionThread.patchObject(topicThread); notifyItemChanged(0); EventBus.getDefault().post(new DiscussionThreadUpdatedEvent(discussionThread)); } }); } }); holder.discussionReportViewHolder.setReported(discussionThread.isAbuseFlagged()); } }