Buggy code:
public class MovePackageFragmentRootOperation extends CopyPackageFragmentRootOperation { protected void renameEntryInClasspath ( IPath rootPath , IJavaProject project ) throws JavaModelException { } private IPath [ ] renamePatterns ( IPath rootPath , IPath [ ] patterns ) { } public MovePackageFragmentRootOperation ( IPackageFragmentRoot root , IPath destination , int updateResourceFlags , int updateModelFlags , IClasspathEntry sibling ) { } protected void executeOperation ( ) throws JavaModelException { } protected void moveResource ( IPackageFragmentRoot root , IClasspathEntry rootEntry , final IWorkspaceRoot workspaceRoot ) throws JavaModelException { final char [ ] [ ] exclusionPatterns = ( ( ClasspathEntry ) ( rootEntry ) ) . fullExclusionPatternChars ( ) ; IResource rootResource = root . getResource ( ) ; if ( ( ( rootEntry . getEntryKind ( ) ) != ( IClasspathEntry . CPE_SOURCE ) ) || ( exclusionPatterns == null ) ) { try { IResource destRes ; if ( ( ( ( this . updateModelFlags ) & ( IPackageFragmentRoot . REPLACE ) ) != 0 ) && ( ( destRes = workspaceRoot . findMember ( this . destination ) ) != null ) ) { destRes . delete ( this . updateResourceFlags , progressMonitor ) ; } rootResource . move ( 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 ( ) . move ( 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 ( ) . move ( 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 updateReferringProjectClasspaths ( IPath rootPath , IJavaProject projectOfRoot ) throws JavaModelException { } protected void removeEntryFromClasspath ( IPath rootPath , IJavaProject project ) throws JavaModelException { } }

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