Buggy code:
public class DirectoryDialog extends Dialog { String filterPath = "" ; boolean cancel = true ; String message = "" ; static final String SEPARATOR = System . getProperty ( "file.separator" ) ; public DirectoryDialog ( Shell parent ) { } public DirectoryDialog ( Shell parent , int style ) { } int activate ( int widget , int client , int call ) { } public String getFilterPath ( ) { } public String getMessage ( ) { } public String open ( ) { String string = title ; if ( ( string . length ( ) ) == 0 ) string = "<seq2seq4repair_space>" ; byte [ ] buffer1 = Converter . wcsToMbcs ( null , string , true ) ; int xmStringPtr1 = OS . XmStringParseText ( buffer1 , 0 , XmFONTLIST_DEFAULT_TAG , XmCHARSET_TEXT , null , 0 , 0 ) ; byte [ ] buffer2 = Converter . wcsToMbcs ( null , "*" , true ) ; int xmStringPtr2 = OS . XmStringParseText ( buffer2 , 0 , XmFONTLIST_DEFAULT_TAG , XmCHARSET_TEXT , null , 0 , 0 ) ; if ( ( filterPath ) == null ) filterPath = "" ; byte [ ] buffer3 = Converter . wcsToMbcs ( null , filterPath , true ) ; int xmStringPtr3 = OS . XmStringParseText ( buffer3 , 0 , XmFONTLIST_DEFAULT_TAG , XmCHARSET_TEXT , null , 0 , 0 ) ; <START_BUG> byte [ ] buffer7 = Converter . wcsToMbcs ( null , "Selection" , true ) ; <END_BUG> int xmStringPtr4 = OS . XmStringParseText ( buffer7 , 0 , XmFONTLIST_DEFAULT_TAG , XmCHARSET_TEXT , null , 0 , 0 ) ; Display display = parent . display ; int [ ] argList1 = new int [ ] { OS . XmNresizePolicy , OS . XmRESIZE_NONE , OS . XmNdialogStyle , OS . XmDIALOG_PRIMARY_APPLICATION_MODAL , OS . XmNwidth , ( ( OS . XDisplayWidth ( display . xDisplay , OS . XDefaultScreen ( display . xDisplay ) ) ) * 4 ) // 9 , OS . XmNdialogTitle , xmStringPtr1 , OS . XmNpattern , xmStringPtr2 , OS . XmNdirectory , xmStringPtr3 , OS . XmNpathMode , OS . XmPATH_MODE_FULL , OS . XmNfilterLabelString , xmStringPtr4 } ; if ( OS . IsAIX ) parent . realizeWidget ( ) ; int parentHandle = parent . shellHandle ; byte [ ] name = new byte [ ] { 0 } ; int dialog = OS . XmCreateFileSelectionDialog ( parentHandle , name , argList1 , ( ( argList1 . length ) // 2 ) ) ; int child = OS . XmFileSelectionBoxGetChild ( dialog , XmDIALOG_HELP_BUTTON ) ; if ( child != 0 ) OS . XtUnmanageChild ( child ) ; child = OS . XmFileSelectionBoxGetChild ( dialog , XmDIALOG_LIST ) ; if ( child != 0 ) { int parent2 = OS . XtParent ( child ) ; if ( parent2 != 0 ) OS . XtUnmanageChild ( parent2 ) ; } child = OS . XmFileSelectionBoxGetChild ( dialog , XmDIALOG_LIST_LABEL ) ; if ( child != 0 ) OS . XtUnmanageChild ( child ) ; child = OS . XmFileSelectionBoxGetChild ( dialog , XmDIALOG_TEXT ) ; if ( child != 0 ) OS . XtUnmanageChild ( child ) ; child = OS . XmFileSelectionBoxGetChild ( dialog , XmDIALOG_SELECTION_LABEL ) ; if ( child != 0 ) OS . XtUnmanageChild ( child ) ; OS . XmStringFree ( xmStringPtr1 ) ; OS . XmStringFree ( xmStringPtr2 ) ; OS . XmStringFree ( xmStringPtr3 ) ; OS . XmStringFree ( xmStringPtr4 ) ; byte [ ] buffer4 = Converter . wcsToMbcs ( null , message , true ) ; int xmString1 = OS . XmStringGenerate ( buffer4 , null , XmCHARSET_TEXT , null ) ; int [ ] argList = new int [ ] { OS . XmNlabelType , OS . XmSTRING , OS . XmNlabelString , xmString1 } ; int textArea = OS . XmCreateLabel ( dialog , name , argList , ( ( argList . length ) // 2 ) ) ; OS . XtManageChild ( textArea ) ; OS . XmStringFree ( xmString1 ) ; Callback callback = new Callback ( this , "activate" , 3 ) ; int address = callback . getAddress ( ) ; if ( address == 0 ) SWT . error ( ERROR_NO_MORE_CALLBACKS ) ; OS . XtAddCallback ( dialog , XmNokCallback , address , XmDIALOG_OK_BUTTON ) ; OS . XtAddCallback ( dialog , XmNcancelCallback , address , XmDIALOG_CANCEL_BUTTON ) ; cancel = true ; OS . XtManageChild ( dialog ) ; while ( ( OS . XtIsRealized ( dialog ) ) && ( OS . XtIsManaged ( dialog ) ) ) if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; String directoryPath = "" ; if ( ! ( cancel ) ) { int [ ] argList2 = new int [ ] { OS . XmNdirMask , 0 } ; OS . XtGetValues ( dialog , argList2 , ( ( argList2 . length ) // 2 ) ) ; int xmString3 = argList2 [ 1 ] ; int [ ] table = new int [ ] { display . tabMapping , display . crMapping } ; int ptr = OS . XmStringUnparse ( xmString3 , null , XmCHARSET_TEXT , XmCHARSET_TEXT , table , table . length , XmOUTPUT_ALL ) ; if ( ptr != 0 ) { int length = OS . strlen ( ptr ) ; byte [ ] buffer = new byte [ length ] ; OS . memmove ( buffer , ptr , length ) ; OS . XtFree ( ptr ) ; directoryPath = new String ( Converter . mbcsToWcs ( null , buffer ) ) ; } OS . XmStringFree ( xmString3 ) ; int length = directoryPath . length ( ) ;

Fix:
byte [ ] buffer7 = Converter . wcsToMbcs ( null , SWT . getMessage ( "SWT_Selection" ) , true ) ;