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/03/03 22:07:38 UTC

svn commit: r1663790 - in /maven/enforcer/trunk/enforcer-api: ./ src/main/java/org/apache/maven/enforcer/rule/api/

Author: khmarbaise
Date: Tue Mar  3 21:07:38 2015
New Revision: 1663790

URL: http://svn.apache.org/r1663790
Log:
[MENFORCER-227] Document nullability with @Nonnull on EnforcerRule API

Modified:
    maven/enforcer/trunk/enforcer-api/pom.xml
    maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java
    maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java
    maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java

Modified: maven/enforcer/trunk/enforcer-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-api/pom.xml?rev=1663790&r1=1663789&r2=1663790&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-api/pom.xml (original)
+++ maven/enforcer/trunk/enforcer-api/pom.xml Tue Mar  3 21:07:38 2015
@@ -45,6 +45,12 @@
       <artifactId>plexus-container-default</artifactId>
       <version>1.0-alpha-9</version>
     </dependency>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <version>3.0.0</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>

Modified: maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java?rev=1663790&r1=1663789&r2=1663790&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java (original)
+++ maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java Tue Mar  3 21:07:38 2015
@@ -19,6 +19,9 @@ package org.apache.maven.enforcer.rule.a
  * under the License.
  */
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
 /**
  * Interface to be implemented by any rules executed by the enforcer.
  *
@@ -40,7 +43,7 @@ public interface EnforcerRule
      *
      * @throws EnforcerRuleException the enforcer rule exception
      */
-    void execute( EnforcerRuleHelper helper )
+    void execute( @Nonnull EnforcerRuleHelper helper )
         throws EnforcerRuleException;
 
     /**
@@ -61,7 +64,7 @@ public interface EnforcerRule
      *
      * @return <code>true</code> if the stored results are valid for the same id.
      */
-    boolean isResultValid( EnforcerRule cachedRule );
+    boolean isResultValid( @Nonnull EnforcerRule cachedRule );
 
     /**
      * If the rule is to be cached, this id is used as part of the key. This can allow rules to take parameters
@@ -70,6 +73,7 @@ public interface EnforcerRule
      * @return id to be used by the enforcer to determine uniqueness of cache results. The ids only need to be unique
      * within a given rule implementation as the full key will be [classname]-[id]
      */
+    @Nullable
     String getCacheId();
 
 }

Modified: maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java?rev=1663790&r1=1663789&r2=1663790&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java (original)
+++ maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java Tue Mar  3 21:07:38 2015
@@ -19,6 +19,8 @@ package org.apache.maven.enforcer.rule.a
  * under the License.
  */
 
+import javax.annotation.Nonnull;
+
 /**
  * Interface to be implemented by any rules as of version 2.0 executed by the enforcer.
  *
@@ -33,6 +35,7 @@ public interface EnforcerRule2 extends E
      *
      * @return level
      */
+    @Nonnull
     EnforcerLevel getLevel();
 
 }

Modified: maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java?rev=1663790&r1=1663789&r2=1663790&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java (original)
+++ maven/enforcer/trunk/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java Tue Mar  3 21:07:38 2015
@@ -22,6 +22,8 @@ package org.apache.maven.enforcer.rule.a
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.Nonnull;
+
 import org.apache.maven.plugin.logging.Log;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
@@ -44,6 +46,7 @@ public interface EnforcerRuleHelper
      *
      * @return the log
      */
+    @Nonnull
     Log getLog ();
 
     /**
@@ -55,6 +58,7 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
+    @Nonnull
     Object getComponent ( Class clazz )
         throws ComponentLookupException;
 
@@ -67,6 +71,7 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
+    @Nonnull
     Object getComponent ( String componentKey )
         throws ComponentLookupException;