From 36d746789d5493cfeb290120c9735876ceb0f48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 8 Nov 2014 21:53:16 +0100 Subject: [PATCH] make algo more visible --- .../apache/maven/toolchain/java/JavaToolchainFactory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java index f47a3d02f4..9df707c9b3 100644 --- a/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java +++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java @@ -24,6 +24,7 @@ import java.util.Map.Entry; import java.util.Properties; import org.apache.maven.toolchain.MisconfiguredToolchainException; +import org.apache.maven.toolchain.RequirementMatcher; import org.apache.maven.toolchain.RequirementMatcherFactory; import org.apache.maven.toolchain.ToolchainFactory; import org.apache.maven.toolchain.ToolchainPrivate; @@ -73,14 +74,17 @@ public class JavaToolchainFactory "Provides token '" + key + "' doesn't have any value configured." ); } + RequirementMatcher matcher; if ( "version".equals( key ) ) { - jtc.addProvideToken( key, RequirementMatcherFactory.createVersionMatcher( value ) ); + matcher = RequirementMatcherFactory.createVersionMatcher( value ); } else { - jtc.addProvideToken( key, RequirementMatcherFactory.createExactMatcher( value ) ); + matcher = RequirementMatcherFactory.createExactMatcher( value ); } + + jtc.addProvideToken( key, matcher ); } // populate the configuration section