You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2015/01/02 22:33:57 UTC

svn commit: r1649130 - /maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java

Author: khmarbaise
Date: Fri Jan  2 21:33:57 2015
New Revision: 1649130

URL: http://svn.apache.org/r1649130
Log:
[MENFORCER-220] Make real MojoExecution available through the EnforcerExpressionEvaluator
 Readded back the old constructor to keep backward compatibility cause we can't 
 be sure that this has not being used. Marked the old constructor as deprecated.

Modified:
    maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java

Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java?rev=1649130&r1=1649129&r2=1649130&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java Fri Jan  2 21:33:57 2015
@@ -22,12 +22,13 @@ package org.apache.maven.plugins.enforce
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.PluginParameterExpressionEvaluator;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.path.PathTranslator;
 
 /**
- * The Class EnforcerExpressionEvaluator. This class wraps the PluginParameterExpressionEvaluator
- * because it can't be accessed directly in 2.0.x so we must create a new one.
+ * The Class EnforcerExpressionEvaluator. This class wraps the PluginParameterExpressionEvaluator because it can't be
+ * accessed directly in 2.0.x so we must create a new one.
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
@@ -38,15 +39,30 @@ public class EnforcerExpressionEvaluator
     /**
      * The Constructor.
      *
-     * @param theContext the the context
-     * @param thePathTranslator the the path translator
-     * @param theProject the the project
+     * @param theContext {@link MavenSession}
+     * @param thePathTranslator {@link PathTranslator}
+     * @param theProject {@link MavenProject}
+     * @param theExecution {@link MojoExecution}
      */
     public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator,
                                         MavenProject theProject, MojoExecution theExecution )
     {
-        super( theContext, theExecution, thePathTranslator, null, theProject,
-               theContext.getExecutionProperties() );
+        super( theContext, theExecution, thePathTranslator, null, theProject, theContext.getExecutionProperties() );
     }
 
+    /**
+     * This constructor is kept for backward compatibility.
+     * 
+     * @param theContext {@link MavenSession}
+     * @param thePathTranslator {@link PathTranslator}
+     * @param theProject {@link MavenProject}
+     * 
+     * @deprecated Will be removed with 2.0
+     */
+    public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator,
+                                        MavenProject theProject )
+    {
+        super( theContext, new MojoExecution( new MojoDescriptor() ), thePathTranslator, null, theProject,
+               theContext.getExecutionProperties() );
+    }
 }