Buggy code:
public class PackageFragment extends Openable implements IPackageFragment , SuffixConstants { protected static final IClassFile [ ] NO_CLASSFILES = new IClassFile [ ] { } ; protected static final ICompilationUnit [ ] NO_COMPILATION_UNITS = new ICompilationUnit [ ] { } ; protected PackageFragment ( PackageFragmentRoot root , String name ) { } protected boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } public boolean containsJavaResources ( ) throws JavaModelException { } public void copy ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public ICompilationUnit createCompilationUnit ( String cuName , String contents , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected Object createElementInfo ( ) { } public void delete ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } public boolean equals ( Object o ) { } public IClassFile getClassFile ( String classFileName ) { } public IClassFile [ ] getClassFiles ( ) throws JavaModelException { } public ICompilationUnit getCompilationUnit ( String cuName ) { } public ICompilationUnit [ ] getCompilationUnits ( ) throws JavaModelException { } public ICompilationUnit [ ] getCompilationUnits ( WorkingCopyOwner owner ) { ICompilationUnit [ ] workingCopies = JavaModelManager . getJavaModelManager ( ) . getWorkingCopies ( owner , false ) ; if ( workingCopies == null ) return JavaModelManager . NO_WORKING_COPY ; int length = workingCopies . length ; ICompilationUnit [ ] result = new ICompilationUnit [ length ] ; int index = 0 ; for ( int i = 0 ; i < length ; i ++ ) { ICompilationUnit wc = workingCopies [ i ] ; <START_BUG> if ( equals ( wc . getParent ( ) ) ) { <END_BUG> result [ ( index ++ ) ] = wc ; } } if ( index != length ) { System . arraycopy ( result , 0 , ( result = new ICompilationUnit [ index ] ) , 0 , index ) ; } return result ; } public int getElementType ( ) { } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner owner ) { } protected char getHandleMementoDelimiter ( ) { } public int getKind ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public IPath getPath ( ) { } public IResource getResource ( ) { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public boolean hasChildren ( ) throws JavaModelException { } public boolean hasSubpackages ( ) throws JavaModelException { } public boolean isDefaultPackage ( ) { } public void move ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void rename ( String newName , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected void toStringChildren ( int tab , StringBuffer buffer , Object info ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
if ( ( equals ( wc . getParent ( ) ) ) && ( ! ( Util . isExcluded ( wc ) ) ) ) {