Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/617#discussion_r30501739
  
    --- Diff: 
core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
    @@ -986,7 +1045,12 @@ private DeploymentPlan makePlanFromYaml(String yaml) {
         }
         
         private CatalogItem<?,?> addItemDto(CatalogItemDtoAbstract<?, ?> 
itemDto, boolean forceUpdate) {
    -        checkItemNotExists(itemDto, forceUpdate);
    +        CatalogItem<?, ?> existingDto = 
checkItemIsDuplicateOrDisallowed(itemDto, true, forceUpdate);
    --- End diff --
    
    Name `checkItemIsDuplicateOrDisallowed` is confusing. The `check...` prefix 
elsewhere follows the guava convention: it throws an exception if the check 
fails (e.g. `checkNotNull` throws if the condition "not null" fails). Reading 
this suggests we would throw if "is duplicate or disallowed" fails. But it's 
the opposite: we're checking that either it's not a duplicate or is allowed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to