Buggy code:
public boolean getMRUVisible ( ) { } public CTabFolderRenderer getRenderer ( ) { } int getRightItemEdge ( GC gc ) { } public CTabItem getSelection ( ) { } public Color getSelectionBackground ( ) { } public Color getSelectionForeground ( ) { } public int getSelectionIndex ( ) { } public boolean getSimple ( ) { } public boolean getSingle ( ) { } public int getStyle ( ) { } public int getTabHeight ( ) { } public int getTabPosition ( ) { } public Control getTopRight ( ) { } public int getTopRightAlignment ( ) { } public boolean getUnselectedCloseVisible ( ) { } public boolean getUnselectedImageVisible ( ) { } public int indexOf ( CTabItem item ) { } void initAccessible ( ) { } void onKeyDown ( Event event ) { } void onDispose ( Event event ) { } void onDragDetect ( Event event ) { } void onFocus ( Event event ) { } boolean onMnemonic ( Event event , boolean doit ) { } void onMouseDoubleClick ( Event event ) { } void onMouse ( Event event ) { } void onPageTraversal ( Event event ) { } void onPaint ( Event event ) { } void onResize ( ) { } void onTraverse ( Event event ) { } void redrawTabs ( ) { } public void removeCTabFolder2Listener ( CTabFolder2Listener listener ) { } public void removeCTabFolderListener ( CTabFolderListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void reskin ( int flags ) { } public void setBackground ( Color color ) { } public void setBackground ( Color [ ] colors , int [ ] percents ) { } public void setBackground ( Color [ ] colors , int [ ] percents , boolean vertical ) { } public void setBackgroundImage ( Image image ) { } public void setBorderVisible ( boolean show ) { } void setButtonBounds ( GC gc ) { } public void setFont ( Font font ) { } public void setForeground ( Color color ) { } public void setInsertMark ( CTabItem item , boolean after ) { } public void setInsertMark ( int index , boolean after ) { } boolean setItemLocation ( GC gc ) { } boolean setItemSize ( GC gc ) { boolean changed = false ; if ( isDisposed ( ) ) return changed ; Point size = getSize ( ) ; if ( ( ( size . x ) <= 0 ) || ( ( size . y ) <= 0 ) ) return changed ; Rectangle trim = renderer . computeTrim ( PART_HEADER , NONE , 0 , 0 , 0 , 0 ) ; int borderRight = ( trim . width ) + ( trim . x ) ; int borderLeft = - ( trim . x ) ; showChevron = false ; if ( single ) { showChevron = true ; if ( ( selectedIndex ) != ( - 1 ) ) { CTabItem tab = items [ selectedIndex ] ; int width = renderer . computeSize ( selectedIndex , SELECTED , gc , DEFAULT , DEFAULT ) . x ; width = Math . min ( width , ( ( getRightItemEdge ( gc ) ) - borderLeft ) ) ; if ( ( ( tab . height ) != ( tabHeight ) ) || ( ( tab . width ) != width ) ) { changed = true ; tab . shortenedText = null ; tab . shortenedTextWidth = 0 ; tab . height = tabHeight ; tab . width = width ; tab . closeRect . width = tab . closeRect . height = 0 ; if ( ( showClose ) || ( tab . showClose ) ) { <START_BUG> Point closeSize = renderer . computeSize ( selectedIndex , SELECTED , gc , DEFAULT , DEFAULT ) ; <END_BUG> tab . closeRect . width = closeSize . x ; tab . closeRect . height = closeSize . y ; } } } return changed ; } if ( ( items . length ) == 0 ) return changed ; int [ ] widths ; int tabAreaWidth = ( ( ( size . x ) - borderLeft ) - borderRight ) - 3 ; if ( showMin ) tabAreaWidth -= renderer . computeSize ( PART_MIN_BUTTON , NONE , gc , DEFAULT , DEFAULT ) . x ; if ( showMax ) tabAreaWidth -= renderer . computeSize ( PART_MAX_BUTTON , NONE , gc , DEFAULT , DEFAULT ) . x ; if ( ( ( topRightAlignment ) == ( SWT . RIGHT ) ) && ( ( topRight ) != null ) ) { Point rightSize = topRight . computeSize ( DEFAULT , DEFAULT , false ) ; tabAreaWidth -= ( rightSize . x ) + 3 ; } tabAreaWidth = Math . max ( 0 , tabAreaWidth ) ; int minWidth = 0 ; int [ ] minWidths = new int [ items . length ] ; for ( int i = 0 ; i < ( priority . length ) ; i ++ ) { int index = priority [ i ] ; int state = CTabFolderRenderer . MINIMUM_SIZE ; if ( index == ( selectedIndex ) ) state |= SWT . SELECTED ; minWidths [ index ] = renderer . computeSize ( index , state , gc , DEFAULT , DEFAULT ) . x ; minWidth += minWidths [ index ] ; if ( minWidth > tabAreaWidth ) break ; } if ( minWidth > tabAreaWidth ) { showChevron = ( items . length ) > 1 ; if ( showChevron ) tabAreaWidth -= renderer . computeSize ( PART_CHEVRON_BUTTON , NONE , gc , DEFAULT , DEFAULT ) . x ; widths = minWidths ; int index = ( ( selectedIndex ) != ( - 1 ) ) ? selectedIndex : 0 ;

Fix:
Point closeSize = renderer . computeSize ( PART_CLOSE_BUTTON , SELECTED , gc , DEFAULT , DEFAULT ) ;