Buggy code:
protected static final IType [ ] fgEmpty = new IType [ 0 ] ; protected IProgressMonitor fProgressMonitor = null ; protected ArrayList fChangeListeners = null ; protected Map files = null ; protected Region fPackageRegion = null ; protected Region fRootRegion = null ; protected Region fProjectRegion = null ; protected boolean fIsActivated = false ; protected boolean fExists = true ; protected boolean computeSubtypes ; IJavaSearchScope scope ; public TypeHierarchy ( IType type , IJavaSearchScope scope , boolean computeSubtypes ) throws JavaModelException { } protected void activate ( ) { } private void addAllCheckingDuplicates ( ArrayList list , IType [ ] collection ) { } protected void addInterface ( IType type ) { } protected void addRootClass ( IType type ) { } protected void addSubtype ( IType type , IType subtype ) { } public void addTypeHierarchyChangedListener ( ITypeHierarchyChangedListener listener ) { } protected void cacheSuperclass ( IType type , IType superclass ) { } protected void cacheSuperInterfaces ( IType type , IType [ ] superinterfaces ) { } protected void checkCanceled ( ) { } protected void compute ( ) throws CoreException , JavaModelException { } public boolean contains ( IType type ) { } protected void deactivate ( ) { } protected void destroy ( ) { } public void elementChanged ( ElementChangedEvent event ) { } public boolean exists ( ) { } protected void fireChange ( ) { } public IType [ ] getAllClasses ( ) { } public IType [ ] getAllInterfaces ( ) { } public IType [ ] getAllSubtypes ( IType type ) { } private IType [ ] getAllSubtypesForType ( IType type ) { } private void getAllSubtypesForType0 ( IType type , ArrayList subs ) { } public IType [ ] getAllSuperclasses ( IType type ) { } public IType [ ] getAllSuperInterfaces ( IType type ) { } private void getAllSuperInterfaces0 ( IType type , ArrayList supers ) { } public IType [ ] getAllSupertypes ( IType type ) { } private void getAllSupertypes0 ( IType type , ArrayList supers ) { } public IType [ ] getAllTypes ( ) { } public IType [ ] getExtendingInterfaces ( IType type ) { } private IType [ ] getExtendingInterfaces0 ( IType interfce ) { } public IType [ ] getImplementingClasses ( IType type ) { } private IType [ ] getImplementingClasses0 ( IType interfce ) { } public IType [ ] getRootClasses ( ) { } public IType [ ] getRootInterfaces ( ) { } public IType [ ] getSubclasses ( IType type ) { } public IType [ ] getSubtypes ( IType type ) { } private IType [ ] getSubtypesForType ( IType type ) { } public IType getSuperclass ( IType type ) { } public IType [ ] getSuperInterfaces ( IType type ) { } public IType [ ] getSupertypes ( IType type ) { } public IType getType ( ) { } protected IType [ ] growAndAddToArray ( IType [ ] array , IType [ ] additions ) { } protected IType [ ] growAndAddToArray ( IType [ ] array , IType addition ) { } private boolean hasSubtypeNamed ( String simpleName ) { } private boolean hasTypeNamed ( String simpleName ) { } private boolean includesTypeOrSupertype ( IType type ) { } protected void initialize ( int size ) { } protected boolean isActivated ( ) { } private boolean isAffected ( IJavaElementDelta delta ) { } private boolean isAffectedByChildren ( IJavaElementDelta delta ) { } private boolean isAffectedByJavaModel ( IJavaElementDelta delta , IJavaElement element ) { } private boolean isAffectedByJavaProject ( IJavaElementDelta delta , IJavaElement element ) { } private boolean isAffectedByPackageFragment ( IJavaElementDelta delta , IJavaElement element ) { } private boolean isAffectedByPackageFragmentRoot ( IJavaElementDelta delta , IJavaElement element ) { } protected boolean isAffectedByOpenable ( IJavaElementDelta delta , IJavaElement element ) { } protected boolean isAffectedByType ( IJavaElementDelta delta , IType type , boolean hasImportChange ) { switch ( delta . getKind ( ) ) { case IJavaElementDelta . ADDED : if ( ( typeHasSupertype ( type ) ) || ( subtypesIncludeSupertypeOf ( type ) ) ) { return true ; } break ; case IJavaElementDelta . CHANGED : boolean hasVisibilityChange = ( ( delta . getFlags ( ) ) & ( IJavaElementDelta . F_MODIFIERS ) ) > 0 ; boolean hasSupertypeChange = ( ( delta . getFlags ( ) ) & ( IJavaElementDelta . F_SUPER_TYPES ) ) > 0 ; if ( ( hasVisibilityChange && ( typeHasSupertype ( type ) ) ) || ( ( hasImportChange || hasSupertypeChange ) && ( includesTypeOrSupertype ( type ) ) ) ) { return true ; } break ; case IJavaElementDelta . REMOVED : if ( this . contains ( type ) ) { return true ; } break ; } IJavaElementDelta [ ] children = delta . getAffectedChildren ( ) ; <START_BUG> for ( int i = 0 , length = children . length ; i < 0 ; i ++ ) { <END_BUG> IJavaElementDelta child = children [ i ] ; IJavaElement childElement = child . getElement ( ) ; if ( childElement instanceof IType ) { if ( this . isAffectedByType ( child , ( ( IType ) ( childElement ) ) , hasImportChange ) ) { return true ; } } } return false ; } public IJavaProject javaProject ( ) { } protected boolean packageRegionContainsSamePackageFragment ( IJavaElement element ) { } public void refresh ( IProgressMonitor monitor ) throws JavaModelException { } protected void refreshCancelled ( OperationCanceledException oce ) throws JavaModelException { } protected void removeType ( IType type ) throws JavaModelException { } public void removeTypeHierarchyChangedListener ( ITypeHierarchyChangedListener listener ) { } private boolean subtypesIncludeSupertypeOf ( IType type ) { } public String toString ( ) { } private void toString ( StringBuffer buffer , IType type , int indent , boolean ascendant ) { } private boolean typeHasSupertype ( IType type ) { } protected void worked ( int work ) { } }

Fix:
for ( int i = 0 , length = children . length ; i < length ; i ++ ) {