Source:
<code>private void setupSessionTagsTextBox() { stopTypingSessionTagsTimer = new Timer() { @Override public void run() { String generalContent = sessionTagsTextBox.getText().trim(); <START> if (generalContent == null || generalContent.isEmpty()) { <END> sessionDataProvider.addDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionTagsAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); return; } if (generalContent.contains(",") || generalContent.contains(";") || generalContent.contains("/")) { tagNames.addAll(Arrays.asList(generalContent.split("\\s*[,;/]\\s*"))); } else { tagNames.add(generalContent); } sessionDataForSessionTagsAsyncProvider.setTagNames(tagNames); sessionDataProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForDatePeriodAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionIdsAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionTagsAsyncProvider.addDataDisplayIfNotExists(sessionsDataGrid); } }; sessionTagsTextBox.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { sessionsTo.setValue(null, true); sessionsFrom.setValue(null,true); sessionIdsTextBox.setValue(null, true); tagNames.clear(); stopTypingSessionTagsTimer.schedule(500); } }); tagFilterBox.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) { sessionsTo.setValue(null, true); sessionsFrom.setValue(null, true); sessionIdsTextBox.setValue(null, true); if (!tagNames.isEmpty()) sessionTagsTextBox.setValue(toParsableString(tagNames)); tagNames.clear(); stopTypingSessionTagsTimer.schedule(500); } }); }</code><technical_language>do compare generalContent null? is unnecessary in this case, get NPE in sessionTagsTextBox.getText().trim()</technical_language>

Target:
private void setupSessionTagsTextBox() { stopTypingSessionTagsTimer = new Timer() { @Override public void run() { final String generalContent = sessionTagsTextBox.getText().trim(); if (generalContent.isEmpty()) { sessionDataProvider.addDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionTagsAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); return; } if (generalContent.contains(",") || generalContent.contains(";") || generalContent.contains("/")) { tagNames.addAll(Arrays.asList(generalContent.split("\\s*[,;/]\\s*"))); } else { tagNames.add(generalContent); } sessionDataForSessionTagsAsyncProvider.setTagNames(tagNames); sessionDataProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForDatePeriodAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionIdsAsyncProvider.removeDataDisplayIfNotExists(sessionsDataGrid); sessionDataForSessionTagsAsyncProvider.addDataDisplayIfNotExists(sessionsDataGrid); } }; sessionTagsTextBox.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { sessionsTo.setValue(null, true); sessionsFrom.setValue(null,true); sessionIdsTextBox.setValue(null, true); tagNames.clear(); stopTypingSessionTagsTimer.schedule(500); } }); tagFilterBox.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) { sessionsTo.setValue(null, true); sessionsFrom.setValue(null, true); sessionIdsTextBox.setValue(null, true); if (!tagNames.isEmpty()) sessionTagsTextBox.setValue(toParsableString(tagNames)); tagNames.clear(); stopTypingSessionTagsTimer.schedule(500); } }); }