<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; public class RenameResourceElementsOperation extends MoveResourceElementsOperation { public RenameResourceElementsOperation ( IJavaElement [ ] elements , IJavaElement [ ] destinations , String [ ] newNames , boolean force ) { super ( elements , destinations , force ) ; setRenamings ( newNames ) ; } protected String getMainTaskName ( ) { return Messages . operation_renameResourceProgress ; } protected boolean isRename ( ) { return true ; } protected void verify ( IJavaElement element ) throws JavaModelException { super . verify ( element ) ; int elementType = element . getElementType ( ) ; if ( ! ( elementType == IJavaElement . COMPILATION_UNIT || elementType == IJavaElement . PACKAGE_FRAGMENT ) ) { error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; } if ( elementType == IJavaElement . COMPILATION_UNIT ) { CompilationUnit cu = ( CompilationUnit ) element ; if ( cu . isWorkingCopy ( ) && ! cu . isPrimary ( ) ) { error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; } } verifyRenaming ( element ) ; } } </s>