cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to edfe6f4
Date Sun, 28 Jun 2015 10:41:56 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master f5847147c -> edfe6f4d4


findbugs Boolean return null in getter not in is-query

Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes #534


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/edfe6f4d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/edfe6f4d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/edfe6f4d

Branch: refs/heads/master
Commit: edfe6f4d4f805b91fe653627c2e6c7925a6bfd07
Parents: f584714
Author: Daan Hoogland <daan@onecht.net>
Authored: Fri Jun 26 15:29:25 2015 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Sun Jun 28 12:41:44 2015 +0200

----------------------------------------------------------------------
 .../api/BaseUpdateTemplateOrIsoCmd.java           |  4 ++--
 .../api/command/user/iso/UpdateIsoCmd.java        |  2 +-
 .../command/user/template/UpdateTemplateCmd.java  |  3 +--
 .../com/cloud/template/TemplateManagerImpl.java   | 18 ++++++++++++++----
 4 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edfe6f4d/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index 31de029..5dc2b06 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -77,7 +77,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
 
-    public Boolean isBootable() {
+    public Boolean getBootable() {
         return bootable;
     }
 
@@ -101,7 +101,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
         return osTypeId;
     }
 
-    public Boolean isPasswordEnabled() {
+    public Boolean getPasswordEnabled() {
         return passwordEnabled;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edfe6f4d/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
index d072c0a..ccf5b8a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
@@ -44,7 +44,7 @@ public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
     }
 
     @Override
-    public Boolean isPasswordEnabled() {
+    public Boolean getPasswordEnabled() {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edfe6f4d/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
index 81da7ee..0a01e48 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
@@ -39,7 +39,7 @@ public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
     /////////////////////////////////////////////////////
 
     @Override
-    public Boolean isBootable() {
+    public Boolean getBootable() {
         return null;
     }
 
@@ -52,7 +52,6 @@ public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
         return s_name;
     }
 
-    @SuppressWarnings("unchecked")
     public TemplateResponse getResponse() {
        return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edfe6f4d/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 1135518..e9581e2 100644
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1819,10 +1819,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         String displayText = cmd.getDisplayText();
         String format = cmd.getFormat();
         Long guestOSId = cmd.getOsTypeId();
-        Boolean passwordEnabled = cmd.isPasswordEnabled();
+        Boolean passwordEnabled = cmd.getPasswordEnabled();
         Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
         Boolean isRoutingTemplate = cmd.isRoutingType();
-        Boolean bootable = cmd.isBootable();
+        Boolean bootable = cmd.getBootable();
         Boolean requiresHvm = cmd.getRequiresHvm();
         Integer sortKey = cmd.getSortKey();
         Map details = cmd.getDetails();
@@ -1846,9 +1846,19 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
             }
         }
 
+        // update is needed if any of the fields below got filled by the user
         boolean updateNeeded =
-                !(name == null && displayText == null && format == null &&
guestOSId == null && passwordEnabled == null && bootable == null &&
requiresHvm == null && sortKey == null &&
-                        isDynamicallyScalable == null && isRoutingTemplate == null
&& details == null);
+                !(name == null &&
+                  displayText == null &&
+                  format == null &&
+                  guestOSId == null &&
+                  passwordEnabled == null &&
+                  bootable == null &&
+                  requiresHvm == null &&
+                  sortKey == null &&
+                  isDynamicallyScalable == null &&
+                  isRoutingTemplate == null &&
+                  details == null);
         if (!updateNeeded) {
             return template;
         }


Mime
View raw message