]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorJulien Lancelot <julien.lancelot@gmail.com>
Tue, 14 May 2013 10:12:50 +0000 (12:12 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Tue, 14 May 2013 10:12:50 +0000 (12:12 +0200)
sonar-core/src/main/java/org/sonar/core/issue/db/ActionPlanDto.java
sonar-plugin-api/src/main/java/org/sonar/api/issue/ActionPlan.java
sonar-server/src/main/java/org/sonar/server/issue/ActionPlanService.java
sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java

index 63c4f8859be86c796a7392ff3155e192f3777827..d736e68715bb69fa6932200729a5e98ab79d7cab 100644 (file)
@@ -25,6 +25,9 @@ import org.apache.commons.lang.builder.ToStringStyle;
 import org.sonar.api.issue.ActionPlan;
 import org.sonar.core.issue.DefaultActionPlan;
 
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
 import java.util.Date;
 
 /**
@@ -73,11 +76,12 @@ public class ActionPlanDto {
     return this;
   }
 
+  @CheckForNull
   public String getDescription() {
     return description;
   }
 
-  public ActionPlanDto setDescription(String description) {
+  public ActionPlanDto setDescription(@Nullable String description) {
     this.description = description;
     return this;
   }
@@ -109,11 +113,12 @@ public class ActionPlanDto {
     return this;
   }
 
+  @CheckForNull
   public Date getDeadLine() {
     return deadLine;
   }
 
-  public ActionPlanDto setDeadLine(Date deadLine) {
+  public ActionPlanDto setDeadLine(@Nullable Date deadLine) {
     this.deadLine = deadLine;
     return this;
   }
index b0b2ee5ceea56afb49e9cb44d59bbeda255957f3..c9adf20c8d8830ce708f3fa16dcdfc224541f6a9 100644 (file)
@@ -45,7 +45,6 @@ public interface ActionPlan extends Serializable {
   @CheckForNull
   String description();
 
-  @CheckForNull
   String userLogin();
 
   String status();
index cfe588fd80083fa16ac4e657e9aa80189c34b680..d600ac0564f1f45d2de5a2350749dca2cde746e4 100644 (file)
@@ -34,7 +34,6 @@ import org.sonar.core.resource.ResourceDto;
 import org.sonar.core.resource.ResourceQuery;
 
 import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
 
 import java.util.Collection;
 import java.util.Date;
@@ -82,7 +81,8 @@ public class ActionPlanService implements ServerComponent {
     return actionPlanDto.toActionPlan();
   }
 
-  public ActionPlan findByKey(@CheckForNull String key) {
+  @CheckForNull
+  public ActionPlan findByKey(String key) {
     ActionPlanDto actionPlanDto = actionPlanDao.findByKey(key);
     if (actionPlanDto == null) {
       return null;
@@ -117,7 +117,7 @@ public class ActionPlanService implements ServerComponent {
   private Collection<ActionPlan> toActionPlans(Collection<ActionPlanDto> actionPlanDtos) {
     return newArrayList(Iterables.transform(actionPlanDtos, new Function<ActionPlanDto, ActionPlan>() {
       @Override
-      public ActionPlan apply(@Nullable ActionPlanDto actionPlanDto) {
+      public ActionPlan apply(ActionPlanDto actionPlanDto) {
         return actionPlanDto.toActionPlan();
       }
     }));
index d7dcd93c7aba137580fd3a8d7f9a7f98cc6cbddd..9eb7358570e3ecb7a2035e775e312deac3bd154d 100644 (file)
@@ -36,6 +36,8 @@ import org.sonar.core.resource.ResourceDto;
 import org.sonar.core.resource.ResourceQuery;
 import org.sonar.server.platform.UserSession;
 
+import javax.annotation.Nullable;
+
 import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Date;
@@ -187,7 +189,7 @@ public class InternalRubyIssueService implements ServerComponent {
   }
 
   @VisibleForTesting
-  Result<ActionPlan> createActionPlanResult(Map<String, String> parameters, String oldName) {
+  Result<ActionPlan> createActionPlanResult(Map<String, String> parameters, @Nullable String oldName) {
     Result<ActionPlan> result = new Result<ActionPlan>();
 
     String name = parameters.get("name");