make algo more visible

This commit is contained in:
Hervé Boutemy 2014-11-08 21:53:16 +01:00
parent bdf5770f95
commit 36d746789d
1 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,7 @@
import java.util.Properties; import java.util.Properties;
import org.apache.maven.toolchain.MisconfiguredToolchainException; import org.apache.maven.toolchain.MisconfiguredToolchainException;
import org.apache.maven.toolchain.RequirementMatcher;
import org.apache.maven.toolchain.RequirementMatcherFactory; import org.apache.maven.toolchain.RequirementMatcherFactory;
import org.apache.maven.toolchain.ToolchainFactory; import org.apache.maven.toolchain.ToolchainFactory;
import org.apache.maven.toolchain.ToolchainPrivate; import org.apache.maven.toolchain.ToolchainPrivate;
@ -73,14 +74,17 @@ public ToolchainPrivate createToolchain( ToolchainModel model )
"Provides token '" + key + "' doesn't have any value configured." ); "Provides token '" + key + "' doesn't have any value configured." );
} }
RequirementMatcher matcher;
if ( "version".equals( key ) ) if ( "version".equals( key ) )
{ {
jtc.addProvideToken( key, RequirementMatcherFactory.createVersionMatcher( value ) ); matcher = RequirementMatcherFactory.createVersionMatcher( value );
} }
else else
{ {
jtc.addProvideToken( key, RequirementMatcherFactory.createExactMatcher( value ) ); matcher = RequirementMatcherFactory.createExactMatcher( value );
} }
jtc.addProvideToken( key, matcher );
} }
// populate the configuration section // populate the configuration section