Buggy code:
public final class Program { String name ; String command ; String iconPath ; Display display ; boolean gnomeExpectUri ; static int modTime ; static Hashtable mimeTable ; static int cdeShell ; static final String [ ] CDE_ICON_EXT = new String [ ] { ".m.pm" , ".l.pm" , ".s.pm" , ".t.pm" } ; static final String [ ] CDE_MASK_EXT = new String [ ] { ".m_m.bm" , ".l_m.bm" , ".s_m.bm" , ".t_m.bm" } ; static final String DESKTOP_DATA = "Program_DESKTOP" ; static final String ICON_THEME_DATA = "Program_GNOME_ICON_THEME" ; static final String PREFIX_HTTP = "http:////" ; static final String PREFIX_HTTPS = "https:////" ; static final int DESKTOP_UNKNOWN = 0 ; static final int DESKTOP_GNOME = 1 ; static final int DESKTOP_GNOME_24 = 2 ; static final int DESKTOP_GIO = 3 ; static final int DESKTOP_CDE = 4 ; static final int PREFERRED_ICON_SIZE = 16 ; Program ( ) { } static int getDesktop ( final Display display ) { } boolean cde_execute ( String fileName ) { } static String cde_getAction ( String dataType ) { } static String cde_getAttribute ( String dataType , String attrName ) { } static Hashtable cde_getDataTypeInfo ( ) { } static String cde_getExtension ( String dataType ) { } ImageData cde_getImageData ( ) { } static String cde_getMimeType ( String extension ) { } static Program cde_getProgram ( Display display , String mimeType ) { } static boolean cde_init ( Display display ) { } static boolean cde_isExecutable ( String fileName ) { } static String [ ] parseCommand ( String cmd ) { } boolean gnome_24_execute ( String fileName ) { } static boolean gnome_24_launch ( String fileName ) { } boolean gnome_execute ( String fileName ) { } ImageData gnome_getImageData ( ) { } static Hashtable gnome_getMimeInfo ( ) { } static String gnome_getMimeType ( String extension ) { } static Program gnome_getProgram ( Display display , String mimeType ) { } static boolean gnome_init ( ) { } static boolean gnome_isExecutable ( String fileName ) { } public static Program findProgram ( String extension ) { } static Program findProgram ( Display display , String extension ) { } public static String [ ] getExtensions ( ) { } static String [ ] getExtensions ( Display display ) { } public static Program [ ] getPrograms ( ) { } static Program [ ] getPrograms ( Display display ) { } ImageData gio_getImageData ( ) { } static Hashtable gio_getMimeInfo ( ) { } static String gio_getMimeType ( String extension ) { } static Program gio_getProgram ( Display display , String mimeType ) { } static Program gio_getProgram ( Display display , int application ) { Program program = new Program ( ) ; program . display = display ; int applicationName = OS . g_app_info_get_name ( application ) ; int length = OS . strlen ( applicationName ) ; byte [ ] buffer = new byte [ length ] ; OS . memmove ( buffer , applicationName , length ) ; program . name = new String ( Converter . mbcsToWcs ( null , buffer ) ) ; int applicationCommand = OS . g_app_info_get_executable ( application ) ; <START_BUG> length = OS . strlen ( applicationName ) ; <END_BUG> buffer = new byte [ length ] ; OS . memmove ( buffer , applicationCommand , length ) ; program . command = new String ( Converter . mbcsToWcs ( null , buffer ) ) ; program . gnomeExpectUri = OS . g_app_info_supports_uris ( application ) ; int applicationId = OS . g_app_info_get_id ( application ) ; length = OS . strlen ( applicationId ) ; buffer = new byte [ length + 1 ] ; OS . memmove ( buffer , applicationId , length ) ; int icon = OS . g_app_info_get_icon ( application ) ; if ( icon != 0 ) { int icon_name = OS . g_icon_to_string ( icon ) ; if ( icon_name != 0 ) { length = OS . strlen ( icon_name ) ; if ( length > 0 ) { buffer = new byte [ length ] ; OS . memmove ( buffer , icon_name , length ) ; program . iconPath = new String ( Converter . mbcsToWcs ( null , buffer ) ) ; } OS . g_free ( icon_name ) ; } OS . g_object_unref ( icon ) ; } return program ; } static Program [ ] gio_getPrograms ( Display display ) { } static boolean gio_isExecutable ( String fileName ) { } static boolean gio_launch ( String fileName ) { } boolean gio_execute ( String fileName ) { } static String [ ] gio_getExtensions ( ) { } static boolean isExecutable ( Display display , String fileName ) { } public static boolean launch ( String fileName ) { } public static boolean launch ( String fileName , String workingDir ) { } static boolean launch ( Display display , String fileName , String workingDir ) { } public boolean equals ( Object other ) { } public boolean execute ( String fileName ) { } public ImageData getImageData ( ) { } public String getName ( ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
length = OS . strlen ( applicationCommand ) ;