Buggy code:
public class HTMLTransfer extends ByteArrayTransfer { static HTMLTransfer _instance = new HTMLTransfer ( ) ; static final String HTML_FORMAT = "HTML<seq2seq4repair_space>Format" ; static final int HTML_FORMATID = registerType ( HTMLTransfer . HTML_FORMAT ) ; static final String NUMBER = "00000000" ; static final String HEADER = ( ( ( ( ( ( ( "Version:0.9\r\nStartHTML:" + ( HTMLTransfer . NUMBER ) ) + "\r\nEndHTML:" ) + ( HTMLTransfer . NUMBER ) ) + "\r\nStartFragment:" ) + ( HTMLTransfer . NUMBER ) ) + "\r\nEndFragment:" ) + ( HTMLTransfer . NUMBER ) ) + "\r\n" ; static final String PREFIX = "<html><body><!--StartFragment-->" ; static final String SUFFIX = "<!--EndFragment--><//body><//html>" ; static final String StartFragment = "StartFragment:" ; static final String EndFragment = "EndFragment:" ; private HTMLTransfer ( ) { } public static HTMLTransfer getInstance ( ) { } public void javaToNative ( Object object , TransferData transferData ) { } public Object nativeToJava ( TransferData transferData ) { if ( ( ! ( isSupportedType ( transferData ) ) ) || ( ( transferData . pIDataObject ) == 0 ) ) return null ; IDataObject data = new IDataObject ( transferData . pIDataObject ) ; data . AddRef ( ) ; STGMEDIUM stgmedium = new STGMEDIUM ( ) ; FORMATETC formatetc = transferData . formatetc ; stgmedium . tymed = COM . TYMED_HGLOBAL ; <START_BUG> transferData . result = data . GetData ( formatetc , stgmedium ) ; <END_BUG> data . Release ( ) ; if ( ( transferData . result ) != ( COM . S_OK ) ) return null ; int hMem = stgmedium . unionField ; try { int lpMultiByteStr = OS . GlobalLock ( hMem ) ; if ( lpMultiByteStr == 0 ) return null ; try { int cchWideChar = OS . MultiByteToWideChar ( CP_UTF8 , 0 , lpMultiByteStr , ( - 1 ) , null , 0 ) ; if ( cchWideChar == 0 ) return null ; char [ ] lpWideCharStr = new char [ cchWideChar - 1 ] ; OS . MultiByteToWideChar ( CP_UTF8 , 0 , lpMultiByteStr , ( - 1 ) , lpWideCharStr , lpWideCharStr . length ) ; String string = new String ( lpWideCharStr ) ; int fragmentStart = 0 ; int fragmentEnd = 0 ; int start = ( string . indexOf ( HTMLTransfer . StartFragment ) ) + ( HTMLTransfer . StartFragment . length ( ) ) ; int end = start + 1 ; while ( end < ( string . length ( ) ) ) { String s = string . substring ( start , end ) ; try { fragmentStart = Integer . parseInt ( s ) ; end ++ ; } catch ( NumberFormatException e ) { break ; } } start = ( string . indexOf ( HTMLTransfer . EndFragment ) ) + ( HTMLTransfer . EndFragment . length ( ) ) ; end = start + 1 ; while ( end < ( string . length ( ) ) ) { String s = string . substring ( start , end ) ; try { fragmentEnd = Integer . parseInt ( s ) ; end ++ ; } catch ( NumberFormatException e ) { break ; } } if ( ( fragmentEnd <= fragmentStart ) || ( fragmentEnd > ( OS . strlen ( lpMultiByteStr ) ) ) ) return null ; cchWideChar = OS . MultiByteToWideChar ( CP_UTF8 , 0 , ( lpMultiByteStr + fragmentStart ) , ( fragmentEnd - fragmentStart ) , lpWideCharStr , lpWideCharStr . length ) ; if ( cchWideChar == 0 ) return null ; String s = new String ( lpWideCharStr , 0 , cchWideChar ) ; String foxStart = "<!--StartFragment<seq2seq4repair_space>-->\r\n" ; int prefix = s . indexOf ( foxStart ) ; if ( prefix != ( - 1 ) ) { prefix += foxStart . length ( ) ; s = s . substring ( prefix ) ; } return s ; } finally { OS . GlobalUnlock ( hMem ) ; } } finally { OS . GlobalFree ( hMem ) ; } } protected int [ ] getTypeIds ( ) { } protected String [ ] getTypeNames ( ) { } boolean checkHTML ( Object object ) { } protected boolean validate ( Object object ) { } }

Fix:
transferData . result = getData ( data , formatetc , stgmedium ) ;