File tree Expand file tree Collapse file tree 2 files changed +2
-28
lines changed
api/src/main/java/org/apache/cloudstack/api/command/user/vm Expand file tree Collapse file tree 2 files changed +2
-28
lines changed Original file line number Diff line number Diff line change 1616// under the License.
1717package org .apache .cloudstack .api .command .user .vm ;
1818
19- import java .util .Collection ;
20- import java .util .HashMap ;
21- import java .util .Iterator ;
2219import java .util .List ;
2320import java .util .Map ;
2421
@@ -99,17 +96,7 @@ public Long getServiceOfferingId() {
9996 //it is because details.values() cannot be cast to a map.
10097 //it gives a exception
10198 public Map <String , String > getDetails () {
102- Map <String , String > customparameterMap = new HashMap <String , String >();
103- if (details != null && details .size () != 0 ) {
104- Collection parameterCollection = details .values ();
105- Iterator iter = parameterCollection .iterator ();
106- while (iter .hasNext ()) {
107- HashMap <String , String > value = (HashMap <String , String >)iter .next ();
108- for (String key : value .keySet ()) {
109- customparameterMap .put (key , value .get (key ));
110- }
111- }
112- }
99+ Map <String , String > customparameterMap = convertDetailsToMap (details );
113100
114101 if (shrinkOk != null ) customparameterMap .put (ApiConstants .SHRINK_OK , String .valueOf (isShrinkOk ()));
115102 if (autoMigrate != null ) customparameterMap .put (ApiConstants .AUTO_MIGRATE , String .valueOf (getAutoMigrate ()));
Original file line number Diff line number Diff line change 1616// under the License.
1717package org .apache .cloudstack .api .command .user .vm ;
1818
19- import java .util .Collection ;
20- import java .util .HashMap ;
21- import java .util .Iterator ;
2219import java .util .Map ;
2320
2421import org .apache .log4j .Logger ;
@@ -95,17 +92,7 @@ public Long getServiceOfferingId() {
9592 }
9693
9794 public Map <String , String > getDetails () {
98- Map <String , String > customparameterMap = new HashMap <String , String >();
99- if (details != null && details .size () != 0 ) {
100- Collection parameterCollection = details .values ();
101- Iterator iter = parameterCollection .iterator ();
102- while (iter .hasNext ()) {
103- HashMap <String , String > value = (HashMap <String , String >)iter .next ();
104- for (String key : value .keySet ()) {
105- customparameterMap .put (key , value .get (key ));
106- }
107- }
108- }
95+ Map <String , String > customparameterMap = convertDetailsToMap (details );
10996
11097 if (shrinkOk != null ) customparameterMap .put (ApiConstants .SHRINK_OK , String .valueOf (isShrinkOk ()));
11198 if (autoMigrate != null ) customparameterMap .put (ApiConstants .AUTO_MIGRATE , String .valueOf (getAutoMigrate ()));
You can’t perform that action at this time.
0 commit comments