Buggy code:
public abstract class AbstractSearchView < T extends ResourceSearchResultDo > extends BaseViewWithHandlers < SearchUiHandlers > implements ClickHandler , IsSearchView < T > { private static AbstractSearchView . AbstractSearchViewUiBinder uiBinder = GWT . create ( AbstractSearchView . AbstractSearchViewUiBinder . class ) ; private static MessageProperties i18n = GWT . create ( MessageProperties . class ) ; interface AbstractSearchViewUiBinder extends UiBinder < Widget , AbstractSearchView < ? > > { } @ UiField ( provided = true ) SearchFilterVc searchFilterVc ; @ UiField ( provided = true ) AppMirageDragContainer searchResultPanel ; @ UiField FlowPanel paginationFocPanel ; @ UiField ScrollPanel searchFilterPanel ; @ UiField AbstractSearchView . Style style ; @ UiField HTML queriedTextHtml ; @ UiField FlowPanel standardsConatiner ; @ UiField HTMLPanel spellerrorqueriedTextHtml ; @ UiField HTMLPanel correctSpellHTML ; @ UiField Button resourceSearchBtn ; @ UiField Button collectionSearchBtn ; @ UiField Label wrongQueryText ; @ UiField Label correctQueryText ; String grades ; String stdCode ; String subjects ; String categories ; String oerTag ; String mobileFirendlyTag ; String ratingTag ; String publisher ; String aggregator ; String accessMode ; String author ; String reviewTag ; protected ResourceDragController dragController ; private static final String PREVIOUS = AbstractSearchView . i18n . GL1462 ( ) . toUpperCase ( ) ; private static final String NEXT = AbstractSearchView . i18n . GL1463 ( ) . toUpperCase ( ) ; protected final List < FolderDo > SHELF_COLLECTIONS = new ArrayList < FolderDo > ( ) ; public boolean refreshShelfInfo ; public boolean refreshedShelfCollections ; String rootWebUrl = AppClientFactory . getPlaceManager ( ) . getCurrentPlaceRequest ( ) . getNameToken ( ) ; private HandlerRegistration handlerRegistration = null ; public interface Style extends CssResource { String resourceBtnActive ( ) { } String collectionBtnActive ( ) { } String secondaryResourceSearchBtn ( ) { } String secondaryCollectionSearchBtn ( ) { } } public AbstractSearchView ( boolean resourceSearch ) { } @ Override public void preSearch ( SearchDo < T > searchDo ) { } @ Override public void postSearch ( SearchDo < T > searchDo ) { } @ Override public void reset ( ) { } public SearchFilterVc getSearchFilterVc ( ) { } @ Override public void setSearchFilter ( SearchFilterDo searchFilterDo ) { } @ Override public Map < String , String > getSearchFilters ( ) { } public abstract IsDraggable renderSearchResult ( T searchDo ) { } @ Override public void onClick ( ClickEvent event ) { } public AppMirageDragContainer getSearchResultPanel ( ) { } @ Override public void setSourceSuggestions ( SearchDo < String > sourceSuggestions ) { } @ Override public void setAggregatorSuggestions ( SearchDo < String > aggregatorSuggestions ) { } @ Override public void setStandardsSuggestions ( SearchDo < CodeDo > standardsSuggestions ) { } @ Override public void registerDropController ( ResourceDropController dropController , RegisterSearchDropEvent . DROP_AREA type ) { } @ Override public void unregisterDropController ( ResourceDropController dropController , RegisterSearchDropEvent . DROP_AREA type ) { } @ Override public void onUnload ( ) { } @ Override public void setShelfCollections ( List < FolderDo > shelfCollections ) { } protected abstract void refreshShelfCollections ( List < FolderDo > shelfCollections ) { } @ Override public void setStandardsSuggestionsInfo ( SearchDo < CodeDo > result ) { } @ Override public void resetFilters ( ) { } public Button getBrowseBtn ( ) { } public void OnStandardsClickEvent ( Button standardsButtonClicked ) { } public void setUpdatedStandards ( String standardsCode ) { } @ Override public String getSearchText ( ) { } @ UiHandler ( "resourceSearchBtn" ) public void onResourceSearchButtonClicked ( ClickEvent clickEvent ) { } @ UiHandler ( "collectionSearchBtn" ) public void onCollectionSearchBtnClicked ( ClickEvent clickEvent ) { } private void showSubjectsFilter ( ) { } private void showCategoryFilter ( ) { } private void showGradesFilter ( ) { } private void showStandardsFilter ( ) { } private void showPublisherFilter ( ) { } private void showAggregatorFilter ( ) { } private void showAccessModeFilter ( ) { } private void showAuthorFilter ( ) { } private void showReviewFilter ( ) { } protected CloseLabelSetting createTagsLabel ( final String filterValue , final String panelName ) { return new CloseLabelSetting ( filterValue ) { @ Override public void onCloseLabelClick ( ClickEvent event ) { String newFilterVal = filterValue ; <START_BUG> if ( ( ( panelName != null ) && ( panelName . equalsIgnoreCase ( "categoryPanel" ) ) ) && ( ! ( newFilterVal . equalsIgnoreCase ( "Audio" ) ) ) ) { <END_BUG> newFilterVal = newFilterVal . substring ( 0 , ( ( newFilterVal . length ( ) ) - 1 ) ) ; } if ( filterValue . contains ( "Grade<seq2seq4repair_space>" ) ) { newFilterVal = filterValue . replaceAll ( "Grade<seq2seq4repair_space>" , "" ) ; } else if ( filterValue . contains ( "Higher<seq2seq4repair_space>Ed" ) ) { newFilterVal = filterValue . replaceAll ( "Higher<seq2seq4repair_space>Ed" , "12gte" ) ; } AppClientFactory . fireEvent ( new SearchFilterEvent ( newFilterVal , panelName ) ) ; } } ; } private void showOERFilter ( ) { } private void showMobileFriendlyFilter ( ) { } private void showRatingsFilter ( ) { } public abstract void setAddResourceContainerPresenter ( AddResourceContainerPresenter addResourceContainerPresenter ) { } }

Fix:
if ( ( ( ( panelName != null ) && ( panelName . equalsIgnoreCase ( "categoryPanel" ) ) ) && ( ! ( newFilterVal . equalsIgnoreCase ( "Audio" ) ) ) ) && ( ! ( newFilterVal . equalsIgnoreCase ( "Webpage" ) ) ) ) {