Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3703E2009F2 for ; Thu, 5 May 2016 22:24:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 358A2160A04; Thu, 5 May 2016 20:24:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7FB511609F9 for ; Thu, 5 May 2016 22:24:49 +0200 (CEST) Received: (qmail 11008 invoked by uid 500); 5 May 2016 20:24:48 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 10998 invoked by uid 99); 5 May 2016 20:24:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 20:24:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8044FDFC6C; Thu, 5 May 2016 20:24:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: khmarbaise@apache.org To: commits@maven.apache.org Message-Id: <9202916428cf4d3b8b5209943641a1f2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: maven git commit: Code polishing o Replaced static initializer block with unmodifiableList() list to make sure the list itself will never being changed. Date: Thu, 5 May 2016 20:24:48 +0000 (UTC) archived-at: Thu, 05 May 2016 20:24:50 -0000 Repository: maven Updated Branches: refs/heads/master 0535716fd -> 6d67fb246 Code polishing o Replaced static initializer block with unmodifiableList() list to make sure the list itself will never being changed. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6d67fb24 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6d67fb24 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6d67fb24 Branch: refs/heads/master Commit: 6d67fb2464f5cf1d5e84442c0ca1456b94f2fedf Parents: 0535716 Author: Karl Heinz Marbaise Authored: Thu May 5 22:23:27 2016 +0200 Committer: Karl Heinz Marbaise Committed: Thu May 5 22:24:28 2016 +0200 ---------------------------------------------------------------------- .../AbstractStringBasedModelInterpolator.java | 38 ++++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/6d67fb24/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java ---------------------------------------------------------------------- diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java index cee376f..2bd8183 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java @@ -23,7 +23,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; +import java.util.Collections; import java.util.List; import java.util.Properties; @@ -56,29 +56,19 @@ import org.codehaus.plexus.interpolation.ValueSource; public abstract class AbstractStringBasedModelInterpolator implements ModelInterpolator { - private static final List PROJECT_PREFIXES = Arrays.asList( "pom.", "project." ); - - private static final Collection TRANSLATED_PATH_EXPRESSIONS; - - static - { - Collection translatedPrefixes = new HashSet<>(); - - // MNG-1927, MNG-2124, MNG-3355: - // If the build section is present and the project directory is non-null, we should make - // sure interpolation of the directories below uses translated paths. - // Afterward, we'll double back and translate any paths that weren't covered during interpolation via the - // code below... - translatedPrefixes.add( "build.directory" ); - translatedPrefixes.add( "build.outputDirectory" ); - translatedPrefixes.add( "build.testOutputDirectory" ); - translatedPrefixes.add( "build.sourceDirectory" ); - translatedPrefixes.add( "build.testSourceDirectory" ); - translatedPrefixes.add( "build.scriptSourceDirectory" ); - translatedPrefixes.add( "reporting.outputDirectory" ); - - TRANSLATED_PATH_EXPRESSIONS = translatedPrefixes; - } + private static final List PROJECT_PREFIXES = + Collections.unmodifiableList( Arrays.asList( "pom.", "project." ) ); + + // MNG-1927, MNG-2124, MNG-3355: + // If the build section is present and the project directory is non-null, we should make + // sure interpolation of the directories below uses translated paths. + // Afterward, we'll double back and translate any paths that weren't covered during interpolation via the + // code below... + private static final Collection TRANSLATED_PATH_EXPRESSIONS = + Collections.unmodifiableList( Arrays.asList( "build.directory", "build.outputDirectory", + "build.testOutputDirectory", "build.sourceDirectory", + "build.testSourceDirectory", "build.scriptSourceDirectory", + "reporting.outputDirectory" ) ); @Requirement private PathTranslator pathTranslator;