incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r486820 - in /incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable: CapabilityMatcher.java impl/CapabilityMatcherImpl.java impl/NetExecutableFactoryImpl.java
Date Wed, 13 Dec 2006 19:54:45 GMT
Author: sisbell
Date: Wed Dec 13 11:54:44 2006
New Revision: 486820

URL: http://svn.apache.org/viewvc?view=rev&rev=486820
Log:
Removed unneeded init method.

Modified:
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/CapabilityMatcher.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/CapabilityMatcher.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/CapabilityMatcher.java?view=diff&rev=486820&r1=486819&r2=486820
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/CapabilityMatcher.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/CapabilityMatcher.java
Wed Dec 13 11:54:44 2006
@@ -88,14 +88,4 @@
                                                    List<ExecutableMatchPolicy> matchPolicies
)
         throws PlatformUnsupportedException;
 
-    /**
-     * Initializes the factory.
-     *
-     * @param project the maven project
-     * @throws org.apache.maven.dotnet.InitializationException if there is a problem initializing
this factory
-     *
-     */
-    void init( MavenProject project )
-        throws InitializationException;
-
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java?view=diff&rev=486820&r1=486819&r2=486820
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CapabilityMatcherImpl.java
Wed Dec 13 11:54:44 2006
@@ -19,7 +19,6 @@
 package org.apache.maven.dotnet.executable.impl;
 
 import org.apache.maven.dotnet.PlatformUnsupportedException;
-import org.apache.maven.dotnet.InitializationException;
 import org.apache.maven.dotnet.executable.*;
 import org.apache.maven.dotnet.executable.compiler.*;
 
@@ -29,53 +28,49 @@
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
-import org.apache.maven.project.MavenProject;
 
 /**
+ * Provides an implementation of the <code>CapabilityMatcher</code> interface.
+ *
  * @author Shane Isbell
  */
 public class CapabilityMatcherImpl
     implements CapabilityMatcher, LogEnabled
 {
-
     private Logger logger;
 
-    protected MavenProject project;
-
-    protected RepositoryRegistry repositoryRegistry;
+    private RepositoryRegistry repositoryRegistry;
 
     public void enableLogging( Logger logger )
     {
         this.logger = logger;
     }
 
-    public void init( MavenProject project )
-        throws InitializationException
-    {
-        this.project = project;
-    }
-
     public CompilerCapability matchCompilerCapabilityFor( CompilerRequirement compilerRequirement,
                                                           List<ExecutableMatchPolicy>
matchPolicies )
         throws PlatformUnsupportedException
     {
+        if ( compilerRequirement == null )
+        {
+            throw new PlatformUnsupportedException( "NMAVEN-065-006: The compiler requirement
should not be null." );
+        }
         if ( matchPolicies == null )
         {
             matchPolicies = new ArrayList<ExecutableMatchPolicy>();
         }
         matchPolicies.add( MatchPolicyFactory.createOperatingSystemPolicy( System.getProperty(
"os.name" ) ) );
         matchPolicies.add( MatchPolicyFactory.createVendorPolicy( compilerRequirement.getVendor()
) );
-        matchPolicies.add( MatchPolicyFactory.createLanguagePolicy( ( compilerRequirement
).getLanguage() ) );
+        matchPolicies.add( MatchPolicyFactory.createLanguagePolicy( compilerRequirement.getLanguage()
) );
         matchPolicies.add(
             MatchPolicyFactory.createFrameworkVersionPolicy( compilerRequirement.getFrameworkVersion()
) );
         matchPolicies.add( MatchPolicyFactory.createProfilePolicy( compilerRequirement.getProfile()
) );
         return (CompilerCapability) matchFromExecutableCapabilities( getCompilerCapabilities(),
matchPolicies );
     }
 
-    public CompilerCapability matchCompilerCapabilityFor( CompilerRequirement executableRequirement
)
+    public CompilerCapability matchCompilerCapabilityFor( CompilerRequirement compilerRequirement
)
         throws PlatformUnsupportedException
     {
-        return matchCompilerCapabilityFor( executableRequirement, new ArrayList<ExecutableMatchPolicy>()
);
+        return matchCompilerCapabilityFor( compilerRequirement, new ArrayList<ExecutableMatchPolicy>()
);
     }
 
     /**

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java?view=diff&rev=486820&r1=486819&r2=486820
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
Wed Dec 13 11:54:44 2006
@@ -64,8 +64,6 @@
 
     private StateMachineProcessor processor;
 
-    private boolean isFactoryInited = false;
-
     private Logger logger;
 
     public void enableLogging( Logger logger )
@@ -81,18 +79,7 @@
                                                         File assemblyPath )
         throws PlatformUnsupportedException
     {
-        if ( !isFactoryInited )
-        {
-            try
-            {
-                capabilityMatcher.init( project );
-                isFactoryInited = true;
-            }
-            catch ( InitializationException e )
-            {
-                throw new PlatformUnsupportedException( "NMAVEN-066-002: Unable to load the
Executable Factory:", e );
-            }
-        }
+
         VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
         vendorInfo.setVendorVersion( compilerRequirement.getVendorVersion() );
         vendorInfo.setFrameworkVersion( compilerRequirement.getFrameworkVersion() );
@@ -145,18 +132,6 @@
                                                          List<String> commands )
         throws PlatformUnsupportedException
     {
-        if ( !isFactoryInited )
-        {
-            try
-            {
-                capabilityMatcher.init( project );
-                isFactoryInited = true;
-            }
-            catch ( InitializationException e )
-            {
-                throw new PlatformUnsupportedException( "NMAVEN-066-009: Unable to load the
Executable Factory:", e );
-            }
-        }
 
         try
         {
@@ -225,18 +200,6 @@
                                               MavenProject project, List<String> commands,
File netHome )
         throws PlatformUnsupportedException
     {
-        if ( !isFactoryInited )
-        {
-            try
-            {
-                capabilityMatcher.init( project );
-            }
-            catch ( InitializationException e )
-            {
-                throw new PlatformUnsupportedException( "NMAVEN-066-000: Unable to load the
Executable Factory:", e );
-            }
-            isFactoryInited = true;
-        }
 
         VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
         vendorInfo.setVendorVersion( "" );



Mime
View raw message