Return-Path: Delivered-To: apmail-continuum-commits-archive@www.apache.org Received: (qmail 3377 invoked from network); 1 Jun 2008 21:46:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2008 21:46:20 -0000 Received: (qmail 94787 invoked by uid 500); 1 Jun 2008 21:46:22 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 94743 invoked by uid 500); 1 Jun 2008 21:46:22 -0000 Mailing-List: contact commits-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@continuum.apache.org Delivered-To: mailing list commits@continuum.apache.org Received: (qmail 94733 invoked by uid 99); 1 Jun 2008 21:46:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2008 14:46:22 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2008 21:45:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1E8E42388A1B; Sun, 1 Jun 2008 14:45:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r662295 - /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Date: Sun, 01 Jun 2008 21:45:59 -0000 To: commits@continuum.apache.org From: olamy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080601214559.1E8E42388A1B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olamy Date: Sun Jun 1 14:45:58 2008 New Revision: 662295 URL: http://svn.apache.org/viewvc?rev=662295&view=rev Log: [CONTINUUM-1752] Allowed duplication of group name when editing a project group Submitted by Maria Catherine Tan Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=662295&r1=662294&r2=662295&view=diff ============================================================================== --- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original) +++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Sun Jun 1 14:45:58 2008 @@ -325,15 +325,32 @@ return REQUIRES_AUTHORIZATION; } - if ( name != null && name.equals( "" ) ) + if ( name != null ) { - addActionError( "projectGroup.error.name.required" ); - return INPUT; - } - else if ( name != null && name.trim().equals( "" ) ) - { - addActionError( "projectGroup.error.name.cannot.be.spaces" ); - return INPUT; + if ( name.equals( "" ) ) + { + addActionError( "projectGroup.error.name.required" ); + return INPUT; + } + else if ( name.trim().equals( "" ) ) + { + addActionError( "projectGroup.error.name.cannot.be.spaces" ); + return INPUT; + } + else + { + name = name.trim(); + Iterator iterator = getContinuum().getAllProjectGroups().iterator(); + while ( iterator.hasNext() ) + { + ProjectGroup projectGroup = (ProjectGroup) iterator.next(); + if ( name.equals( projectGroup.getName() ) && projectGroup.getId() != projectGroupId ) + { + addActionError( "projectGroup.error.name.already.exists" ); + return INPUT; + } + } + } } projectGroup = getContinuum().getProjectGroupWithProjects( projectGroupId );