Buggy code:
void createColumn ( TreeItem item , int index ) { } void createHandle ( ) { } void createItem ( TreeColumn column , int index ) { } void createItem ( TreeItem item , TreeItem parentItem , int index ) { } void createWidget ( ) { } Color defaultBackground ( ) { } NSFont defaultNSFont ( ) { } Color defaultForeground ( ) { } public void deselectAll ( ) { } void deregister ( ) { } public void deselect ( TreeItem item ) { } void destroyItem ( TreeColumn column ) { } void destroyItem ( TreeItem item ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } void drawInteriorWithFrame_inView ( int id , int sel , int cellFrame , int view ) { } int getCheckColumnWidth ( ) { } TreeColumn getColumn ( id id ) { } public TreeColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TreeColumn [ ] getColumns ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } public TreeItem getItem ( int index ) { } public TreeItem getItem ( Point point ) { } public int getItemCount ( ) { } int getItemCount ( TreeItem item ) { } public int getItemHeight ( ) { } public TreeItem [ ] getItems ( ) { } public boolean getLinesVisible ( ) { } public TreeItem getParentItem ( ) { } public TreeItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public TreeColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public TreeItem getTopItem ( ) { } void highlightSelectionInClipRect ( int id , int sel , int rect ) { } public int indexOf ( TreeColumn column ) { } public int indexOf ( TreeItem item ) { } boolean isTrim ( NSView view ) { } int menuForEvent ( int id , int sel , int theEvent ) { } int outlineView_child_ofItem ( int id , int sel , int outlineView , int index , int itemID ) { } void outlineView_didClickTableColumn ( int id , int sel , int outlineView , int tableColumn ) { } int outlineView_objectValueForTableColumn_byItem ( int id , int sel , int outlineView , int tableColumn , int itemID ) { } boolean outlineView_isItemExpandable ( int id , int sel , int outlineView , int item ) { } int outlineView_numberOfChildrenOfItem ( int id , int sel , int outlineView , int item ) { } void outlineView_willDisplayCell_forTableColumn_item ( int id , int sel , int outlineView , int cell , int tableColumn , int itemID ) { } void outlineViewColumnDidMove ( int id , int sel , int aNotification ) { } void outlineViewColumnDidResize ( int id , int sel , int aNotification ) { } void outlineViewItemDidExpand ( int id , int sel , int notification ) { } void outlineViewSelectionDidChange ( int id , int sel , int notification ) { } boolean outlineView_shouldCollapseItem ( int id , int sel , int outlineView , int itemID ) { } boolean outlineView_shouldExpandItem ( int id , int sel , int outlineView , int itemID ) { } void outlineView_setObjectValue_forTableColumn_byItem ( int id , int sel , int outlineView , int object , int tableColumn , int itemID ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void reloadItem ( TreeItem item , boolean recurse ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeTreeListener ( TreeListener listener ) { } public void setInsertMark ( TreeItem item , boolean before ) { } public void selectAll ( ) { } public void select ( TreeItem item ) { } void sendDoubleSelection ( ) { } boolean sendKeyEvent ( NSEvent nsEvent , int type ) { } void setBackground ( float [ ] color ) { } public void setColumnOrder ( int [ ] order ) { } void setFont ( NSFont font ) { } public void setHeaderVisible ( boolean show ) { } public void setItemCount ( int count ) { } void setItemCount ( TreeItem parentItem , int count ) { } void setItemHeight ( int itemHeight ) { } void setItemHeight ( Image image , NSFont font , boolean set ) { } public void setLinesVisible ( boolean show ) { } public void setRedraw ( boolean redraw ) { } boolean setScrollWidth ( ) { } boolean setScrollWidth ( boolean set , TreeItem [ ] items , boolean recurse ) { } boolean setScrollWidth ( TreeItem item ) { } public void setSelection ( TreeItem item ) { } public void setSelection ( TreeItem [ ] items ) { } void setSmallSize ( ) { } public void setSortColumn ( TreeColumn column ) { } public void setSortDirection ( int direction ) { } public void setTopItem ( TreeItem item ) { } public void showColumn ( TreeColumn column ) { } public void showItem ( TreeItem item ) { } void showItem ( TreeItem item , boolean scroll ) { TreeItem parentItem = item . parentItem ; <START_BUG> if ( ( parentItem != null ) && ( ! ( parentItem . expanded ) ) ) { <END_BUG> showItem ( parentItem , false ) ; parentItem . setExpanded ( true ) ; } if ( scroll ) { NSOutlineView outlineView = ( ( NSOutlineView ) ( view ) ) ; outlineView . scrollRowToVisible ( outlineView . rowForItem ( item . handle ) ) ; } } public void showSelection ( ) { } }

Fix:
if ( parentItem != null ) {