Buggy code:
public class PackageFragment extends Openable implements IPackageFragment { protected static IClassFile [ ] fgEmptyClassFileList = new IClassFile [ ] { } ; protected static ICompilationUnit [ ] fgEmptyCompilationUnitList = new ICompilationUnit [ ] { } ; protected PackageFragment ( IPackageFragmentRoot root , String name ) { } protected boolean computeChildren ( OpenableElementInfo info , IResource resource ) throws JavaModelException { ArrayList vChildren = new ArrayList ( ) ; int kind = getKind ( ) ; String extType ; if ( kind == ( IPackageFragmentRoot . K_SOURCE ) ) { extType = "java" ; } else { extType = "class" ; } try { <START_BUG> char [ ] [ ] exclusionPatterns = ( ( PackageFragmentRoot ) ( getPackageFragmentRoot ( ) ) ) . getExclusionPatterns ( ) ; <END_BUG> IResource [ ] members = ( ( IContainer ) ( resource ) ) . members ( ) ; for ( int i = 0 , max = members . length ; i < max ; i ++ ) { IResource child = members [ i ] ; if ( ( ( child . getType ( ) ) != ( IResource . FOLDER ) ) && ( ! ( Util . isExcluded ( child , exclusionPatterns ) ) ) ) { String extension = child . getProjectRelativePath ( ) . getFileExtension ( ) ; if ( extension != null ) { if ( extension . equalsIgnoreCase ( extType ) ) { IJavaElement childElement ; if ( ( kind == ( IPackageFragmentRoot . K_SOURCE ) ) && ( Util . isValidCompilationUnitName ( child . getName ( ) ) ) ) { childElement = getCompilationUnit ( child . getName ( ) ) ; vChildren . add ( childElement ) ; } else if ( Util . isValidClassFileName ( child . getName ( ) ) ) { childElement = getClassFile ( child . getName ( ) ) ; vChildren . add ( childElement ) ; } } } } } } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } IJavaElement [ ] children = new IJavaElement [ vChildren . size ( ) ] ; vChildren . toArray ( children ) ; info . setChildren ( children ) ; return true ; } public boolean containsJavaResources ( ) throws JavaModelException { } public void copy ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public ICompilationUnit createCompilationUnit ( String name , String contents , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public void delete ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected boolean generateInfos ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } public IClassFile getClassFile ( String name ) { } public IClassFile [ ] getClassFiles ( ) throws JavaModelException { } public ICompilationUnit getCompilationUnit ( String name ) { } public ICompilationUnit [ ] getCompilationUnits ( ) throws JavaModelException { } 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 hasSubpackages ( ) throws JavaModelException { } public boolean isDefaultPackage ( ) { } public void move ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected void openWhenClosed ( IProgressMonitor pm ) throws JavaModelException { } public void refreshChildren ( ) { } public void rename ( String name , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IJavaElement rootedAt ( IJavaProject project ) { } protected void toStringChildren ( int tab , StringBuffer buffer , Object info ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
char [ ] [ ] exclusionPatterns = ( ( PackageFragmentRoot ) ( getPackageFragmentRoot ( ) ) ) . fullExclusionPatternChars ( ) ;