Buggy code:
public class CopyPackageFragmentRootOperation extends JavaModelOperation { IPath destination ; int updateResourceFlags ; int updateModelFlags ; IClasspathEntry sibling ; public CopyPackageFragmentRootOperation ( IPackageFragmentRoot root , IPath destination , int updateResourceFlags , int updateModelFlags , IClasspathEntry sibling ) { } protected void executeOperation ( ) throws JavaModelException { } protected void copyResource ( IPackageFragmentRoot root , IClasspathEntry rootEntry , final IWorkspaceRoot workspaceRoot ) throws JavaModelException { final char [ ] [ ] exclusionPatterns = ( ( ClasspathEntry ) ( rootEntry ) ) . fullExclusionPatternChars ( ) ; IResource rootResource = root . getResource ( ) ; if ( ( ( root . getKind ( ) ) == ( IPackageFragmentRoot . K_BINARY ) ) || ( exclusionPatterns == null ) ) { try { IResource destRes ; if ( ( ( this . updateModelFlags ) & ( IPackageFragmentRoot . REPLACE ) ) != 0 ) { if ( rootEntry . getPath ( ) . equals ( this . destination ) ) return ; if ( ( destRes = workspaceRoot . findMember ( this . destination ) ) != null ) { destRes . delete ( this . updateResourceFlags , progressMonitor ) ; } } rootResource . copy ( this . destination , this . updateResourceFlags , progressMonitor ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } else { final int sourceSegmentCount = rootEntry . getPath ( ) . segmentCount ( ) ; final IFolder destFolder = workspaceRoot . getFolder ( this . destination ) ; final IPath [ ] nestedFolders = getNestedFolders ( root ) ; IResourceProxyVisitor visitor = new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) throws CoreException { if ( ( proxy . getType ( ) ) == ( IResource . FOLDER ) ) { IPath path = proxy . requestFullPath ( ) ; if ( prefixesOneOf ( path , nestedFolders ) ) { if ( equalsOneOf ( path , nestedFolders ) ) { return false ; } else { IFolder folder = destFolder . getFolder ( path . removeFirstSegments ( sourceSegmentCount ) ) ; if ( ( ( ( updateModelFlags ) & ( IPackageFragmentRoot . REPLACE ) ) != 0 ) && ( folder . exists ( ) ) ) { return true ; } folder . create ( updateResourceFlags , true , progressMonitor ) ; return true ; } } else { IPath destPath = destination . append ( path . removeFirstSegments ( sourceSegmentCount ) ) ; IResource destRes ; if ( ( ( ( updateModelFlags ) & ( IPackageFragmentRoot . REPLACE ) ) != 0 ) && ( ( destRes = workspaceRoot . findMember ( destPath ) ) != null ) ) { destRes . delete ( updateResourceFlags , progressMonitor ) ; } proxy . requestResource ( ) . copy ( destPath , updateResourceFlags , progressMonitor ) ; return false ; } } else { IPath path = proxy . requestFullPath ( ) ; IPath destPath = destination . append ( path . removeFirstSegments ( sourceSegmentCount ) ) ; IResource destRes ; if ( ( ( ( updateModelFlags ) & ( IPackageFragmentRoot . REPLACE ) ) != 0 ) && ( ( destRes = workspaceRoot . findMember ( destPath ) ) != null ) ) { destRes . delete ( updateResourceFlags , progressMonitor ) ; } proxy . requestResource ( ) . copy ( destPath , updateResourceFlags , progressMonitor ) ; return false ; } } } ; try { rootResource . accept ( visitor , IResource . NONE ) ; } catch ( CoreException e ) { throw new JavaModelException ( e ) ; } } <START_BUG> this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; <END_BUG> } protected void addEntryToClasspath ( IClasspathEntry rootEntry , IWorkspaceRoot workspaceRoot ) throws JavaModelException { } protected IClasspathEntry copy ( IClasspathEntry entry ) throws JavaModelException { } public IJavaModelStatus verify ( ) { } }

Fix:
JavaModelOperation . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ;