You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Ladislav Thon (JIRA)" <ji...@apache.org> on 2016/03/02 15:23:18 UTC
[jira] [Created] (JCLOUDS-1088) azurecompute: NPE in
DeploymentToNodeMetadata.apply
Ladislav Thon created JCLOUDS-1088:
--------------------------------------
Summary: azurecompute: NPE in DeploymentToNodeMetadata.apply
Key: JCLOUDS-1088
URL: https://issues.apache.org/jira/browse/JCLOUDS-1088
Project: jclouds
Issue Type: Bug
Components: jclouds-labs
Reporter: Ladislav Thon
I'm using the Azure provider {{azurecompute}} from JClouds Labs master and I encountered a situation in which {{DeploymentToNodeMetadata.apply}} throws a NPE. This is because there's a code like this:
{code:java}
final CloudService cloudService = api.getCloudServiceApi().get(from.name());
if (cloudService != null) {
builder.location(FluentIterable.from(locations.get()).
firstMatch(LocationPredicates.idEquals(cloudService.location())).
orNull());
}
{code}
{{LocationPredicates.idEquals}} throws a NPE if its argument is {{null}}, and {{CloudService.location()}} is {{@Nullable}}. The location can easily be {{null}} if the cloud service is instead associated with an affinity group.
Therefore, {{DeploymentToNodeMetadata.apply}} should check if {{cloudService.location()}} is {{null}} and if it is, the location should be obtained from the affinity group.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)