fixed null pointers

This commit is contained in:
Adrian Cole 2012-01-15 19:45:55 -08:00
parent 0d3bd74156
commit 69c9fd6905
2 changed files with 7 additions and 6 deletions

View File

@ -440,7 +440,8 @@ public class TemplateBuilderImpl implements TemplateBuilder {
Ordering.<String> natural().nullsLast()) Ordering.<String> natural().nullsLast())
.compare(left.getOperatingSystem().getDescription(), right.getOperatingSystem().getDescription(),// .compare(left.getOperatingSystem().getDescription(), right.getOperatingSystem().getDescription(),//
Ordering.<String> natural().nullsLast()) Ordering.<String> natural().nullsLast())
.compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch()).result(); .compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch(),//
Ordering.<String> natural().nullsLast()).result();
} }
}; };

View File

@ -281,12 +281,12 @@ public abstract class BaseTemplateBuilderLiveTest extends BaseVersionedServiceLi
assertEquals(context.getComputeService().templateBuilder().build().getImage().getDefaultCredentials(), assertEquals(context.getComputeService().templateBuilder().build().getImage().getDefaultCredentials(),
LoginCredentials.builder().user(user).password(pass).authenticateSudo(auth).build()); LoginCredentials.builder().user(user).password(pass).authenticateSudo(auth).build());
} finally { } finally {
if (context != null) if (context != null){
context.close();
// Need to clear persisted credentials; otherwise next time a ComputeServiceContext is created // Need to clear persisted credentials; otherwise next time a ComputeServiceContext is created
// then it will have these "foo" credentials! // then it will have these "foo" credentials!
context.credentialStore().clear(); context.credentialStore().clear();
context.close();
}
} }
} }