mirror of
https://github.com/apache/maven.git
synced 2025-02-07 10:38:47 +00:00
o Used injection for logger
o Generified code git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@788990 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
edbbc2027e
commit
6fd801fe6b
@ -36,7 +36,7 @@ public abstract class DefaultToolchain
|
||||
|
||||
private String type;
|
||||
|
||||
private Map provides = new HashMap /*<String,RequirementMatcher>*/ ( );
|
||||
private Map<String, RequirementMatcher> provides = new HashMap<String, RequirementMatcher>();
|
||||
|
||||
public static final String KEY_TYPE = "type"; //NOI18N
|
||||
|
||||
@ -81,7 +81,7 @@ public boolean matchesRequirements(Map requirements) {
|
||||
{
|
||||
String key = (String) it.next();
|
||||
|
||||
RequirementMatcher matcher = (RequirementMatcher) provides.get(key);
|
||||
RequirementMatcher matcher = provides.get( key );
|
||||
|
||||
if ( matcher == null )
|
||||
{
|
||||
@ -100,4 +100,4 @@ public boolean matchesRequirements(Map requirements) {
|
||||
protected Logger getLog() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public ToolchainPrivate[] getToolchainsForType( String type )
|
||||
|
||||
public void storeToolchainToBuildContext( ToolchainPrivate toolchain, MavenSession session )
|
||||
{
|
||||
Map context = retrieveContext( session );
|
||||
Map<String, Object> context = retrieveContext( session );
|
||||
context.put( getStorageKey( toolchain.getType() ), toolchain.getModel() );
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
import org.apache.maven.toolchain.ToolchainPrivate;
|
||||
import org.apache.maven.toolchain.model.ToolchainModel;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.logging.LogEnabled;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
@ -38,8 +38,10 @@
|
||||
*/
|
||||
@Component( role = ToolchainFactory.class, hint = "jdk" )
|
||||
public class DefaultJavaToolchainFactory
|
||||
implements ToolchainFactory, LogEnabled
|
||||
implements ToolchainFactory
|
||||
{
|
||||
|
||||
@Requirement
|
||||
private Logger logger;
|
||||
|
||||
public DefaultJavaToolchainFactory( )
|
||||
@ -106,10 +108,5 @@ protected Logger getLogger()
|
||||
{
|
||||
return logger;
|
||||
}
|
||||
|
||||
public void enableLogging( Logger logger )
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user