Buggy code:
public final class Document { private static final Log logger = LogFactory . getLog ( Document . class ) ; private String encoding ; protected List < AccessRule > accessRules = null ; protected File file = null ; protected List < Group > groups = null ; protected boolean isUndoEnabled = true ; protected List < Path > paths = null ; protected List < Repository > repositories = null ; protected Stack < UndoableAction > undoActions = null ; protected boolean unsavedChanges = false ; protected List < User > users = null ; public Document ( ) { } public String getEncoding ( ) { } public void setEncoding ( final String encoding ) { } public AccessRule addAccessRuleForGroup ( Path path , Group group , String level ) throws AppException { } public AccessRule addAccessRuleForGroup ( Path path , String groupName , String level ) throws AppException { } public AccessRule addAccessRuleForGroup ( Repository repository , String pathString , Group group , String level ) throws AppException { } public AccessRule addAccessRuleForUser ( Path path , String userName , String level ) throws AppException { } public AccessRule addAccessRuleForUser ( Path path , User user , String level ) throws AppException { } public AccessRule addAccessRuleForUser ( Repository repository , String pathString , User user , String level ) throws AppException { } public Group addGroup ( String groupName ) throws AppException { } public Group addGroup ( String groupName , List < Group > groupMembers , List < User > userMembers ) throws AppException { } public Group addGroupByName ( String groupName , List < String > groupMemberNames , List < String > userMemberNames , List < String > aliasMemberNames ) throws AppException { } public void addMembersByName ( Group group , List < String > groupMemberNames , List < String > userMemberNames , List < String > aliasMemberNames ) throws AppException { } public Path addPath ( Repository repository , String relativePath ) throws AppException { } public Repository addRepository ( String repositoryName ) throws AppException { } public AccessRule addServerAccessRuleForGroup ( String groupName , String level ) throws AppException { } public AccessRule addServerAccessRuleForUser ( String userName , String level ) throws AppException { } private void addUndoAction ( UndoableAction action ) { } public User addUser ( String userName ) throws AppException { } public User addUser ( String userName , String alias ) throws AppException { } public void changeGroupMembers ( Group group , Vector < Group > groupMembers , Vector < User > userMembers ) throws AppException { } public void changeUserMembership ( User user , Vector < Group > newGroupObjects ) throws AppException { } public void checkForCircularReference ( Group group , Collection < Group > groupMembers ) throws AppException { } public void clearUndoStack ( ) { } public Group cloneGroup ( Group group , String groupName ) throws AppException { if ( ( findGroup ( groupName ) ) != null ) { <START_BUG> throw new AppException ( "clonegroup.error.useralreadyexists" ) ; <END_BUG> } List < Group > groupMembers = ( group == null ) ? null : group . getGroupMembers ( ) ; List < User > userMembers = ( group == null ) ? null : group . getUserMembers ( ) ; Group clone = addGroup ( groupName , groupMembers , userMembers ) ; for ( Group groupObject : group . getGroups ( ) ) { groupObject . addGroupMember ( clone ) ; clone . addGroup ( group ) ; } for ( AccessRule rule : group . getAccessRules ( ) ) { addAccessRuleForGroup ( rule . getPath ( ) , clone , rule . getLevel ( ) ) ; } setUnsavedChanges ( ) ; UndoableAction action = new UndoableAction ( ActionConstants . CLONE_GROUP_ACTION ) ; action . addValue ( VALUE_NEW_GROUP_NAME , groupName ) ; addUndoAction ( action ) ; return clone ; } public User cloneUser ( User user , String userName ) throws AppException { } public User cloneUser ( User user , String userName , String alias ) throws AppException { } public void deleteAccessRule ( String repositoryName , String pathString , Group group , User user ) throws AppException { } public void deleteGroup ( Group group ) throws AppException { } public void deleteGroup ( String groupName ) throws AppException { } private void deleteGroupAccessRules ( Group group ) { } public void deleteGroups ( Object [ ] groups ) throws AppException { } public void deletePath ( Path path ) throws AppException { } private void deletePathAccessRules ( Path path ) { } public void deleteRepositories ( Object [ ] repositories ) throws AppException { } public void deleteRepository ( Repository repository ) throws AppException { } public void deleteRepository ( String repositoryName ) throws AppException { } private void deleteRepositoryAccessRules ( Repository repository ) { } private void deleteRepositoryPaths ( Repository repository ) throws AppException { } public void deleteUser ( String userName ) throws AppException { } public void deleteUser ( User user ) throws AppException { } private void deleteUserAccessRules ( User user ) { } public void deleteUserByAlias ( String alias ) throws AppException { } public void deleteUsers ( Object [ ] users ) throws AppException { } public void disableUndo ( ) { } public void enableUndo ( ) { } public Group findGroup ( String groupName ) throws AppException { } public AccessRule findGroupAccessRule ( Repository repository , String pathString , Group group ) throws AppException { } public Path findPath ( Repository repository , String pathString ) throws AppException { } public Path findPath ( String repositoryName , String pathString ) throws AppException { } public Repository findRepository ( String repositoryName ) throws AppException { } public Path findServerPath ( String pathString ) throws AppException { } public User findUser ( String userName ) throws AppException { } public AccessRule findUserAccessRule ( Repository repository , String pathString , User user ) throws AppException { }

Fix:
throw new AppException ( "clonegroup.error.groupalreadyexists" ) ;