From f930fac38a2aacd10aff172f72a6b41441c32132 Mon Sep 17 00:00:00 2001 From: Milos Kleint Date: Sat, 6 May 2006 08:47:15 +0000 Subject: [PATCH] MNG-2147 make sure it's not required to set activated or inactivaed profiles. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@400269 13f79535-47bb-0310-9956-ffa450edef68 --- .../DefaultMavenExecutionRequest.java | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java index 7514b768e9..f418093ad4 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -159,11 +159,19 @@ public class DefaultMavenExecutionRequest public List getActiveProfiles() { + if ( activeProfiles == null ) + { + activeProfiles = new ArrayList(); + } return activeProfiles; } public List getInactiveProfiles() { + if ( inactiveProfiles == null ) + { + inactiveProfiles = new ArrayList(); + } return inactiveProfiles; } @@ -285,48 +293,28 @@ public class DefaultMavenExecutionRequest public MavenExecutionRequest addActiveProfile( String profile ) { - if ( activeProfiles == null ) - { - activeProfiles = new ArrayList(); - } - - activeProfiles.add( profile ); + getActiveProfiles().add( profile ); return this; } public MavenExecutionRequest addInactiveProfile( String profile ) { - if ( inactiveProfiles == null ) - { - inactiveProfiles = new ArrayList(); - } - - inactiveProfiles.add( profile ); + getInactiveProfiles().add( profile ); return this; } public MavenExecutionRequest addActiveProfiles( List profiles ) { - if ( activeProfiles == null ) - { - activeProfiles = new ArrayList(); - } - - activeProfiles.addAll( profiles ); + getActiveProfiles().addAll( profiles ); return this; } public MavenExecutionRequest addInactiveProfiles( List profiles ) { - if ( inactiveProfiles == null ) - { - inactiveProfiles = new ArrayList(); - } - - inactiveProfiles.addAll( profiles ); + getInactiveProfiles().addAll( profiles ); return this; }