Buggy code:
public abstract class FilteringInfoPopup extends PopupDialog implements DisposeListener { protected class NamePatternFilter extends ViewerFilter { public NamePatternFilter ( ) { } public boolean select ( Viewer viewer , Object parentElement , Object element ) { } private boolean hasUnfilteredChild ( TreeViewer viewer , Object element ) { } } private Text filterText ; private TreeViewer treeViewer ; private Composite viewMenuButtonComposite ; private int treeStyle ; private StringMatcher matcher ; public FilteringInfoPopup ( Shell parent , int shellStyle , int treeStyle , boolean showStatusField ) { } protected boolean isMatchable ( Object element ) { } protected Control createDialogArea ( Composite parent ) { } public FilteringInfoPopup ( Shell parent , int shellStyle , int treeStyle ) { } protected abstract TreeViewer createTreeViewer ( Composite parent , int style ) { } protected abstract String getId ( ) { } protected Control getFocusControl ( ) { } protected TreeViewer getTreeViewer ( ) { } protected boolean hasHeader ( ) { } protected Text getFilterText ( ) { } protected Text createFilterText ( Composite parent ) { } protected void createHorizontalSeparator ( Composite parent ) { } protected void updateStatusFieldText ( ) { } protected void handleStatusFieldClicked ( ) { } protected String getStatusFieldText ( ) { } private void installFilter ( ) { } protected void stringMatcherUpdated ( ) { } protected void setMatcherString ( String pattern , boolean update ) { } protected StringMatcher getMatcher ( ) { } protected Object getSelectedElement ( ) { } protected abstract void handleElementSelected ( Object selectedElement ) { } protected void selectFirstMatch ( ) { } private Object findElement ( TreeItem [ ] items ) { for ( int i = 0 ; i < ( items . length ) ; i ++ ) { Object element = items [ i ] . getData ( ) ; if ( ( matcher ) == null ) return element ; TreeItem parentItem = items [ i ] . getParentItem ( ) ; Object parentElement = null ; if ( parentItem != null ) { parentElement = parentItem . getData ( ) ; } <START_BUG> if ( element != null ) { <END_BUG> String [ ] label = getMatchNames ( element , parentElement ) ; for ( int j = 0 ; j < ( label . length ) ; j ++ ) { if ( matcher . match ( label [ j ] ) ) return element ; } } element = findElement ( items [ i ] . getItems ( ) ) ; if ( element != null ) return element ; } return null ; } public void setInformation ( String information ) { } public abstract void setInput ( Object information ) { } protected void inputChanged ( Object newInput , Object newSelection ) { } public void setVisible ( boolean visible ) { } public final void dispose ( ) { } public void widgetDisposed ( DisposeEvent event ) { } public boolean hasContents ( ) { } public void setSizeConstraints ( int maxWidth , int maxHeight ) { } public Point computeSizeHint ( ) { } public void setLocation ( Point location ) { } public void setSize ( int width , int height ) { } public void addDisposeListener ( DisposeListener listener ) { } public void removeDisposeListener ( DisposeListener listener ) { } public void setForegroundColor ( Color foreground ) { } public void setBackgroundColor ( Color background ) { } public boolean isFocusControl ( ) { } public void setFocus ( ) { } public void addFocusListener ( FocusListener listener ) { } public void removeFocusListener ( FocusListener listener ) { } protected Control createTitleMenuArea ( Composite parent ) { } protected Control createTitleControl ( Composite parent ) { } protected void setTabOrder ( Composite composite ) { } protected String [ ] getMatchNames ( Object element , Object parentElementOrNull ) { } }

Fix:
if ( ( element != null ) && ( isMatchable ( element ) ) ) {