Buggy code:
public class Accessible { static final String [ ] requiredAttributes = new String [ ] { OS . kAXRoleAttribute , OS . kAXSubroleAttribute , OS . kAXRoleDescriptionAttribute , OS . kAXHelpAttribute , OS . kAXTitleAttribute , OS . kAXValueAttribute , OS . kAXEnabledAttribute , OS . kAXFocusedAttribute , OS . kAXParentAttribute , OS . kAXChildrenAttribute , OS . kAXSelectedChildrenAttribute , OS . kAXVisibleChildrenAttribute , OS . kAXWindowAttribute , OS . kAXTopLevelUIElementAttribute , OS . kAXPositionAttribute , OS . kAXSizeAttribute , OS . kAXDescriptionAttribute } ; static final String [ ] textAttributes = new String [ ] { OS . kAXNumberOfCharactersAttribute , OS . kAXSelectedTextAttribute , OS . kAXSelectedTextRangeAttribute , OS . kAXStringForRangeParameterizedAttribute , OS . kAXInsertionPointLineNumberAttribute , OS . kAXRangeForLineParameterizedAttribute } ; Vector accessibleListeners = new Vector ( ) ; Vector accessibleControlListeners = new Vector ( ) ; Vector accessibleTextListeners = new Vector ( ) ; Vector accessibleActionListeners = new Vector ( ) ; Vector accessibleHyperlinkListeners = new Vector ( ) ; Vector accessibleTableListeners = new Vector ( ) ; Vector accessibleTableCellListeners = new Vector ( ) ; Vector accessibleTextExtendedListeners = new Vector ( ) ; Vector accessibleValueListeners = new Vector ( ) ; Vector accessibleAttributeListeners = new Vector ( ) ; Accessible parent ; Control control ; int axuielementref = 0 ; int [ ] osChildIDCache = new int [ 0 ] ; public Accessible ( Accessible parent ) { } protected Accessible ( ) { } Accessible ( Control control ) { } static Accessible checkNull ( Accessible parent ) { } public static Accessible internal_new_Accessible ( Control control ) { } public void addAccessibleListener ( AccessibleListener listener ) { } public void addAccessibleControlListener ( AccessibleControlListener listener ) { } public void addAccessibleTextListener ( AccessibleTextListener listener ) { } public void addAccessibleActionListener ( AccessibleActionListener listener ) { } public void addAccessibleHyperlinkListener ( AccessibleHyperlinkListener listener ) { } public void addAccessibleTableListener ( AccessibleTableListener listener ) { } public void addAccessibleTableCellListener ( AccessibleTableCellListener listener ) { } public void addAccessibleValueListener ( AccessibleValueListener listener ) { } public void addAccessibleAttributeListener ( AccessibleAttributeListener listener ) { } public void addRelation ( int type , Accessible target ) { } public void dispose ( ) { } public Control getControl ( ) { } public void internal_dispose_Accessible ( ) { } public int internal_kEventAccessibleGetChildAtPoint ( int nextHandler , int theEvent , int userData ) { } public int internal_kEventAccessibleGetFocusedChild ( int nextHandler , int theEvent , int userData ) { } public int internal_kEventAccessibleGetAllAttributeNames ( int nextHandler , int theEvent , int userData ) { int code = userData ; if ( ( axuielementref ) != 0 ) { if ( code == ( OS . eventNotHandledErr ) ) OS . CallNextEventHandler ( nextHandler , theEvent ) ; int [ ] arrayRef = new int [ 1 ] ; OS . GetEventParameter ( theEvent , kEventParamAccessibleAttributeNames , typeCFMutableArrayRef , null , 4 , null , arrayRef ) ; int stringArrayRef = arrayRef [ 0 ] ; int length = OS . CFArrayGetCount ( stringArrayRef ) ; String [ ] osAllAttributes = new String [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { int stringRef = OS . CFArrayGetValueAtIndex ( stringArrayRef , i ) ; osAllAttributes [ i ] = stringRefToString ( stringRef ) ; } for ( int i = 0 ; i < ( Accessible . requiredAttributes . length ) ; i ++ ) { if ( ! ( contains ( osAllAttributes , Accessible . requiredAttributes [ i ] ) ) ) { int stringRef = stringToStringRef ( Accessible . requiredAttributes [ i ] ) ; OS . CFArrayAppendValue ( stringArrayRef , stringRef ) ; OS . CFRelease ( stringRef ) ; } } <START_BUG> if ( ( accessibleTextListeners . size ( ) ) > 0 ) { <END_BUG> for ( int i = 0 ; i < ( Accessible . textAttributes . length ) ; i ++ ) { if ( ! ( contains ( osAllAttributes , Accessible . textAttributes [ i ] ) ) ) { int stringRef = stringToStringRef ( Accessible . textAttributes [ i ] ) ; OS . CFArrayAppendValue ( stringArrayRef , stringRef ) ; OS . CFRelease ( stringRef ) ; } } } code = OS . noErr ; } return code ; } boolean contains ( String [ ] array , String element ) { } public int internal_kEventAccessibleGetNamedAttribute ( int nextHandler , int theEvent , int userData ) { } int getAttribute ( int nextHandler , int theEvent , int userData ) { } int getHelpAttribute ( int nextHandler , int theEvent , int userData ) { } int getRoleAttribute ( int nextHandler , int theEvent , int userData ) { } int getSubroleAttribute ( int nextHandler , int theEvent , int userData ) { } int getRoleDescriptionAttribute ( int nextHandler , int theEvent , int userData ) { } int getTitleAttribute ( int nextHandler , int theEvent , int userData ) { } int getValueAttribute ( int nextHandler , int theEvent , int userData ) { } int getEnabledAttribute ( int nextHandler , int theEvent , int userData ) { } int getFocusedAttribute ( int nextHandler , int theEvent , int userData ) { } int getParentAttribute ( int nextHandler , int theEvent , int userData ) { } int getChildrenAttribute ( int nextHandler , int theEvent , int userData ) { } int getSelectedChildrenAttribute ( int nextHandler , int theEvent , int userData ) { } int getVisibleChildrenAttribute ( int nextHandler , int theEvent , int userData ) { } int getPositionAttribute ( int nextHandler , int theEvent , int userData ) { } int getSizeAttribute ( int nextHandler , int theEvent , int userData ) { } int getDescriptionAttribute ( int nextHandler , int theEvent , int userData ) { } int getInsertionPointLineNumberAttribute ( int nextHandler , int theEvent , int userData ) { } int getNumberOfCharactersAttribute ( int nextHandler , int theEvent , int userData ) { }

Fix:
if ( ( ( accessibleTextListeners . size ( ) ) > 0 ) || ( ( accessibleTextExtendedListeners . size ( ) ) > 0 ) ) {