Author: carlos Date: Fri Jul 7 05:46:49 2006 New Revision: 419885 URL: http://svn.apache.org/viewvc?rev=419885&view=rev Log: Remove unused method, consolidate if blocks
Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java?rev=419885&r1=419884&r2=419885&view=diff ============================================================================== --- maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java (original) +++ maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java Fri Jul 7 05:46:49 2006 @@ -134,55 +134,11 @@ for ( Iterator profiles = settings.getProfiles().iterator(); profiles.hasNext(); ) { Profile profile = (Profile) profiles.next(); - if ( profile.getActivation() != null && profile.getActivation().isActiveByDefault() ) + if ( profile.getActivation() != null && profile.getActivation().isActiveByDefault() + && !activeProfiles.contains( profile.getId() ) ) { - if ( !activeProfiles.contains( profile.getId() ) ) - { - settings.addActiveProfile( profile.getId() ); - } + settings.addActiveProfile( profile.getId() ); } - } - } - - private File getFile( String pathPattern, String basedirSysProp, String altLocationSysProp ) - { - // ------------------------------------------------------------------------------------- - // Alright, here's the justification for all the regexp wizardry below... - // - // Continuum and other server-like apps may need to locate the user-level and - // global-level settings somewhere other than ${user.home} and ${maven.home}, - // respectively. Using a simple replacement of these patterns will allow them - // to specify the absolute path to these files in a customized components.xml - // file. Ideally, we'd do full pattern-evaluation against the sysprops, but this - // is a first step. There are several replacements below, in order to normalize - // the path character before we operate on the string as a regex input, and - // in order to avoid surprises with the File construction... - // ------------------------------------------------------------------------------------- - - String path = System.getProperty( altLocationSysProp ); - - if ( StringUtils.isEmpty( path ) ) - { - // TODO: This replacing shouldn't be necessary as user.home should be in the - // context of the container and thus the value would be interpolated by Plexus - String basedir = System.getProperty( basedirSysProp ); - if ( basedir == null ) - { - basedir = System.getProperty( "user.dir" ); - } - - basedir = basedir.replaceAll( "\\\\", "/" ); - basedir = basedir.replaceAll( "\\$", "\\\\\\$" ); - - path = pathPattern.replaceAll( "\\$\\{" + basedirSysProp + "\\}", basedir ); - path = path.replaceAll( "\\\\", "/" ); - path = path.replaceAll( "//", "/" ); - - return new File( path ).getAbsoluteFile(); - } - else - { - return new File( path ).getAbsoluteFile(); } } }