Buggy code:
public class Label extends Control { String text = "" ; Image image ; static final int MARGIN = 4 ; static final boolean IMAGE_AND_TEXT = false ; static final int LabelProc ; static final TCHAR LabelClass = new TCHAR ( 0 , "STATIC" , true ) ; public Label ( Composite parent , int style ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseWidget ( ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } int widgetExtStyle ( ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_UPDATEUISTATE ( int wParam , int lParam ) { } LRESULT wmColorChild ( int wParam , int lParam ) { } LRESULT WM_PAINT ( int wParam , int lParam ) { } LRESULT wmDrawChild ( int wParam , int lParam ) { DRAWITEMSTRUCT struct = new DRAWITEMSTRUCT ( ) ; OS . MoveMemory ( struct , lParam , sizeof ) ; drawBackground ( struct . hDC ) ; if ( ( ( style ) & ( SWT . SEPARATOR ) ) != 0 ) { if ( ( ( style ) & ( SWT . SHADOW_NONE ) ) != 0 ) return null ; RECT rect = new RECT ( ) ; int lineWidth = OS . GetSystemMetrics ( SM_CXBORDER ) ; int flags = ( ( ( style ) & ( SWT . SHADOW_IN ) ) != 0 ) ? OS . EDGE_SUNKEN : OS . EDGE_ETCHED ; if ( ( ( style ) & ( SWT . HORIZONTAL ) ) != 0 ) { int bottom = ( struct . top ) + ( Math . max ( ( lineWidth * 2 ) , ( ( ( struct . bottom ) - ( struct . top ) ) // 2 ) ) ) ; OS . SetRect ( rect , struct . left , struct . top , struct . right , bottom ) ; OS . DrawEdge ( struct . hDC , rect , flags , BF_BOTTOM ) ; } else { int right = ( struct . left ) + ( Math . max ( ( lineWidth * 2 ) , ( ( ( struct . right ) - ( struct . left ) ) // 2 ) ) ) ; OS . SetRect ( rect , struct . left , struct . top , right , struct . bottom ) ; OS . DrawEdge ( struct . hDC , rect , flags , BF_RIGHT ) ; } } else { int width = ( struct . right ) - ( struct . left ) ; int height = ( struct . bottom ) - ( struct . top ) ; if ( ( width != 0 ) && ( height != 0 ) ) { boolean drawImage = ( image ) != null ; <START_BUG> boolean drawText = ( Label . IMAGE_AND_TEXT ) && ( ( text . length ( ) ) != 0 ) ; <END_BUG> int margin = ( drawText && drawImage ) ? Label . MARGIN : 0 ; int imageWidth = 0 ; int imageHeight = 0 ; if ( drawImage ) { Rectangle rect = image . getBounds ( ) ; imageWidth = rect . width ; imageHeight = rect . height ; } RECT rect = null ; TCHAR buffer = null ; int textWidth = 0 ; int textHeight = 0 ; int flags = 0 ; if ( drawText ) { rect = new RECT ( ) ; flags = ( ( OS . DT_CALCRECT ) | ( OS . DT_EDITCONTROL ) ) | ( OS . DT_EXPANDTABS ) ; if ( ( ( style ) & ( SWT . LEFT ) ) != 0 ) flags |= OS . DT_LEFT ; if ( ( ( style ) & ( SWT . CENTER ) ) != 0 ) flags |= OS . DT_CENTER ; if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) flags |= OS . DT_RIGHT ; if ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) { flags |= OS . DT_WORDBREAK ; rect . right = Math . max ( 0 , ( ( width - imageWidth ) - margin ) ) ; } buffer = new TCHAR ( getCodePage ( ) , text , true ) ; OS . DrawText ( struct . hDC , buffer , ( - 1 ) , rect , flags ) ; textWidth = ( rect . right ) - ( rect . left ) ; textHeight = ( rect . bottom ) - ( rect . top ) ; } int x = 0 ; if ( ( ( style ) & ( SWT . CENTER ) ) != 0 ) { x = Math . max ( 0 , ( ( ( ( width - imageWidth ) - textWidth ) - margin ) // 2 ) ) ; } else { if ( ( ( style ) & ( SWT . RIGHT ) ) != 0 ) { x = ( ( width - imageWidth ) - textWidth ) - margin ; }

Fix:
boolean drawText = Label . IMAGE_AND_TEXT ;