GEODE-3095: fix parameter type mismatch between the diskstore command and 
controller


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

Branch: refs/heads/feature/GEODE-2804v3
Commit: ee5f60c7fdac7227983a7e3bfac7094593e15ed0
Parents: d8a11d1
Author: Jinmei Liao <jil...@pivotal.io>
Authored: Mon Jun 19 11:02:20 2017 -0700
Committer: Jinmei Liao <jil...@pivotal.io>
Committed: Mon Jun 19 21:18:59 2017 -0700

----------------------------------------------------------------------
 .../web/controllers/DiskStoreCommandsController.java | 11 ++++++-----
 .../management/internal/security/TestCommand.java    | 15 +++++++++------
 2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ee5f60c7/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DiskStoreCommandsController.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DiskStoreCommandsController.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DiskStoreCommandsController.java
index c613a8a..2e06811 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DiskStoreCommandsController.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/DiskStoreCommandsController.java
@@ -14,9 +14,8 @@
  */
 package org.apache.geode.management.internal.web.controllers;
 
-import org.apache.geode.internal.lang.StringUtils;
-import org.apache.geode.management.internal.cli.i18n.CliStrings;
-import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import java.util.concurrent.Callable;
+
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -25,7 +24,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import java.util.concurrent.Callable;
+import org.apache.geode.internal.lang.StringUtils;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 
 /**
  * The DiskStoreCommandsController class implements GemFire Management REST 
API web service
@@ -107,7 +108,7 @@ public class DiskStoreCommandsController extends 
AbstractCommandsController {
       @RequestParam(value = 
CliStrings.CREATE_DISK_STORE__DISK_USAGE_WARNING_PCT,
           defaultValue = "90") final Float diskUsageWarningPercentage,
       @RequestParam(value = 
CliStrings.CREATE_DISK_STORE__DISK_USAGE_CRITICAL_PCT,
-          defaultValue = "99") final Integer diskUsageCriticalPercentage,
+          defaultValue = "99") final Float diskUsageCriticalPercentage,
       @RequestParam(value = CliStrings.GROUP, required = false) final String[] 
groups) {
     CommandStringBuilder command = new 
CommandStringBuilder(CliStrings.CREATE_DISK_STORE);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ee5f60c7/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
index ea4b60d..800d0da 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
@@ -14,14 +14,16 @@
  */
 package org.apache.geode.management.internal.security;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.shiro.authz.Permission;
+
 import org.apache.geode.security.ResourcePermission;
-import org.apache.geode.security.ResourcePermission.Target;
 import org.apache.geode.security.ResourcePermission.Operation;
 import org.apache.geode.security.ResourcePermission.Resource;
-import org.apache.shiro.authz.Permission;
-
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.geode.security.ResourcePermission.Target;
 
 public class TestCommand {
 
@@ -77,7 +79,8 @@ public class TestCommand {
   }
 
   public static List<TestCommand> getCommands() {
-    return testCommands;
+    // returns a copy of the list every time
+    return testCommands.stream().collect(Collectors.toList());
   }
 
   public static List<TestCommand> getPermittedCommands(Permission permission) {

Reply via email to