Buggy code:
public class CopyResourceElementsOperation extends MultiOperation { protected ArrayList fRenamedCompilationUnits = null ; protected Map fDeltasPerProject = new HashMap ( 1 ) ; protected DOMFactory fFactory ; protected ArrayList fCreatedElements ; public CopyResourceElementsOperation ( IJavaElement [ ] resourcesToCopy , IJavaElement [ ] destContainers , boolean force ) { } public CopyResourceElementsOperation ( IJavaElement [ ] resourcesToCopy , IJavaElement destContainer , boolean force ) { } private IResource [ ] collectResourcesOfInterest ( IPackageFragment source ) throws JavaModelException { } private void createNeededPackageFragments ( IPackageFragmentRoot root , String newFragName , boolean moveFolder ) throws JavaModelException { IContainer parentFolder = ( ( IContainer ) ( root . getResource ( ) ) ) ; JavaElementDelta projectDelta = null ; String [ ] names = org . eclipse . jdt . internal . core . Util . getTrimmedSimpleNames ( newFragName ) ; StringBuffer sideEffectPackageName = new StringBuffer ( ) ; <START_BUG> char [ ] [ ] exclusionsPatterns = ( ( PackageFragmentRoot ) ( root ) ) . getExclusionPatterns ( ) ; <END_BUG> for ( int i = 0 ; i < ( names . length ) ; i ++ ) { String subFolderName = names [ i ] ; sideEffectPackageName . append ( subFolderName ) ; IResource subFolder = parentFolder . findMember ( subFolderName ) ; if ( subFolder == null ) { if ( ! ( moveFolder && ( i == ( ( names . length ) - 1 ) ) ) ) { createFolder ( parentFolder , subFolderName , fForce ) ; } parentFolder = parentFolder . getFolder ( new Path ( subFolderName ) ) ; IPackageFragment sideEffectPackage = root . getPackageFragment ( sideEffectPackageName . toString ( ) ) ; if ( ( i < ( ( names . length ) - 1 ) ) && ( ! ( org . eclipse . jdt . internal . core . Util . isExcluded ( parentFolder , exclusionsPatterns ) ) ) ) { if ( projectDelta == null ) { projectDelta = getDeltaFor ( root . getJavaProject ( ) ) ; } projectDelta . added ( sideEffectPackage ) ; } fCreatedElements . add ( sideEffectPackage ) ; } else { parentFolder = ( ( IContainer ) ( subFolder ) ) ; } sideEffectPackageName . append ( '.' ) ; } } private JavaElementDelta getDeltaFor ( IJavaProject javaProject ) { } protected String getMainTaskName ( ) { } protected void prepareDeltas ( IJavaElement sourceElement , IJavaElement destinationElement , boolean isMove ) { } private void processCompilationUnitResource ( ICompilationUnit source , IPackageFragment dest ) throws JavaModelException { } protected void processDeltas ( ) { } protected void processElement ( IJavaElement element ) throws JavaModelException { } protected void processElements ( ) throws JavaModelException { } private void processPackageFragmentResource ( IPackageFragment source , IPackageFragmentRoot root , String newName ) throws JavaModelException { } private String updatedContent ( ICompilationUnit cu , IPackageFragment dest , String newName ) throws JavaModelException { } private void updatePackageStatement ( IDOMCompilationUnit domCU , String pkgName ) throws JavaModelException { } private void updateTypeName ( ICompilationUnit cu , IDOMCompilationUnit domCU , String oldName , String newName ) throws JavaModelException { } protected IJavaModelStatus verify ( ) { } protected void verify ( IJavaElement element ) throws JavaModelException { } }

Fix:
char [ ] [ ] exclusionsPatterns = ( ( PackageFragmentRoot ) ( root ) ) . fullExclusionPatternChars ( ) ;