<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IJavaElement ; import org . eclipse . jdt . core . IJavaModelStatus ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . ISourceReference ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Messages ; public class RenameElementsOperation extends MoveElementsOperation { public RenameElementsOperation ( IJavaElement [ ] elements , IJavaElement [ ] destinations , String [ ] newNames , boolean force ) { super ( elements , destinations , force ) ; setRenamings ( newNames ) ; } protected String getMainTaskName ( ) { return Messages . operation_renameElementProgress ; } protected boolean isRename ( ) { return true ; } protected IJavaModelStatus verify ( ) { IJavaModelStatus status = super . verify ( ) ; if ( ! status . isOK ( ) ) return status ; if ( this . renamingsList == null || this . renamingsList . length == 0 ) return new JavaModelStatus ( IJavaModelStatusConstants . NULL_NAME ) ; return JavaModelStatus . VERIFIED_OK ; } protected void verify ( IJavaElement element ) throws JavaModelException { if ( element == null || ! element . exists ( ) ) error ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , element ) ; if ( element . isReadOnly ( ) ) error ( IJavaModelStatusConstants . READ_ONLY , element ) ; if ( ! ( element instanceof ISourceReference ) ) error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; int elementType = element . getElementType ( ) ; if ( elementType < IJavaElement . TYPE || elementType == IJavaElement . INITIALIZER ) error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , element ) ; verifyRenaming ( element ) ; } } </s>