Buggy code:
public class Accessible { int refCount = 0 ; int enumIndex = 0 ; COMObject objIAccessible ; COMObject objIEnumVARIANT ; IAccessible iaccessible ; Vector accessibleListeners = new Vector ( ) ; Vector accessibleControlListeners = new Vector ( ) ; Vector textListeners = new Vector ( ) ; Object [ ] variants ; Control control ; static String ALTERNATE_ACCESSIBLE_CLASS_NAME = "org.eclipse.swt.accessibility2.Accessible2" ; protected Accessible ( ) { } Accessible ( Control control ) { } public static Accessible internal_new_Accessible ( Control control ) { } public void addAccessibleListener ( AccessibleListener listener ) { } public void addAccessibleControlListener ( AccessibleControlListener listener ) { } public void addAccessibleTextListener ( AccessibleTextListener listener ) { } public Control getControl ( ) { } public void internal_dispose_Accessible ( ) { } public int internal_WM_GETOBJECT ( int wParam , int lParam ) { } public void removeAccessibleListener ( AccessibleListener listener ) { } public void removeAccessibleControlListener ( AccessibleControlListener listener ) { } public void removeAccessibleTextListener ( AccessibleTextListener listener ) { } public void selectionChanged ( ) { } public void setFocus ( int childID ) { } public void textCaretMoved ( int index ) { } public void textChanged ( int type , int startIndex , int length ) { } public void textSelectionChanged ( ) { } int QueryInterface ( int iid , int ppvObject ) { } int AddRef ( ) { } int Release ( ) { } int accDoDefaultAction ( int varChild ) { } int accHitTest ( int xLeft , int yTop , int pvarChild ) { } int accLocation ( int pxLeft , int pyTop , int pcxWidth , int pcyHeight , int varChild ) { } int accNavigate ( int navDir , int varStart , int pvarEndUpAt ) { } int accSelect ( int flagsSelect , int varChild ) { } int get_accChild ( int varChild , int ppdispChild ) { } int get_accChildCount ( int pcountChildren ) { } int get_accDefaultAction ( int varChild , int pszDefaultAction ) { } int get_accDescription ( int varChild , int pszDescription ) { } int get_accFocus ( int pvarChild ) { } int get_accHelp ( int varChild , int pszHelp ) { } int get_accHelpTopic ( int pszHelpFile , int varChild , int pidTopic ) { } int get_accKeyboardShortcut ( int varChild , int pszKeyboardShortcut ) { } int get_accName ( int varChild , int pszName ) { } int get_accParent ( int ppdispParent ) { } int get_accRole ( int varChild , int pvarRole ) { if ( ( iaccessible ) == null ) return COM . CO_E_OBJNOTCONNECTED ; VARIANT v = getVARIANT ( varChild ) ; if ( ( v . vt ) != ( COM . VT_I4 ) ) return COM . E_INVALIDARG ; int osRole = COM . ROLE_SYSTEM_CLIENT ; int code = iaccessible . get_accRole ( varChild , pvarRole ) ; if ( code == ( COM . S_OK ) ) { VARIANT v2 = getVARIANT ( pvarRole ) ; if ( ( v2 . vt ) == ( COM . VT_I4 ) ) <START_BUG> osRole = osToChildID ( v2 . lVal ) ; <END_BUG> } AccessibleControlEvent event = new AccessibleControlEvent ( this ) ; event . childID = osToChildID ( v . lVal ) ; event . detail = osToRole ( osRole ) ; if ( ( ( control ) instanceof Tree ) || ( ( control ) instanceof Table ) ) { if ( ( ( v . lVal ) != ( COM . CHILDID_SELF ) ) && ( ( ( control . getStyle ( ) ) & ( SWT . CHECK ) ) != 0 ) ) event . detail = ACC . ROLE_CHECKBUTTON ; } for ( int i = 0 ; i < ( accessibleControlListeners . size ( ) ) ; i ++ ) { AccessibleControlListener listener = ( ( AccessibleControlListener ) ( accessibleControlListeners . elementAt ( i ) ) ) ; listener . getRole ( event ) ; } setVARIANT ( pvarRole , VT_I4 , roleToOs ( event . detail ) ) ; return COM . S_OK ; } int get_accSelection ( int pvarChildren ) { } int get_accState ( int varChild , int pvarState ) { } int get_accValue ( int varChild , int pszValue ) { } int put_accName ( int varChild , int szName ) { } int put_accValue ( int varChild , int szValue ) { } int Next ( int celt , int rgvar , int pceltFetched ) { } int Skip ( int celt ) { } int Reset ( ) { } int Clone ( int ppEnum ) { } int childIDToOs ( int childID ) { } int osToChildID ( int osChildID ) { } int stateToOs ( int state ) { } int osToState ( int osState ) { } int roleToOs ( int role ) { } int osToRole ( int osRole ) { } VARIANT getVARIANT ( int variant ) { } void setVARIANT ( int variant , short vt , int lVal ) { } void setPtrVARIANT ( int variant , short vt , int lVal ) { } void checkWidget ( ) { } boolean isValidThread ( ) { } }

Fix:
osRole = v2 . lVal ;