From fc2d949ae2433affc3c293c39a60270d4071b046 Mon Sep 17 00:00:00 2001 From: Adam Lowe Date: Fri, 27 Apr 2012 16:40:29 +0100 Subject: [PATCH] Forcing User to default to empty set of Roles --- .../org/jclouds/openstack/keystone/v2_0/domain/User.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/domain/User.java b/common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/domain/User.java index 0ce93ccec3..e8d5ff7dcb 100644 --- a/common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/domain/User.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/keystone/v2_0/domain/User.java @@ -98,11 +98,17 @@ public class User implements Comparable { protected final String name; protected final Set roles; - public User(String id, String name, Set roles) { + protected User(String id, String name, Set roles) { this.id = checkNotNull(id, "id"); this.name = checkNotNull(name, "name"); this.roles = ImmutableSet.copyOf(checkNotNull(roles, "roles")); } + + protected User() { + id = null; + name = null; + roles = ImmutableSet.of(); + } /** * When providing an ID, it is assumed that the user exists in the current OpenStack deployment