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

    https://github.com/apache/brooklyn-server/pull/737#discussion_r124058288
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
 ---
    @@ -855,24 +893,50 @@ private boolean attemptType(String key, 
CatalogItemType candidateCiType) {
                 }
                 // first look in collected items, if a key is given
                 String type = (String) item.get("type");
    -            String version = null;
    -            if (CatalogUtils.looksLikeVersionedId(type)) {
    -                version = CatalogUtils.getVersionFromVersionedId(type);
    -                type = CatalogUtils.getSymbolicNameFromVersionedId(type);
    -            }
    +            
                 if (type!=null && key!=null) {
                     for (CatalogItemDtoAbstract<?,?> candidate: 
itemsDefinedSoFar) {
                         if (candidateCiType == candidate.getCatalogItemType() 
&&
                                 (type.equals(candidate.getSymbolicName()) || 
type.equals(candidate.getId()))) {
    -                        if (version==null || 
version.equals(candidate.getVersion())) {
    -                            // matched - exit
    -                            catalogItemType = candidateCiType;
    -                            planYaml = candidateYaml;
    -                            resolved = true;
    -                            return true;
    +                        // matched - exit
    +                        catalogItemType = candidateCiType;
    +                        planYaml = candidateYaml;
    +                        resolved = true;
    +                        return true;
    +                    }
    +                }
    +            }
    +            {
    +                // legacy routine; should be the same as above code added 
in 0.12 because:
    +                // if type is symbolic_name, the type will match below, 
and version will be null so any version allowed to match 
    --- End diff --
    
    I'm afraid I don't follow this - is it the case that a type which is just a 
`symbolic_name` will be taken care of by line 900 above (so you actually mean 
"the type will match above" on this line i.e. at line 900); but how is the next 
case handled, where type is of form `symbolic_name:version`?   When you say 
`the id will match`, where does that happen?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to