3535import com .cloud .storage .Storage .StoragePoolType ;
3636import com .cloud .storage .Volume ;
3737import com .cloud .utils .db .GenericDao ;
38+ import com .cloud .utils .exception .CloudRuntimeException ;
3839import com .cloud .vm .VirtualMachine ;
3940import com .cloud .vm .VirtualMachine .State ;
4041
@@ -47,10 +48,10 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
4748 private long id ;
4849
4950 @ Column (name ="name" , updatable =false , nullable =false , length =255 )
50- private String name = null ;
51+ private final String name = null ;
5152
5253 @ Column (name ="display_name" , updatable =false , nullable =false , length =255 )
53- private String displayName = null ;
54+ private final String displayName = null ;
5455
5556 @ Column (name ="account_id" )
5657 private long accountId ;
@@ -59,7 +60,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
5960 private String accountUuid ;
6061
6162 @ Column (name ="account_name" )
62- private String accountName = null ;
63+ private final String accountName = null ;
6364
6465 @ Column (name ="account_type" )
6566 private short accountType ;
@@ -71,10 +72,10 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
7172 private String domainUuid ;
7273
7374 @ Column (name ="domain_name" )
74- private String domainName = null ;
75+ private final String domainName = null ;
7576
7677 @ Column (name ="domain_path" )
77- private String domainPath = null ;
78+ private final String domainPath = null ;
7879
7980 @ Column (name ="instance_group_id" )
8081 private long instanceGroupId ;
@@ -96,7 +97,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
9697 */
9798 @ Enumerated (value =EnumType .STRING )
9899 @ Column (name ="state" , updatable =true , nullable =false , length =32 )
99- private State state = null ;
100+ private final State state = null ;
100101
101102 @ Column (name =GenericDao .CREATED_COLUMN )
102103 private Date created ;
@@ -149,7 +150,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
149150 private String dataCenterUuid ;
150151
151152 @ Column (name ="data_center_name" )
152- private String dataCenterName = null ;
153+ private final String dataCenterName = null ;
153154
154155 @ Column (name ="security_group_enabled" )
155156 private boolean securityGroupEnabled ;
@@ -225,7 +226,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
225226 private String volume_uuid ;
226227
227228 @ Column (name = "volume_device_id" )
228- private Long volumeDeviceId = null ;
229+ private final Long volumeDeviceId = null ;
229230
230231 @ Column (name = "volume_type" )
231232 @ Enumerated (EnumType .STRING )
@@ -726,9 +727,11 @@ public Map<String, String> getDetails() {
726727 }
727728
728729 public String getDetail (String name ) {
729- assert (details != null ) : "Did you forget to load the details?" ;
730+ if (details == null ) {
731+ throw new CloudRuntimeException ("No details to get. Did you forget to load the details?" );
732+ }
730733
731- return details != null ? details .get (name ) : null ;
734+ return details .get (name );
732735 }
733736
734737 public String getUserData () {
0 commit comments