Author: adietish
Date: 2010-12-29 15:37:49 -0500 (Wed, 29 Dec 2010)
New Revision: 27808
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
Log:
fixed ArrayOutOfBoundsException
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29
20:35:57 UTC (rev 27807)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29
20:37:49 UTC (rev 27808)
@@ -534,7 +534,7 @@
Document document = getDocument(xml);
instance.setId(getAttributeValues(document, "instance",
"id").get(0));
instance.setName(getElementTextValues(document, "name").get(0));
- instance.setOwnerId(getElementTextValues(document, "owner_id").get(0));
+ updateOwnerId(instance, document);
instance.setImageId(getIdFromHref(getAttributeValues(document, "image",
"href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
instance.setProfileId(getIdFromHref(getAttributeValues(document,
"hardware_profile", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
updateProfileProperties(instance, getPropertyNodes(document,
"hardware_profile")); //$NON-NLS-1$
@@ -549,6 +549,13 @@
return instance;
}
+ private void updateOwnerId(Instance instance, Document document) {
+ List<String> values = getElementTextValues(document, "owner_id");
+ if (values.size() > 0) {
+ instance.setOwnerId(values.get(0));
+ }
+ }
+
private void updateProfileProperties(Instance instance,
List<Node> propertyNodes) {
if (propertyNodes != null) {
Show replies by date