Index: continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java =================================================================== --- continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java (revision 7993) +++ continuum-1.1/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java (working copy) @@ -118,6 +118,22 @@ throws Exception { Profile stored = profileService.getProfile( profile.getId() ); + List profileList = profileService.getAllProfiles(); + boolean isExist = false; + + if ( profileList != null ) + { + for ( Profile p : profileList ) + { + if ( !( p.getId() == this.profile.getId() ) && ( p.getName().equals( this.profile.getName() ) ) ) + { + isExist = true; + break; + } + } + } + if( !isExist ) + { if ( stored == null ) { this.profile = profileService.addProfile( profile ); @@ -136,6 +152,12 @@ } this.profiles = profileService.getAllProfiles(); return SUCCESS; + } + else + { + addActionError( "Profile name already exists." ); + return "input"; + } } public String delete()