Delg,ListActivity,ListApprovals.java-remove useless assignments
[aaf/authz.git] / auth / auth-cmd / src / main / java / org / onap / aaf / auth / cmd / user / Delg.java
index 3cb9fb0..6e96728 100644 (file)
@@ -3,13 +3,15 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2018 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,9 +43,9 @@ import aaf.v2_0.DelgRequest;
 
 public class Delg extends BaseCmd<User> {
     static final String AUTHZ_DELG = "/authz/delegate";
-    private final static String[] options = {"add","upd","del"};
+    private static final String[] options = {"add","upd","del"};
 
-    public Delg(User user) throws APIException {
+    public Delg(User user){
         super(user,"delegate",
                 new Param(optionsToString(options),true),
                 new Param("from",true),
@@ -60,7 +62,7 @@ public class Delg extends BaseCmd<User> {
                 int idx = index;
                 DelgRequest dr = new DelgRequest();
                 setStartEnd(dr);
-        
+
                 int option= whichOption(options, args[idx++]);
                 String user = fullID(args[idx++]);
                 dr.setUser(user);
@@ -70,36 +72,36 @@ public class Delg extends BaseCmd<User> {
                     if (option<2 && args.length>idx) {
                         Date date;
                         try {
-                            date = Chrono.dateOnlyFmt.parse(args[idx++]);
+                            date = Chrono.dateOnlyFmt.parse(args[idx]);
                         } catch (ParseException e) {
                             throw new CadiException(e);
                         }
                         dr.setEnd(Chrono.timeStamp(date));
                     }
                 }
-        
+
                 Future<DelgRequest> fp;
                 RosettaDF<DelgRequest> df = getDF(DelgRequest.class);
                 String verb;
                 setQueryParamsOn(client);
 
                 switch(option) {
-                    case 0: 
+                    case 0:
                         fp = client.create(AUTHZ_DELG, df, dr);
                         verb = "Added";
                         break;
-                    case 1: 
-                        fp = client.update(AUTHZ_DELG, df, dr); 
+                    case 1:
+                        fp = client.update(AUTHZ_DELG, df, dr);
                         verb = "Updated";
                         break;
-                    case 2: 
-                        fp = client.delete(AUTHZ_DELG, df, dr); 
+                    case 2:
+                        fp = client.delete(AUTHZ_DELG, df, dr);
                         verb = "Deleted";
                         break;
                     default:
                         throw new CadiException("Bad Argument");
                 };
-                
+
                 if (fp.get(AAFcli.timeout())) {
                     pw().append("Delegate ");
                     pw().println(verb);
@@ -112,8 +114,8 @@ public class Delg extends BaseCmd<User> {
     }
 
     @Override
-    public void detailedHelp(int _indent, StringBuilder sb) {
-            int indent = _indent;
+    public void detailedHelp(int indentParam, StringBuilder sb) {
+            int indent = indentParam;
         detailLine(sb,indent,"Add, Update or Delete Delegate");
         indent+=2;
         detailLine(sb,indent,"A Delegate is a person who will temporarily cover the Approval and");