error in xmlrpc typeconversion

This commit is contained in:
Peter Hormanns 2012-07-18 15:30:40 +00:00
parent 32f8e90490
commit a19480f55b

View File

@ -63,10 +63,12 @@ public class DomainRemote extends AbstractRemote {
} }
Set<DomainOption> domainOptionsSet = new TreeSet<DomainOption>(); Set<DomainOption> domainOptionsSet = new TreeSet<DomainOption>();
Object domOptsObj = setParams.get("domainoptions"); Object domOptsObj = setParams.get("domainoptions");
if (domOptsObj != null && domOptsObj instanceof List<?>) { if (domOptsObj != null && domOptsObj instanceof Object[]) {
List<String> domOptions = (List<String>) domOptsObj; Object[] domOptions = (Object[]) domOptsObj;
for (String optString : domOptions) { for (int i=0; i<domOptions.length; i++) {
domOptions.add(optString); DomainOption domainOption = new DomainOption();
domainOption.setName((String)domOptions[i]);
domainOptionsSet.add(domainOption);
} }
} }
dom.setDomainOptions(domainOptionsSet); dom.setDomainOptions(domainOptionsSet);